Plus enkele add-ons van Stoker, maar gewijzigd naar 3.2+ door Martin
Code: Selecteer alles
{% IF S_USER_LOGGED_IN %} Als een gebruiker is ingelogd
{% if S_USER_LOGGED_IN %}your content here (for users logged in){% ELSE %}your content here (for viewing as a guest){% endif %}
{% if S_REGISTERED_USER %} If user is logged in and not a bot
{% if S_AUTOLOGIN_ENABLED %} If auto login is allowed
{% if S_BOARD_DISABLED %} If board is disabled
{% if S_IS_BOT %} If a bot
{% if S_USER_PM_POPUP %} If pop up pm is on
{% if S_DISPLAY_SEARCH %} If displays search
{% if S_DISPLAY_PM %} If display a PM
{% if S_DISPLAY_MEMBERLIST %} If display memberlist.php
{% if U_MCP %} If Moderator
{% if U_ACP %} If Administrator
{% if S_IS_LINK %} If its a link
{% if S_UNREAD_FORUM %} If forum is unread
{% if S_READ_FORUM %} If forum is read
{% if S_LOCKED_FORUM %} If forum is locked
{% if S_LIST_SUBFORUMS %} If there is a list of subforums
{% if S_SUBFORUMS %} If a subforum
{% if S_IS_CAT %} If a category
{% if S_IS_POST %} If a post
{% if FORUM_ID %} Displays the code between the switches if the user is viewing a particular forum.
{% if SCRIPT_NAME == "index" %}some content{% endif %} (Others you can use, viewtopic,viewforum,memberlst,faq etc)
{% if S_USERNAME eq "dmzx" %}Some content here{% endif %}
Stel dat u wilt dat iets in een HTML-bestand alleen voor geregistreerde gebruikers wordt weergegeven, dan kunt u het volgende gebruiken
Code: Selecteer alles
{% if S_REGISTERED_USER %}Hello, welcome to blahblah.com{% endif %}
of:
Code: Selecteer alles
{% if FORUM_ID eq 2 %}Welcome to Forum Number 2{% endif %}
Je kunt de if's ook combineren
Code: Selecteer alles
{% if FORUM_ID eq 2 and S_REGISTERED_USER %}Welcome to Forum ID #2 and you are a registered user{% endif %}
or ( || )
and ( && )
eq ( == )
Je kunt de taal strings (or, and, eq) of de andere gebruiken ( ||, &&, ==).
Onthoud dat elke keer dat u een {% if iets %} instructie heeft, u ook een eindigende {% endif %} statement moet hebben, anders krijgt u fouten wanneer de sjabloonengine zijn werk doet.