eXtreme Hide BBCode |
eXtreme Hide BBCode introduction
The eXtreme Hide BBCode allows you to hide parts of a post, and specify who is allowed to see it. The content of such a hidden section can be anything: private messages, notes to yourself, links to download material, images, spoilers, answers to quiz questions, bonus material for long standing members, extra instructions for noobs / newbies, instructions for moderators, etc.
The general pattern of the code is: [xhide conditions]Hidden content [/xhide] or [xshow conditions]Hidden content[/xshow]
The xhide and xshow keywords make it easy to specify what to hide from somebody, or what to show to somebody. So the formula is the reverse, but otherwise xhide and xshow are identical. You can close both [xhide] and [xshow] opening tags with either [/xhide] or [/xshow] closing tags.
Conditions The conditions consist of one or more expressions, in combination with brackets and the logical operators AND and OR. For example: [xshow expression 1 AND expression 2]
Expressions Expressions consist of a keyword, an operation, and a value. For example: [xhide user = John] The keyword is 'user', the operation is '=', and the value to compare with is 'John'. The section will be hidden from John.
AND, OR, ( ) Multiple expressions can be combined using AND, OR, and normal round brackets. For example: [xshow user=John AND posts>=25] Show this section to John only if he has at least 25 posts. [xshow user=John OR posts>=25] Show this section to John, or to everyone who has at least 25 posts. [xshow user=John AND (posts>=25 OR replies>=1)] Show this section to John only if he has at least 25 posts, OR at least one reply in this topic. Note that without the brackets it would be: [xshow user=John AND posts>=25 OR replies>=1] Show this section to John if he has at least 25 posts, OR to anyone who has at least one reply in this topic. AND takes precedence over OR.
Note: In this manual only the opening tags are given. They are presumed to be followed by a hidden content (which may be given in some cases to clarify what is intended) and a closing tag. The closing tag can be [/xhide] or [/xshow], either one is recognised.
|
Top
|
|
Users and groups
You can hide something from users or usergroups by specifying one or more user names or group names, or a pattern that the name will be compared with:
[xhide users = John, Charles] - hide it from John and Charles [xhide users like *john*] - hide it from john, johnston, littlejohn, myjohnny etc. [xhide users >= n] - hide it from users with names >= n, (roughly the second half of the alphabet). [xhide group <> London] - show it to the London usergroup [xhide group like region*] - hide it from all region... groups
|
Top
|
|
Users and groups specification
Keywords For users and groups, the recognised keywords are user, users, group, and groups.
Operation: equal or unequal If the operation is = or <> (or != or !), that is an operation that evaluates to equal or not equal, then the value is assumed to be a list of comma-delimited complete user or group names.
Internally these names are converted to ID numbers, so that if a user, or group, changes their name, the code will continue to work correctly. If the username is numerical, it is assumed to be a user ID and no conversion takes place.
Predefined users and groups There are predefined users and groups: anonymous, guest, guests, user, users, admin, admins, mod and mods. This gives you great freedom to specify users, for example: [xshow user = John OR user = mod], or alternatively [xshow user = John, mod] will show this section to John and to all moderators.
The decision for membership to any of these predefined users or groups is based on an internal field that is the user_level. Please note that 'mods' in this context are people who can moderate 'a' subforum, but not necessarily 'this' subforum. Hiding sections from admins and mods is by default disabled in the code. Please also note that if the forum for example has a real usergroup called mods, then people who are not members of that group but do moderate a subforum, will be recognised with the mods keyword. And finally, these predefined users and groups are only checked if the operation is = or <>.
Operation: comparisons and wildcards If the operation is any comparison like larger or smaller, or the operation 'like' or 'not like', then the value is assumed to be a text string and will remain unaltered. For example: [xhide users like j*] will hide content from all users whose name starts with j. Wildcards can be % and * to specify zero, one or more characters; and _ or ? to specify 1 character. Note that the pattern must fit the complete name. For example, the above pattern will find John but not Major. To find Major, the pattern must be *j*.
Case insensitive All comparisons for user and group names are case insensitive.
Illegal characters Please note that the words 'and' and 'or' may not be part of user or group names as recogniseable words, for example between digits, spaces or interpunction. A group name like 'London and Paris' cannot be used, but a group name like 'Andover' is fine. Also, user and group names or patterns may not contain normal or angular brackets or single or double quotes or comma's.
|
Top
|
|
Posts
You can hide something from users who have less than 10 posts: [xhide post <=10] Or you can show something to noobs who have less than 10 posts: [xshow post <=10] Which is the same as hiding it from people with more than 10 posts: [xhide post > 10]
|
Top
|
|
Replies
You can hide something from users who have not yet replied in a topic: [xhide replies = 0] For example in game situations, or where the user must write an answer first, before being allowed to see the correct answer to a quizz.
|
Top
|
|
Gender
If your forum has the birthday mod installed you will have a user_gender field. You can hide content for M, male, F, female, W or V for female, N, neuter, not known, or use the numericals 1, 2, 0 respectively. Only the first character of the word will be used. [xhide gender = male] will hide content from men and show it to women and users with no known gender.
|
Top
|
|
Other fields
The eXtreme Hide BBCode mod will try to interpret other fields that you enter and may have. Let's assume you have a field called user_age with the user age in it, in years. In that case this will work: [xhide age < 25] Or maybe you have a field called user_city. In that case this will work: [xhide city like M*] Like all user table fields, the field name starts with 'user_', which is left out in the xhide formula. The forum admin can specify which (meaningful) fields are available for this purpose on his forum.
The 'level' field exists in all phpBB forums, and denotes the privilege level of the user: -1 is a guest, 0 is a registered user, 1 is an administrator, and 2 is a moderator (yes, this is correct). You can show something to guests only: [xshow level = -1] But for convenience sake there is the option to use 'guest' with the user keyword: [xshow user = guest] which works just as well and is easier to remember.
|
Top
|
|
Spoilers
Spoilers are bits of information such as how a book or film or football match ends. Information that people don't want to see by accident. Such information can be hidden underneath a message.
The full code uses the message option present in all other types: [xhide spoiler; msg=Click here to see the spoiler] but for convenience, there is a shorthand version: [xhide spoiler=Click here to read the end of the chapter] or even shorter if you want to use the default message [xhide spoiler]
The user must click the message to read the hidden section. The hidden content is present in the html code of the document, (contrary to all other hidden content), because the content is not deemed 'secret', it is just hidden as per the wish of the viewer. Both xhide and xshow codes work identically here, both will hide the content with the message.
|
Top
|
|
Default code
The default function for [xhide] and [xshow], without further parameters, is to hide the content for users with less than 10 posts, and will show a standard message to that effect. This is in line with other hide mods that have used that as their standard.
|
Top
|
|
Legacy hide BBCode
If there was an old hide bbcode mod installed, then the eXtreme Hide BBCode mod can process those codes too: [hide]Hidden content[/hide] will default to [xhide posts <= 10] And [hide=25]Hidden content[/hide] will default to [xhide posts <= 25] If people inadvertently keep using the old [hide] bbcode whilst typing, it will also be converted.
If there was an old hide mod installed, this can be de-installed. But it probably can remain functional as well. The forum admin can switch legacy mode on and off.
|
Top
|
|
Indicating hidden content
Hidden content may be marked with indicators and a message, for example "You need 12 posts to see this section".
By default, hidden content that is for specific users or groups, is completely hidden. There are no markings or messages visible if you are not allowed to see the content. Other hidden content is marked with a message if you are not allowed to see the content.
You can override the default behaviour, or the default message, by adding further code: a semi-colon, the 'msg' keyword, and 1 or 0 to force showing or hiding the default message, or a text to replace the default message (that will include forcing it to be shown, of course).
Force showing or hiding the default message Force showing the default message to all users who cannot see your private note to John: [xshow user=John; msg=1] Force hiding the default message to all users who have not enough posts [xhide posts < 10; msg = 0]
Force showing a custom message Force showing a custom message to all users who cannot see your private note to John: [xshow user = John; msg=Nana - this is only for John!]
Please note that in a multilingual environment, the default messages are in the viewer's language, not in the poster's language. Custom messages are as given.
|
Top
|
|
Indicating visible content
Hidden content that is visible, is by deafult marked with a quote-like box. The instructions for who is allowed to see it, are visible too. This is to make sure that such hidden content is not unknowingly copied from screen and pasted into a message for all to see. The forum admin can edit the html template of course if this is unwanted.
|
Top
|
|
Hidden content in quoted posts
If you quote a message with hidden content, then the hidden content that you are allowed to see, will be part of the quoted message, complete with its full xhide bbcode formula's. The hidden content that you are not allowed to see will be represented with a special code. You cannot see its content, you can only see that there is hidden content (which may be news to you if the hidden content was truly hidden in the message).
When your post is saved, the hidden content is retrieved again from the database using such codes, and inserted. That way, even within quoted messages, hidden content will continue to work as expected and be visible to the right people.
Limitations Of course, if you remove such special codes, or edit the numbers, weird things may happen. And if the source post was edited whilst you were posting your reply, the hidden code may refer to a different hidden section, or even have ceased to exist. These possibilities apply equally to normal quoted messages that are edited whilst you write your response.
|
Top
|
|
Posting your message
Checking your codes In the post preview window the message will appear as you would see it normally, so that is with the correct content hidden. Only in the post edit window can you see all your own hidden code, of course. Use the post preview window to check your bbcode. You can test if content is hidden by entering a formula that would hide the content for you. For example, posts = 0 would hide the content in the preview window if you have one or more posts already.
Errors If you make an error in the bbcode, the post preview window will show what appears to be hidden content with a special error message. Anything that is in between xhide bbcode but otherwise not understood by the program, will remain hidden to everyone.
|
Top
|
|
Admin control panel
The admin can decide which eXtreme Hide BBCode options to select for the forum. The following options can be switched on or off: Users, groups, posts, replies, legacy hide So if the admin decides that topics are bumped far too much because people use the 'replies = 10' option for example, he can switch the use of that code off.
This admin setting influences only the presentation of messages on screen, not the underlying use of the code.
|
Top
|
|
Deactivated eXtreme Hide BBCodes
If one of the eXtreme Hide BBCode options is switched off, for example the 'replies' option is disabled by the forum admin because it caused too much topic bumping, then the message that would signify the presence of a section, will be suppressed.
This will leave the section visible as usual to the right people, but for everyone else nothing will be visible at all and you cannot force messages to show any longer for that option either. This will effectively remove messages like "You need 10 posts to see this" or "You need to reply to see this" or "Only John can see this bit". This would prevent needless topic bumping, empty replies etc.
|
Top
|
|
Guests
Guests are treated as a user, in the sense that they have a name (Anonymous), a default group (guests), a user ID (-1), a post count (0) and a reply count (0) and are not part of any other user group. You can target guests with this information.
The default message for guests is a reminder to log in or register, instead of the message that hides the content. Custom messages however are shown to guests as given.
|
Top
|
|
Copyright and contact
The eXtreme Hide BBCode mod was developed and is (C) Copyright by Merlin's Software at www.pimpmyforum.nl It is a commercial product, not free, you are not allowed to distribute it, sell it, or give it to other people.
|
Top
|
|
All times are GMT + 1 hour
|
|
|