XThreads Documentation - Undocumented Features

This page will describe a number of things not documented in the interface, due to lack of space or otherwise.

Thread Filtering

XThreads offers a {$filters_set} array variable on the forumdisplay page when thread filters are used. This section describes this array.

The general format to use in templates is something like this: {$filters_set['key']['var']}. key refers to the filter; for example, if you've enabled filtering on a thread field having a key of "myfield", the corresponding key is myfield. As for var, the following are available:

There are also some special values for key, these are:

Display Format Fields

The Display Format, Display Item Format, Blank Replacement Value, Unviewable Value and replacement values for Formatting Map List have fairly complex display formatting abilities - this section will try to explain how it works.

Special Tokens

Conditionals

XThreads supports conditionals in many fields, which are in the same syntax as the Template Conditionals plugin. There are a few differences/notes with the plugin however:

PHP support is also available, but only if the PHP in Templates plugin is installed and activated (and/or appropriate setting set in cache/xthreads.php); accepts PHP within <?php ... ?> tags, similar to how the plugin works.

Parse Process

  1. If the value is blank, the Blank Replacement Value will be displayed
  2. If the user is in a group which cannot view the value, the process will continue, however Unviewable Value will be used in place of Display Format
  3. At this point, file thread fields will go off and do its own thing and pass finally through Display Format; other thread fields continue
  4. If the value matches one defined in the Formatting Value List, the defined replacement will be used here and the following step will be skipped
  5. The value will be sanitised according to the Display Parsing option chosen, at this point (eg, MyCode parsed)
  6. If a capturing Text Mask Filter is used, components are captured (from the raw input, not the output of above step) and sent through the sanitiser (as above)
  7. If multiple values are supported, the above goes into Display Item Format, and the above two steps are repeated for each value. Once done, all these values are aggregated together, separated by the Multiple Value Delimiter
  8. Finally, the value goes into the Display Format, for display

Image Filtering Chains

XThreads allows you to define image filtering/processing chains, which specify how thumbnails are created. What's described below is applicable only to file type thread fields, which only accept images.

Each filter is like a function and thus must have brackets after the name even if no parameters are passed. Separate filters using -> - example resize(100,100)->brightness(50)->grayscale() PHP expressions are supported in arguments (subject to the same limitations as conditionals)

Image Filters

Image Variables

Notes

Examples

Additional Custom Thread Field Variables

In addition to the {$GLOBALS['threadfields']['key']} variable (which displays the value of the thread field), there are other values which can be displayed via the additional variable, {$GLOBALS['threadfields_x']['key']['valuename']} variable, where valuename can be one of the following:

Additional Template Variables

XThreads adds some variables which can be used in templates for convenience.

Other

XThreads Additions

Just a list of the stuff XThreads adds:

AdminCP UI Additions

Modified Templates

Added Templates

Although not an added template, you can create postbit_first* templates to override the various postbit* templates for the first post of a thread.