Help & Support

Filtering names and messages

At its simplest, the Custom filter is a list of words that you want hidden or replaced in your Cbox. Enter words, one per line, and if a user's name or message contains that word, it will be filtered out.

badword
badderword:betterword

When a message is applied to the above filter, "badword" will be turned into asterisks, and "badderword" will be replaced by "betterword". The ":" (colon) character separates the pattern text from the replacement text. If the colon is left out, the entire line is the word to match.

Filters can be useful for more interesting things too, however.

Styling and aliasing names

You can set colours for admins, mods and registered users on your Themes page, but you can create individualized filters for particular names or words you want to highlight.

jacob:[color=green]TheRealJacob[/color]

This user would still enter "jacob" as his name in your Cbox, but whenever he posts, or whenever someone mentions him in a message, the output will be TheRealJacob, in green.

If you want to apply style besides colour to names, you can use the [class] boxcode.

jacob:[class=vip]{$0}[/vip]

You will then need to define your custom CSS for this class.

Using and disabling boxcode

Boxcode itself can be customised, making the combination of filtering and formatting very powerful. See more.

Your custom filtering rules support boxcode, as seen in the example above, even if you have boxcode disabled for messages in your Settings. You can also match the boxcode that people use (or attempt to use) in their messages.

![br]:/
haiku:The moment two bubbles[br]are united, they both vanish.[br]A lotus blooms.

The first rule will match "[br]" appearing in messages, and replace it with a slash. But the [br]s that appear in the second rule will still work, creating line breaks, because each replacement string is boxcode-filtered independently.

If boxcode is enabled for messages, then you can create aliases and compound boxcode using partial (open) tags:

![red]:[color=#f00][b]
![/red]:[/b][/color]

When a user enters [red]this is red[/red], the filter translates this to [color=#f00][b]this is red[/b][/color], which is now valid boxcode, and will in turn become HTML.

Substring matching

Normal filter patterns are considered to be "words". A word is matched only if it's not surrounded by other letters. A pattern that begins with the prefix "!" (exclamation mark) will be treated as a substring, not a word: it can be matched anywhere.

plane:hockey
!color:colour

In this example, the first rule will match "plane", but not "airplane" or "planet". The second rule will match "color" as well as "colorful" and will replace them with "colour" and "colourful" respectively. Substring matching is generally important if you're creating aliases for boxcodes.

Filter order

Names and messages are filtered first by your custom filter. Messages are then parsed for smilies, boxcode, and links, in that order, if you have these features enabled. Names do not have these built-in filters applied.

Within your custom filter itself, the order of rule-matching is from top to bottom.

hi:hello
hello:goodbye

If a user posts "hi!", then as the message passes through the above rules it will be translated first to "hello!", and then, because it now matches the second rule, it becomes "goodbye!". In general, whenever a rule matches something that appears in another rule's replacement text, the order matters, and earlier rules can influence the effect of later ones. It's not recommended to depend on this behaviour, however. To create internal shortcuts, use variables.

Variables

A line beginning with a "$" (dollar sign) defines a variable that you can use in subsequent replacement text:

$pre:[big][color=#ff0000]
$suf:[/big][/color]
jane:{$pre}Jane{$suf}
john:{$pre}{$0}{$suf}

The first two lines do not match name or message text: they define variables representing the strings following the colon. Variables are written in to the replacement string by surrounding them with braces. Substitution is completed before match replacement and boxcode filtering. The variable $0 is special: it contains the text that matched.

Last updated 3 February 2017

« Support home

Loading...