[How-To] Use Template Conditional in any Script
by
02 Jun 2007
This tutorial will show you how to return data from a column you've created and parse template conditionals. PHP Code:
<?php
For sake of this article let's say "$sql['my_field']" contains the following HTML Code:
<if condition="is_member_of($bbuseruserinfo, 12)"> To access the arcade click on "Links" to access the menu.<br /> Within the menu choose "Arcade". <else /> <if condition="!is_member_of($bbuseruserinfo, 12)"> To access the arcade you need a minimum of 1000 posts. Currently you only have $bbuserinfo[posts] </if> </if> You'll need to take the variable "$done" and place it in "my_template". HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> $headinclude <title>$vboptions[bbtitle]</title> </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">My Custom Page Title</td> </tr> <tr> <td class="alt1">$done</td> </tr> </table> $footer </body> </html> View the attachment to see what the end result. I have tested the security and it returns dangerous code as plain text. This means that no one can perform mischievous actions towards your forums. |