What are IF statements?
IF statements are used as HTML comments to make something happen if something has met the condition.
Why use IF statements?
Like in Twisty's guide at the start it uses an IF statement, which checks to see if the visitor is a guest and the register feature is not disabled.
How do you use IF statements?
To use IF statements, insert them like a HTML Comment, like this:
Structure of an IF statements?
First you will have the
followed by the IF and condition then
IF statements loops?
To make a loop with IF statements you may use
to end the an IF statement you must always use
Example Scenario: Hello, I am running phpBB3 and want to show my guests 'Please Register or Login', my normal users 'Welcome to my Site, Thank You for Signing Up', and staff 'Welcome Staff'.
Example Answer:
Additional Variables for IF statements?
There are additional variables like
or
or
which can make your IF statement simpler.
Conditions List (From StarTrekGuide):
S_USER_LOGGED_IN
S_AUTOLOGIN_ENABLED
S_BOARD_DISABLED
S_IS_BOT
S_USER_PM_POPUP
S_DISPLAY_SEARCH
S_DISPLAY_PM
S_DISPLAY_MEMBERLIST
U_MCP
U_ACP
S_IS_LINK
S_UNREAD_FORUM
S_READ_FORUM
S_LOCKED_FORUM
S_LIST_SUBFORUMS
S_SUBFORUMS
S_IS_CAT
S_IS_POST
If you required any assistance, do NOT hesitate to add me on MSN or PM here. :yes:
IF statements are used as HTML comments to make something happen if something has met the condition.
Why use IF statements?
Like in Twisty's guide at the start it uses an IF statement, which checks to see if the visitor is a guest and the register feature is not disabled.
How do you use IF statements?
To use IF statements, insert them like a HTML Comment, like this:
Code:
<!-- IF S_USER_LOGGED_IN -->Hello Mr. Logged In<!-- ELSEIF not S_USER_LOGGED_IN -->Please login kind sir<!--ENDIF -->
Structure of an IF statements?
First you will have the
Code:
<!--
Code:
-->
IF statements loops?
To make a loop with IF statements you may use
Code:
<!-- ELSEIF condition -->
Code:
<!-- ENDIF -->
Example Scenario: Hello, I am running phpBB3 and want to show my guests 'Please Register or Login', my normal users 'Welcome to my Site, Thank You for Signing Up', and staff 'Welcome Staff'.
Example Answer:
Code:
<!-- IF not S_USER_LOGGED_IN -->Please <!-- IF S_REGISTER_ENABLED -->Register or <!-- ENDIF -->Login<!-- ELSE IF S_USER_LOGGED_IN -->Welcome to my Site, Thank You for Signing Up<!-- ELSEIF U_ACP or U_MCP -->Welcome Staff<!-- ENDIF -->
Additional Variables for IF statements?
There are additional variables like
Code:
and
Code:
not
Code:
or
Conditions List (From StarTrekGuide):
S_USER_LOGGED_IN
S_AUTOLOGIN_ENABLED
S_BOARD_DISABLED
S_IS_BOT
S_USER_PM_POPUP
S_DISPLAY_SEARCH
S_DISPLAY_PM
S_DISPLAY_MEMBERLIST
U_MCP
U_ACP
S_IS_LINK
S_UNREAD_FORUM
S_READ_FORUM
S_LOCKED_FORUM
S_LIST_SUBFORUMS
S_SUBFORUMS
S_IS_CAT
S_IS_POST
If you required any assistance, do NOT hesitate to add me on MSN or PM here. :yes:







