Guests limitation

https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-blue.svg BBCodes 26-Mar-2019T16:03:34 phpBB Studio https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-yellow.svg https://phpbbstudio.com/ext/phpbbstudio/studio/styles/all/theme/images/studio-round-yellow.svg

Guests limitation

 
Often you do not want your content to be visible to everyone.
Add that extra bit of exclusiveness to your board and make your members feel special.
The following BBCode will allow you to create separate content for your guests and registered users.

tip

css3 This BBCode has no inline style!

 


 

pencil BBCode usage

[guest={HASHMAP=only:0,yes:0,no:1;optional;preFilter=strtolower;postFilter=#int}]{TEXT}[/guest]

 

html5 HTML replacement

<xsl:choose>
	<xsl:when test="@guest">
		<xsl:if test="$S_USER_LOGGED_IN = @guest"><xsl:apply-templates/></xsl:if>
	</xsl:when>
	<xsl:otherwise>
		<xsl:if test="$S_USER_LOGGED_IN = 0"><xsl:apply-templates/></xsl:if>
	</xsl:otherwise>
</xsl:choose>

 

question Help line

Create private content: [guest=yes|no]Text[/]

 

Explanation

HASHMAP=only:0,yes:0,no:1;optional;preFilter=strtolower;postFilter=#int
angle-double-right HASHMAP: makes it so, that the yes,no and only text is turned into its respective integer.
angle-double-right optional: makes the parameter optional, allowing just [guest] aswell, which defaults to content for guests.
angle-double-right preFilter: turns the user entered string to lowercase, so users can also use YES, OnLy, etc…
angle-double-right postFilter: double checks if the correct value is found, we can only use integers (0 and 1).
angle-double-right Options:
yes|only|1: content inside is only shown to guests (default)
no: content inside is only shown to registered users

Examples

sticky-noteNo actual content is shown here, just the BBCode usage.

[guest]This content is only visible to guests.[/guest]

 

[guest=no]This content is only visible to registered users.[/guest]

 

[guest=only]Please [url=<register_link>]register[/url] or [url=<login_link>]login[/url] to see this promotion![/guest]
[guest=no]Promotion code: #StudioBBCodes[/guest]