Switch to SMARTY from phpBB TEMPLATE Class
Our clients, and our work in general make using the GNU GPLv3 very difficult. For this reason, you may find yourself in a situation where you would like to use a more commercial friendly template engine. Rewriting your template code, and your PHP is not as complex as you might think:
Before: XHTML
<!-- BEGIN user_row -->
{user_row.user_id} - {user_row.username}
<!-- END user_row -->
Before: PHP
while( $row = mysql_fetch_row($result) )
{
$template->assign_block_vars('user_row', array(
'user_id' => $row['user_id'],
'username' => $row['username'],
));
}
After: XHTML
{section name=user loop=$user_row}
{$user_row[user].user_id} - {$user_row[user].username}
{/section}
After: PHP
while( $row = mysql_fetch_row($result) )
{
$user = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
);
$user_rows[] = $user;
}
$template->assign(array, $user_rows);
There are other ways to assign your arrays for SMARTY, but I prefer a more human readable approach that shows a linear assignment from database, to loop array, to template array.