08-15-2010, 06:08 PM
Updated to v1.30:
Some examples of the $filters_set variable:
- move template modification code from _install function to _activate - this allows an admin to re-perform the template edits after they install a new theme, by deactivating and re-activating the plugin (rather than forcing an uninstall, or requiring manual template edits)
- workaround for an editpost bug in earlier MyBB 1.4.x versions
- fix bug with handling array of filters (thanks to RateU)
- fix bug with multiple values and textbox/textarea inputs; it didn't work before, now it will assume that commas (textboxes) or newlines (textareas) are delimeters (regardless of what the display delimiter is) - it's probably not the nicest solution, which might be changed in a later version. Note, I'm assuming no-one has relied on this feature (haven't seen it being used anywhere) so I'm not going to bother trying to fix it in the upgrader.
- add ability to use text mask filter (for custom thread fields) to capture patterns, similar to how custom MyCodes operate; surround the capture pattern with brackets, and use {VALUE$1}, {VALUE$2} etc in display (item) format or unviewable value
- add $filters_set variable for forumdisplay, for displaying which thread filters have been set. It is an array, and you specify something like {$filters_set['my_thread_field']['value']} in templates to display the value of the filter "my_thread_field". "value" can be replaced with a number of different things:
- urlarg: URL parameter, eg 'filtertf_my_thread_field=label_a'
- urlarga: URL parameter with preceeding ampersand, eg '&filtertf_my_thread_field=label_a'
- urlargq: URL parameter with preceeding question mark, eg '?filtertf_my_thread_field=label_a'
- forminput: hidden form input parameter, eg '<input type="hidden" name="filtertf_my_thread_field" value="label_a" />'
- selected: for selecting in listboxes - is set to ' selected="selected"' for selected value (eg {$filters_set['my_thread_field']['selected']['labela']} is set if the filter is "labela")
- checked: for selecting in checkboxes - as above, but set to ' checked="checked"'
- hiddencss: puts hidden CSS if set - is set to 'display: none;' if filter is set, or '' otherwise
- visiblecss: opposite of the above - set to 'display: none;' if filter is NOT set, or '' otherwise
- {$filters_set['__all'][...]} can be used to grab URL/form parameters for all filtered thread fields (does not include inline search)
- {$filters_set['__search'][...]} can be used for inline search filtering; the "..." can be replaced with any of the above values
Some examples of the $filters_set variable:
HTML Code
|
HTML Code
|