Advertisement:

Navigation

SMF Mod Site

Mod Name:
Custom fields and filters of post
Created By:
davidhs
Type:
New Feature
First Created:
December 17, 2013, 06:19:52 PM
Last Modified:
November 11, 2015, 03:23:45 PM
Latest Version:
1.4
Compatible With:
1.1.20, 1.1.21, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11
Total Downloads:
990

Download this mod

CustomFieldFilterPost_1.0.tar.gz (101kB) [332]
CustomFieldFilterPost_1.1.tar.gz (179kB) [185]
CustomFieldFilterPost_1.2.tar.gz (303kB) [175]
CustomFieldFilterPost_1.3.tar.gz (388kB) [46]
CustomFieldFilterPost_1.3.1.tar.gz (387kB) [31]
CustomFieldFilterPost_1.3.2.tar.gz (387kB) [98]
CustomFieldFilterPost_1.4.tar.gz (442kB) [109]
Manual Install Instructions for SMF

Description:

Custom fields and filters of post

ABOUT...

Custom fields and filters of post, 1.4
© 2014-2015 by davidhs
© German and German informal language 2015 by sangham.net
© Portuguese for Brazil and Portugal language 2015 by Americano


This work is licensed under a Creative Commons Attribution 3.0 Unported License.

DESCRIPTION

Allows to add different groups of custom fields to forum posts and filters for fields of posts.

A group of fields can be of type:
  • Fields loose: Its fields are added to a post to provide extra information. In seeking data into fields loose of a post is gets a list of posts.
  • Record: It is a set of fields that represents an independent entity of the post. In seeking data into fields of a record is gets a list of records. The post body can not be left empty but a post with record does not need body. If the user will add a record and the post body is empty, the system writes a period (".") on it and the user does not need to write anything.
  • Fields with several values per member: It is set of fields where several members can insert different values. This can be used for members to make comments or valuations about the post. If these fields are located in just the first post of a topic can be displayed as belonging to the topic.
  • Filters: This is a special type of group without fields. Used to enable a set of predefined filters that can be used on topics and posts.

The available predefined filters are:
  • Boards.
  • Subject.
  • Start of the subject.
  • First character of the subject.
  • Date of topic / Date posted.
  • Date of last reply / Date posted.
  • Posted by.
  • Topic with new posts / New.
  • Sticky.
  • Locked.
  • Replies.
  • Poll.

The actions to be performed on a group of custom fields are: view, add, modify, delete and move.

Furthermore other actions are possible using custom fields:
  • Filter the message index.
  • Sort the message index.
  • Show statistics.
  • Search in fields of posts, getting a list of posts.
  • Search in fields of records, getting a list of records.

Administration panel

The administration panel has the list of groups of custom fields, which allows to add new groups, modify or delete existing groups, add, modify or delete fields in a group and define templates to display those fields in a post and in message index.

     

     

Viewing posts with custom fields

When viewing a complete post (on a topic, in recent posts or profile) are displayed its groups (which are enabled when post is create or modify). Groups of type "loose fields" and "record" are shown above the post body, whereas groups of type "fields with several values per member" are shown below, unless was selected "Show as group of fields of the topic" and then is displayed at the beginning and/or end of the topic. If a group has template for posts the fields are displayed according to the template, if has not are displayed with its name and content.

In lists of posts (message index, unread post and replies) are displayed groups with fields visible in message index (according to permissions). If a group has template for message index the fields are displayed according to the template, if has not are displayed with its name and content.

Modifying values on custom fields

In a topic, posts with groups of type "fields with several values per member" have buttons for the user to post new values, and modify or remove existing ones.

For all other groups ("fields loose" and "record"), at create or modify the post are displayed allowed groups. The groups of type "loose fields" always have their fields visible, whereas the groups of type "record" have a checkbox to show or hide their fields. If has been created template for quick input in a record, Quick input field is displayed after the record fields.

Moving a group of custom fields to another post

A group of fields may have to be allocated to another post, for example before removing the post where is the group.

If user has allowed to move a group, when viewing a topic that group will have buttons to move to the first post from the topic or another post (or another topic if the group is of type "fields with several values per member" and have selected "Show as group of fields of the topic").

Filter the message index

If the user has permission to filter by a field, a button is displayed in the message index to filter topics by that field.

Type of filter button depends on the type of field:
  • The filter for text or large text fields is a text button in which enter the search string, or a select box to get data with that field empty or non-empty.
  • Fields of type select box, combo box, radio buttons or checkboxes have by filter a text button, a select box or a combo box in which enter or select the search string, or a select box to get data with that field empty or non-empty.
  • For fields of type boolean the filter is a select box with values "Yes" and "No".

If the user can modify a field, that field may be empty and its filter is a select box or combo box, he will see an option in the list to get data with that field empty.

The filter with text button allows to search loose words (separated by spaces) and/or literal phases (enclosed in double quotes).

If the filter is of type text or combo box, by default it is sought that the text is contained in the field value, whereas if the filter is of type select box list is sought that the text matches the value of the field.

Also, with a group of type "filters" can be added predefined filters.

The filters can be of the same group or different groups of fields.

Next to filters there is a button to activate the filters that have been given some value. As a result is obtained the messages index with topics whose first post matches all active filters.

Sort the message index

If the user has permission to sort by one or more fields, a select box is displayed in the message index to sort topics by one of those fields.

Show statistics

If a group of type "fields with several values per member" has a only one field and is of type select box, radio buttons or checkboxes (that is, there is a finite number of values), can be generate statistical data from the values entered in the field.

The statistical data to be displayed include:
  • Chart with average: It consists of a horizontal bar where the average value, the lowest allowed value and the highest allowed value are located.
  • Chart with horizontal bars: Represents the use of each allowed value through horizontal bars.
  • Chart with vertical bars: Represents the use of each allowed value through vertical bar.
  • Summary: A set of data obtained from the input values (average, highest and lowest allowed value, highest and lowest used value, most and least frequent value).

The user sees these data only if it has permission. The message index can be sort by the summary data, if it has permission to sort by the field.

Using templates can be inserted the statistical data of any group of fields elsewhere.

Search in fields

In series SMF 2.0.x, under the option "Search" from the menu forum the search pages are located, showing the groups and their fields on which user have search permission. In series SMF 1.1.x, the option "Search posts and records" from the menu forum provides access to the search pages, showing the groups and their fields on which user have search permission.

Groups of type "loose fields", "fields with several values per member" and "filters" can be in several search pages, and each page contain several groups, with the only condition that the groups on a page must be permitted on a common set of posts. As a search result a list of posts is obtained.

For each group of type "register" with search permission have one page. As a result a list of records is obtained with the columns indicated at defining the fields.

In both cases the buttons used in each search field follow the same rule as in the filters.

Counter on the information about the member

The number of each type of record created by the member can be displayed in the information about that member.

This can be seen in several areas, such as the member's profile and the member's information about the poster of each message.

"Administration Center > Forum Maintenance > General Maintenance > Recount all forum totals and statistics" (series SMF 1.1.x) or "Administration Center > Forum Maintenance > Routine > Recount all forum totals and statistics" (series SMF 2.0.x) also recounts the number of each type of record created by members.

Also, the total number of each type of record created can be show on the statistics.

Top posters on statistics

In Statistics Center can be show the top 10 posters of each type of records.

List on member's profile (only series SMF 2.0.x)

In the member's profile, under the section "Profile Info > Show Posts", can be show a list for each group of type "record", with posted messages by the member containing this type of group.

List on Moderation Center (only series SMF 2.0.x)

In the Moderation Center is possible to control the content posted by users in the groups of type "fields with several values per member".

For each group which has chosen to show this list will be displayed an access to the list under the section "Posts > Groups of fields on posts" and, optionally, a link under the option "Moderate" from the menu forum.

List of moderation (only series SMF 1.1.x)

Global moderators can to control the content posted by users in the groups of type "fields with several values per member".

The option "Moderate the groups of fields on posts" from the menu forum provides access to list with posted data, one for each group which has chosen to show this list.

EXAMPLE

Suppose we have a forum where different programs that exist to create a forum are discussed and we want to have a set of file cards with the features of each program. You can write the file cards of each forum in messages or using this MOD to create the file cards.

First we create a board where you write messages that will contain file cards of forums (we call it "Records of forums").

Next we create several types of groups of custom fields in the administration panel of the MOD:
  • Forum: Group of type "record" to save features of forum (name, abbreviation, developer(s), version,...). We give search permission on the group so that create a search page of forums. Some properties of the group can be defined to create filters on the message index and search page, and to sort the message index. Other are defined to be displayed in the list of records result of the search. We select this group to show a counter on the information about the member and on the statistics, a list on member's profile and the top 10 posters on the statistics.
         
  • CMS: Group of type "fields loose" with a single field to indicate if a message contains data from an independent forum or belonging to a content management system (CMS). We give search permission to the group to be created a search page of posts and define its field to create filters on the message index and search page.
  • Filters: Group of type "filters" to use predefined filters in message index and search page. To display we give permission to the group.
  • Comments: Group of type "fields with several values per member" that will allow users to give their reviews about each forum, without creating any reply in the topics that contain the file cards of each forum. The group will be displayed at the end of all pages of the topic and will have two fields: "I like it!" and "Comment". We select fields and group to show a list on Moderation Center.
  • Statistics: Group of type "fields with several values per member" that will allow users to indicate if they like or not they like each forum, without creating any reply in the topics that contain the file cards of each forum, and generates statistical data. The group will be displayed at the end of all pages of the topic and will have only one field with de question.

For easier data entry we add:
  • This JavaScript code in the group CMS to write the message subject:
Code: [Select]
document.getElementById("cffp_2_column_1").onchange = function (event)
{
subject_forum();
}
document.getElementById("cffp_1_column_1").onchange = function (event)
{
subject_forum();
}
document.getElementById("cffp_1_column_2").onchange = function (event)
{
subject_forum();
}
function subject_forum()
{
document.getElementsByName("subject")[0].value = document.getElementById("cffp_2_column_1").checked ? "CMS" : "";
if ("" != document.getElementById("cffp_1_column_1").value)
{
if ("" != document.getElementsByName("subject")[0].value)
document.getElementsByName("subject")[0].value += ". ";
document.getElementsByName("subject")[0].value += document.getElementById("cffp_1_column_1").value;

if ("" != document.getElementById("cffp_1_column_2").value)
document.getElementsByName("subject")[0].value += " (" + document.getElementById("cffp_1_column_2").value + ")";
}
}
  • This template for quick input in the group Forum to fill the fields more rapidly:
Quote
Regular expression:
Code: [Select]
/^\s*Name\s+(.+)\s+(Abbreviation\s+(.+)\s+)?Developer\s+(.+)\s+Current version\s+(.+)\s+Written in\s+(.+)\s+Website\s+(.+)\s*/Parameters:
Code: [Select]
1
0
2
3
4
5
6
subject_forum();
Help:
Code: [Select]
Copy the text here. Must have this format (number and type of spaces between elements does not matter):
[code]Name [NAME]
Abbreviation [ABBREVIATION] // Optional
Developer [DEVELOPER]
Current version [CURRENT_VERSION]
Written in [WRITTEN_IN]
Website [WEBSITE][/ code]

The structure is already done. We now create file cards of forums. Go to the board "Records of forums" and create a new topic. If we are to write about a content management system we enable the "CMS" field. To create the file card of a forum we enable the checkbox "Forum" and fill fields of file card with these data:
Quote
Forums

Name   Simple Machines Forum
Abbreviation   SMF
Developer   The SMF Team
Current version   2.0.7 (January 20, 2014)
Written in   PHP
Website   http://www.simplemachines.org/

Name   PHP Bulletin Board
Abbreviation   phpBB
Developer   phpBB Limited
Current version   3.0.12 (September 28, 2013)
Written in   PHP
Website   http://www.phpbb.com/

Name   vBulletin
Abbreviation   vB
Developer   Internet Brands, vBulletin Solutions
Current version   5.1.0 (March 19, 2014)
Written in   PHP
Website   http://www.vbulletin.com/

Name   Invision power board
Abbreviation   IPB, IP.Board or IP Board
Developer   Invision Power Services
Current version   3.4.6 (October 29, 2013)
Written in   PHP
Website   http://www.invisionpower.com/

Name   MyBulletinBoard
Abbreviation   MyBB
Developer   MyBB Group
Current version   1.6.14 (June 30, 2014)
Written in   PHP
Website   http://www.mybb.com/

Name   Yet another Bulletin Board
Abbreviation   YaBB
Developer   YaBB Development Team
Current version   2.5.2 (October 21, 2012)
Written in   Perl
Website   http://www.yabbforum.com/

Name   Ikonboard
Developer   Ikonboard
Current version   3.1.5a (November, 2011)
Written in   PHP, Perl
Website   http://www.ikonboard.net/

Name   JavaBB
Developer   Dalton Camargo
Current version   0.99 (May 31, 2008)
Written in   Java
Website   http://www.javabb.org/



CMS

Name   Joomla!
Developer   The Joomla Project Team
Current version   2.0.20 (April 30, 2014)
Written in   PHP
Website   http://www.joomla.org/

Name   Drupal
Developer   Dries Buytaert
Current version   7.28 (May 8, 2014)
Written in   PHP
Website   https://www.drupal.org/

Name   WordPress
Developer   WordPress Foundation
Current version   3.9.1 (May 8, 2014)
Written in   PHP
Website   https://wordpress.org/


This image shows the file card that we created. We also see that there are two user comments and statistical data about this forum.

Once you have created all the file cards in the index of board "Records of forums" you see some fields next to the post subject and filters above the listing.

To search posts go to "Search > Search posts", where groups and fields with permission to search are displayed.

To search file cards of forums go to menu "Search > Search forums", where the fields on which you can filter the list of file cards of forums are displayed.

In the member's profile can be shown the groups type "Forum" posted by the user.

In the Moderation Center can be controlled the comments posted by users.

In Statistics Center can be shown the top 10 posters of records type "Forum".

SMF COMPATIBILITY

  • SMF 1.1 to 1.1.21.
  • SMF 2.0 to 2.0.11.

Support for:
  • Print topic.
  • WAP.

LANGUAGES

  • english, english_british.
  • german, german_informal (incomplete).
  • portuguese_brazilian, brazilian (SMF 1.1.x), portuguese_pt (incomplete).
  • spanish (SMF 1.1.x), spanish_es, spanish_latin.

If you want help translating it into other languages, you can add the translation in http://www.simplemachines.org/community/index.php?topic=518886.0

DOWNLOAD

Link to MOD

MANUAL INSTALLATION

See http://wiki.simplemachines.org/smf/Manual_installation_of_mods

SUPPORT AND COMMENTS

In English: http://www.simplemachines.org/community/index.php?topic=518886.0
In Spanish: http://www.simplemachines.org/community/index.php?topic=515911.0

CHANGE LOG

Code: [Select]
Legend:   ! Fixed   + Added   - Removed   * Changed   @ Note

1.4     2015-10-30
------------------
+ Field in administration panel to show, on the statistics, the top 10 posters of each type of records.
+ The total number of each type of record created can be show on the statistics.
+ SMF compatibility: 2.0.11.
+ Languages: New language string in portuguese_brazilian, portuguese_brazilian-utf8, brazilian, brazilian-utf8, portuguese_pt, portuguese_pt-utf8, thanks to Americano.
+ Languages: german, german-utf8, german_informal, german_informal-utf8, thanks to sangham.net.
- SMF 2.0.x: Languages: brazilian, brazilian-utf8, spanish, spanish-utf8 (these are not used).

1.3.2   2015-06-19
------------------
! Errors in source code.

1.3.1   2015-06-13
------------------
! SMF 2.0.x: Error in SQL code.
! Use HTML entities in ISO-8859-1 languages.
! Since version 1.2 the help text is too long and generates an error on uninstallation. It is divided in two operations.

1.3     2015-06-07
------------------
! Error in PHP code.
! Navigation in the message index when a predefined filter is used.
! Delete statistics when topics or messages are deleted.
! When moving a group of type "fields loose" or "record" to another message, the poster of the message is assigned to group.
! SMF 2.0.x: When assigning a message to another member, the groups of type "fields loose" or "record" of that message are assigned to member.
+ Field in administration panel to show, on the information about the member, the number of each type of record created by the member.
+ "Administration Center > Forum Maintenance > Routine > Recount all forum totals and statistics" also recounts the number of each type of record created by members.
+ SMF compatibility: 1.1.21 and 2.0.10.
+ Languages: portuguese_brazilian, portuguese_brazilian-utf8, brazilian, brazilian-utf8, portuguese_pt, portuguese_pt-utf8, thanks to Americano.

1.2     2014-12-16
------------------
! Error in JavaScript code.
! Errors in PHP code.
! SMF 2.0.x: allowedTo('approve_posts') must be used instead of $context['can_approve_posts'].
! Entered values by the user in text box of a combo box with multiple selection can not be duplicated.
! Column width with only one field, in lists of moderation.
! Fields of type select box, radio buttons or checkboxes must have options.
! Empty option of select box must have the label "All" only in filters.
+ SMF 1.1.x: Implemented a generic form of displaying lists, similar to SMF 2.0.x.
+ SMF 1.1.x: Implemented database functions, similar to SMF 2.0.x.
+ Field in administration panel to indicate if quick input field will be show when data are modified.
+ Field in administration panel to add a long description in a custom field.
+ Field in administration panel to add a description in a search field.
+ Field in administration panel to add a long description in a search field.
+ Field in administration panel to indicate if creation date will be show on posted records.
+ Field in administration panel to indicate if last modification date will be show on modified records.
+ Field in administration panel to indicate if only one value per member in groups of type "fields with several values per member" is allowed.
+ Field in administration panel to indicate if is allowed selecting the operator with which apply the filter.
+ Field in administration panel to indicate if one or more filters are hidden under a tag.
+ Field in administration panel to show in filter only those items that used in the current board, if filter is a field with list of items.
+ Fields in administration panel to show statistics in groups of type "fields with several values per member".
+ Permission in administration panel to indicate if a field is used to sort the message index.
+ PHP function in "Show enclosed within text" to display statistics for the group of a message.
+ PHP function in templates to display statistics for the group of a message.
* Reorganization of the fields in the administration panel.
* The filter with text button allows to search loose words (separated by spaces) and/or literal phases (enclosed in double quotes).
* The dates of create/modify of a group (left) and actions on a group (right) are shown on the same line.
* The date of create of groups of type "fields with several values per member" are also displayed on WAP.
* When display data posted by users in the groups of type "fields with several values per member", the background color alternates for readability.
* Forum parameter "Number of posts per page in a topic page" is used in lists of moderation.
* Forum parameter "Number of search results per page" is used in lists of search in custom fields.
* If users can not search for posts and topics then they can not search in custom fields.
* The areas with data of groups of type "fields with several values per member" can be displayed unexpanded, expanded or forever expanded.
* The field "Filter the message index" in administration panel is replaced by permissions.
+ SMF compatibility: 1.1 to 1.1.20 and 2.0.9.
@ SMF 1.1.x: List for each group of type "record" are not show on member's profile.
@ SMF 1.1.x: There is not Moderation Center, but the global moderators can to control the content posted by users in the groups of type "fields with several values per member".

1.1     2014-07-17
------------------
! In WYSIWYG mode, if the user add a record and the post body is empty, the system did not write a period (".") on it.
! If a field with radio buttons or checkboxes is defined as "Not empty value" and is left blank, no error was displayed.
! Each posted data on groups of type "fields with several values per member" must be moved individually, not all from the message at once.
! Languages: english, english-utf8.
+ Support for print topic.
+ Field in administration panel to add BBC before the record when entering data.
+ Field in administration panel to add JavaScript code when a group of fields is created or modified.
+ Field in administration panel to add HTML before and after the input button and the output text in a custom field.
+ Field in administration panel to show expanded the most recent posted data in groups of type "fields with several values per member".
+ Field in administration panel to show most recent posted data at the top in groups of type "fields with several values per member".
+ Field in administration panel to indicate the maximum height of the area with posted data in groups of type "fields with several values per member".
+ Field in administration panel to show, in the member's profile, a list for each group of type "record", with posted messages by the member containing this type of group.
+ Field in administration panel to control, in the Moderation Center, the content posted by users in the groups of type "fields with several values per member".
* Field in administration panel to indicate if a group will be show on the first post of topic is selected by default.
* Field in administration panel to indicate if a group will be show on the replies of topic is selected by default.
+ Quick input field to fill the fields when a record is created.
+ Variable in "Show enclosed within text" to insert ID of the current message.
+ Variable in "Show enclosed within text" to insert field name in database of any custom field.
+ PHP function in "Show enclosed within text" to display a group of a message like in a message or like on the message index.
+ Variable in templates to insert ID of the current message.
+ Variable in templates to insert field name in database of any custom field.
+ PHP function in templates to display a group of a message like in a message or like on the message index.
+ In administration panel is shown each group and field ID.
+ Text field to add multiple options at one time when a custom field with options is created or modified in administration panel.
* Big multi-line text input fields are wider.
* Submit buttons have shortcut key to get focus.
+ SMF compatibility: 2.0.8.

1.0     2014-02-20
------------------
@ This work is licensed under a Creative Commons Attribution 3.0 Unported License http://creativecommons.org/licenses/by/3.0/
+ Groups of custom fields loose in forum posts, to provide extra information.
+ Groups of custom fields in forum posts, called records, that represents an independent entity of the post.
+ Groups of custom fields in forum posts, with several values per member. They may be seen as belonging to the post or to the topic.
+ Groups of predefined filters that can be used on topics and posts.
+ Predefined filters: Boards, Subject, Start of the subject, First character of the subject, Date of topic / Date posted, Date of last reply / Date posted, Posted by, Topic with new posts / New, Sticky, Locked, Replies, Poll.
+ Actions to be performed on a group of custom fields: view, add, modify, delete, move.
+ Filter the message index using custom fields.
+ Search in custom fields of posts, getting a list of posts.
+ Search in custom fields of records, getting a list of records.
+ Support for WAP.
+ Administration panel.
+ SMF compatibility: 2.0 to 2.0.7.
+ Languages: english, english-utf8, english_british, english_british-utf8, spanish, spanish-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8.