News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Custom fields and filters of post

Started by davidhs, February 21, 2014, 01:53:17 PM

Previous topic - Next topic

davidhs

Quote from: Arantor on March 30, 2019, 07:12:10 PM
The editor has been updated since then; it's possible you might find it works now.
I was waiting for the next release of SMF 2.1, but I did not know that RC1 and RC2 are already there! I will adapt my mods.

Sesquipedalian

Among other things, you will want to pay attention to 2.1's changes to the way input fields are handled on the post authoring form. The $context['posting_fields'] array, the integrate_post_end hook, and this documentation will be of interest.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

tjrpcaft

Excuse me if my reply is "necro-posting", but could someone paste here links of forums that use this mod?

I would like to try it, but I would like to see some real examples first. Is that ok?

Regards


Benqo

Hi,

I tried to install this mod on my new forum and find it a bit strange that files in the installation section and in core theme are reported differently. In installation section ./Themes/default/MessageIndex.template.php is marked as "Test successful", but in core theme as "Test failed" (see screenshots.

So, what message should I trust now? Or is it because the files in question are modified twice, first mod working, second one not?

Regards, Thomas

Arantor

It's more that SMF ships with 2 themes, the default theme is what this plugin was built for, and the old theme, named "Core" is sufficiently different it doesn't work. If you're using Curve or any other third party theme, ignore the issues for Core.
Holder of controversial views, all of which my own.


Benqo

Well, it also reports errors for the theme I'm using as well.  ;D

Not sure, what I should do and if it is worth to do the changes manually.

Regards, Thomas

tjrpcaft

Quote from: tjrpcaft on April 08, 2019, 04:10:46 PM
Excuse me if my reply is "necro-posting", but could someone paste here links of forums that use this mod?

I would like to try it, but I would like to see some real examples first. Is that ok?

Regards

bump

davidhs

Quote from: tjrpcaft on April 08, 2019, 04:10:46 PM
Excuse me if my reply is "necro-posting", but could someone paste here links of forums that use this mod?

I would like to try it, but I would like to see some real examples first. Is that ok?

Regards
I can not tell you any forum but you can search in this topic. Here you can see images of some users. For example:
https://www.simplemachines.org/community/index.php?topic=518886.msg3967090#msg3967090

Also you can install a test forum, install this mod and do the example of first post of this topic.




Quote from: Benqo on April 11, 2019, 11:37:46 AM
Well, it also reports errors for the theme I'm using as well.  ;D

Not sure, what I should do and if it is worth to do the changes manually.

Regards, Thomas
I suppose your forum is SMF 1.1.x/2.0.x (not 2.1 Beta/RC).

My mod need do changes in some files modified by another mod. Can you attach image of errors in install?

moyack

Quote from: davidhs on April 12, 2019, 01:09:49 PM
I can not tell you any forum but you can search in this topic. Here you can see images of some users. For example:
https://www.simplemachines.org/community/index.php?topic=518886.msg3967090#msg3967090

Well, my site could make this mod a good advertisement...

https://wc3modding.info/wc3-editing-tools/ (message index)
https://wc3modding.info/4263/the-jass-newgen-pack-jngp-2-0/ (topic example)

davidhs

Quote from: moyack on April 12, 2019, 09:30:42 PM
Quote from: davidhs on April 12, 2019, 01:09:49 PM
I can not tell you any forum but you can search in this topic. Here you can see images of some users. For example:
https://www.simplemachines.org/community/index.php?topic=518886.msg3967090#msg3967090

Well, my site could make this mod a good advertisement...

https://wc3modding.info/wc3-editing-tools/ (message index)
https://wc3modding.info/4263/the-jass-newgen-pack-jngp-2-0/ (topic example)
Good example, I like it!

Comments:

1. Field Keywords. When you add/modify a "WC3 Tools" this field is a text button and user can write keywords comma separeted, but different users can write similar words for same keyword (Jass, jass, jas, jjas, jaas...). If you define this button as combo box (text button + select box), user can write keywords in text button or select keywords from select box. Keywords written in text button will be added in select box when other register will created and could reused.

2. Add link to filter in values. Perhaps you tried this or you do not want... You can write values of field with links to filter (now you have only text) and when click on a value, filter is activated. You can try this code in templates:
<?php

if (!function_exists('cffp_filter'))
{
function cffp_filter($id_group$field_value$field_database$max 0)
{
$value_array explode(', '$field_value);

$filter_array = array();
foreach ($value_array as $k => $value)
{
if ($max && $k >= $max// If there are many values, perhaps is better show only $max values.
break; // Exit foreach.

$filter_array[] = '<a href="#" onclick="javascript: if (document.getElementById(\'cffp_filters\') && document.getElementById(\'cffp_' $id_group '_' $field_database '\')) { document.getElementById(\'cffp_' $id_group '_' $field_database '\').value = \'' $value '\'; document.getElementById(\'cffp_filters\').submit(); } return false;">' $value '</a>';
}

return implode(', '$filter_array) . ($max && $k >= $max ' [...]' '');
}
}

// Group "WC3 Tools" has ID = 5 (I see in your HTML code page ;) )
$id_group 5;

// Field "Tool Category" has ID (unknown for me, you can see in settings area of mod; for example = 7;
$field_name '{FIELD_7_NAME}'// Name of this field: Tool Category
$field_value '{FIELD_7_VALUE}'// Value of this field: Jass Scripting, Specific WE Module as a Standalone App, Text Editor &amp; Highlighter, World Editor (WE) Add on or plugin
$field_database '{FIELD_7_DATABASE}'// Column name of this field in database (I see in your HTML code page and is 'column_6').

// Now, you can write all "Tool Category" values with links to filter.
echo '<strong>'$field_name':</strong> 'cffp_filter($id_group$field_value$field_database);

?>


In next updates I will try add a function for do this more easy. :)

moyack

Hi!!

Long time no see!! I have a question about reassign records to another member. I want to set some resources to a member, but when I follow the interface, it doesn't' change the resource to an specific member. Can you give me a hint??

davidhs

Quote from: moyack on August 28, 2019, 08:49:04 AM
Hi!!

Long time no see!! I have a question about reassign records to another member. I want to set some resources to a member, but when I follow the interface, it doesn't' change the resource to an specific member. Can you give me a hint??
You need fill these fields:
- Attribute guest groups made with: Username of: moyack
- Attribute specific posts: POST IDs WITH RECORDS
- Attribute groups of type: SELECT TYPE OF RECORDS TO REASSIGN
- Attribute registered member groups: [X]
- Attribute groups to member: olofmoleman

This only reattribute groups of fields. If you want also attribute post with this group, you need reattribute posts.

moyack

Quote from: davidhs on August 28, 2019, 01:23:37 PM
Quote from: moyack on August 28, 2019, 08:49:04 AM
Hi!!

Long time no see!! I have a question about reassign records to another member. I want to set some resources to a member, but when I follow the interface, it doesn't' change the resource to an specific member. Can you give me a hint??
You need fill these fields:
- Attribute guest groups made with: Username of: moyack
- Attribute specific posts: POST IDs WITH RECORDS
- Attribute groups of type: SELECT TYPE OF RECORDS TO REASSIGN
- Attribute registered member groups: [X]
- Attribute groups to member: olofmoleman

This only reattribute groups of fields. If you want also attribute post with this group, you need reattribute posts.

Thanks!!

Worked perfectly. May I suggest a feature based on this? To add a button after the "Move to another post" that changes the owner of the record to the message poster.

davidhs

Quote from: moyack on September 08, 2019, 09:25:48 PM
May I suggest a feature based on this? To add a button after the "Move to another post" that changes the owner of the record to the message poster.
I will see on next update. :)

davidhs

New version:
2.0.2   2020-03-08
------------------
! SMF 2.0.x: The Quick Search of the Administration Center look for in settings variables of MOD.
+ SMF compatibility: 2.0.16 to 2.0.17.

moyack

Quote from: davidhs on March 09, 2020, 01:37:19 PM
New version:
2.0.2   2020-03-08
------------------
! SMF 2.0.x: The Quick Search of the Administration Center look for in settings variables of MOD.

Awesome!!!

I'll try to update it because I've made so many changes for my needs that it's better to make the changes by hand.

Americano

The latest version is not in Portuguese.

Americano

Quote from: davidhs on November 16, 2018, 12:33:30 PM
Quote from: Americano on August 03, 2018, 11:32:32 AM
Quote from: davidhs on August 03, 2018, 05:34:41 AM

An enhancement for next versions of this mod can be add an option for reattribute groups of fields to other user (similar to reattribute post in SMF 2.0+). This is easy, or very usefull? Really I do not know...  ??? Now you can hide creation/modification data of a group of fields and show only creation data of the post.

Please, could you do in the next version?
Done.

It was not what I wanted. I wanted it when a moderator was going to include a record in someone else's message, be a computer for the owner of the original message.

davidhs

Quote from: Americano on April 25, 2020, 10:31:24 AM
The latest version is not in Portuguese.
I see this. Same problem with all non-utf8 languages (except English). :( I will fixed now...




Quote from: Americano on April 25, 2020, 11:49:43 AM
Quote from: davidhs on November 16, 2018, 12:33:30 PM
Quote from: Americano on August 03, 2018, 11:32:32 AM
Quote from: davidhs on August 03, 2018, 05:34:41 AM

An enhancement for next versions of this mod can be add an option for reattribute groups of fields to other user (similar to reattribute post in SMF 2.0+). This is easy, or very usefull? Really I do not know...  ??? Now you can hide creation/modification data of a group of fields and show only creation data of the post.

Please, could you do in the next version?
Done.

It was not what I wanted. I wanted it when a moderator was going to include a record in someone else's message, be a computer for the owner of the original message.

I am not sure understand this. But I think you can do this with my new enhancement:
Quote from: davidhs on February 21, 2014, 01:53:17 PMReattribute User Groups (only series SMF 2.0.x)

Allows reattribute to registered member groups of fields published by a guest or another registered member.

This is located in "Administration Center > Forum Maintenance > Members > Reattribute User Groups".

Else, write here an example (with images if it is possible).

Advertisement: