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.

Tip: If a rule isn't matching when it should, try putting ! at the start of the line. If a rule is matching when it shouldn't, try putting ~ at the start of the line.

Filter modes

By default, filter rules are matched anywhere that the search text is not surrounded by other letters. Starting a line with the prefix "!" (exclamation mark) makes the rule a simple substring filter instead. Such rules are stronger in the sense that they will match in more contexts. However, unintended substitution is also more likely.

By contrast, a rule that begins with "~" (tilde) is only matched when preceded by space and followed by space or punctuation. This is similar to how emoticon substitution works. Such rules are looser in the sense that they are only matched in this specific form. Unintended substitution is less likely, but the rule may not be triggered as easily as desired.

fred:Fred
!color:colour
~plane:✈

In this example, the first rule will match the "fred" in "@fred" and "(fred)", but not in "freddy" or "alfred". The second rule will match "color" as well as "colorful" (substituting "colour" and "colourful" respectively). The third rule matches only "plane" by itself or followed by punctuation.

Filter order

Names and messages are filtered first by your custom rules. 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 any 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. Variables in replacement text are expanded before filtering itself is applied to messages. The variable $0 is special: it contains the text that matched.

Last updated 7 August 2018

« Support home

Loading...