If-Then-Else in skins and *all* templates

Version 1.23


Basic if-then-else tool for skin designers. Very useful for hiding buttons. This method is preferred to running a php script because there is significantly less overhead. This can also be used in *any* template, allowing for more flexibility with almost everything. examples: |*if DOMAIN| <a href="http://|DOMAIN|">Link to |DOMAIN|</a> |*else| Sorry, no domain to click |*endif| |*if !DOMAIN| you have no domain! |*endif| |*if USERNAME="bob"| Hi bob! |*endif| |*if USERNAME=USER| Are you working on yourself? |*endif| Numbers are also supported: |*if "1">"2"| like this will ever happen! |*else| yeah, thats more like it |*endif| operators are: = != > < >= <= with = and !=, they'll be evaluated as strings. All others require numbers (decimal points allowed). You can either use tokens, or a string on either side of the operation. Numbers should always be in quotes or they'll be evaluated as tokens. You can assign tokens inside if-then-else statements: |*if "1">"2"| |?STR=something is going on here..| |*else| |?STR=all is well| |*endif| The result is: |STR| For more advanced operations, such as && or ||, see this guide: http://help.directadmin.com/item.php?id=324

Interested to try DirectAdmin? Get a 30-day Free Trial!