Note: The first part of this post has been copied and pasted around many different forums over the years. As such, I have been unable to find the original author for credit.
<!-- IF S_USER_LOGGED_IN -->
If a user is logged in this will display.<!-- IF S_REGISTERED_USER -->
If user is logged in and not a bot this will display.<!-- IF S_IS_BOT -->
If a bot this will display.<!-- IF S_DISPLAY_SEARCH -->
If displays search this will display.<!-- IF S_DISPLAY_PM -->
If display a PM this will display.<!-- IF U_MCP -->
If Moderator this will display.<!-- IF U_ACP -->
If Administrator this will display.<!-- IF FORUM_ID -->
Displays the code between if particular forum. AND, this will display.<!-- IF SCRIPT_NAME == "viewtopic" -->
Some content. AND, this will display.<!-- IF S_USERNAME eq "TheGeneral" -->
You get the picture yet? .. but in this case, only for me!!<!-- IF FORUM_ID eq 2 -->
Welcome to Forum Number 2, this only displays in Forum Number 2. DUH!<!-- IF FORUM_ID eq 2 and S_REGISTERED_USER -->
Welcome to Forum ID #2. Yes, you are a registered user.Also, you can use the following operands
or
/ ||
and
/ &&
eq
/ ==
You can use either the language ones (
or
, and
, eq
) or the other ones (||
, &&
, ==
).php Operators list
OMG, What 'else' is there:
<!-- IF SCRIPT_NAME == "viewtopic" -->
This will show... <!-- ELSE -->
Otherwise, this will show if not viewing a topic.Technical Example:
Code: Select all
<title><!-- IF UNREAD_NOTIFICATIONS_COUNT -->({UNREAD_NOTIFICATIONS_COUNT}) <!-- ENDIF --><!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF --><!-- IF SCRIPT_NAME eq 'index' -->{SITENAME} • {SITE_DESCRIPTION}<!-- ELSE -->{PAGE_TITLE} <!-- IF SCRIPT_NAME == "viewtopic" -->| {FORUM_NAME} <!-- ENDIF -->| {SITENAME}<!-- ENDIF --></title>
Disable in specific style:
Code: Select all
{% if user.style.style_name|lower != 'mystyle' %}
this is not displayed in MyStyle
{% endif %}