Link to Mod
Custom fields and filters of postABOUT...
Custom fields and filters of post, 1.0
© 2014 by davidhs
This work is licensed under a Creative Commons Attribution 3.0 Unported License
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:
- 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.
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.
- Search in fields of posts, getting a list of posts.
- Search in fields of records, getting a list of records.
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.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 property "Filter the message index" of a field is selected and the user has permission to view the 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.
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.Search in fields
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.
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.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. Other are defined to be displayed in the list of records result of the search.
- 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".
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.
This image shows the file card that we created. We also see that there are two user comments 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 records of type Forum", where the fields on which you can filter the list of file cards of forums are displayed.SMF COMPATIBILITYLANGUAGES
- english, english_british.
- spanish, spanish_es, spanish_latin.
If you want help translating it into other languages, you can add the translation in this topic.DOWNLOADLink to MODMANUAL INSTALLATION
See http://wiki.simplemachines.org/smf/Manual_installation_of_modsSUPPORT 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.0CHANGE LOG
Legend: ! Fixed + Added - Removed * Changed @ Note
@ 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 of WAP.
+ Administration panel.
+ SMF compatibility: 2.0 to 2.0.7.
+ Languages: english, english-utf8, spanish_es, spanish_es-utf8, spanish_latin, spanish_latin-utf8.