views:

121

answers:

2

I see in PHPBB they use conditional statements inside their html, or xhtml, if you dont know what I mean here is a snippet:

<!-- IF MODERATORS -->
<p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE 

-->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
<!-- ENDIF -->
<!-- IF U_MCP -->
    <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
<!-- ENDIF -->

Is there an explanation on how to implement this in my own site, as it would be very useful and clean up a lot of code.

A: 

PHP may work:

<?php if ($moderator) { ?>
<p class="moderators">
<?php } ?>
shipshape
A: 

I would take a look at the PHPBB source code and find the files that parse these comments. There's probably a class for templates which you could reuse for your own projects.

If it helps, documentation about the syntax is available at:

http://area51.phpbb.com/docs/coding-guidelines.html#templates

Josh