2006-11-25, 01:41 AM
in inc/functions.php
Find
add under
in inc/class_templates.php
find
add under
$template= str_replace("<if condition=","\".iif(",$template);
$template= str_replace("<then>",",\"",$template);
$template= str_replace("<else />","\",\"",$template);
$template= str_replace("</if>","\").\"",$template);
code is
<if condition=$mybbuser['uid']== 1 <then>
Other Users <else /> Is User 1 </if>
Find
/**
* Outputs a page directly to the browser, parsing anything which needs to be parsed.
*
* @param string The contents of the page.
*/
add under
// ###################### Start iif #######################
function iif($expression, $returntrue, $returnfalse = '')
{
return ($expression ? $returntrue : $returnfalse);
}
// #############################################
in inc/class_templates.php
find
$template = str_replace("\\'", "'", $db->escape_string($template));
add under
$template= str_replace("<if condition=","\".iif(",$template);
$template= str_replace("<then>",",\"",$template);
$template= str_replace("<else />","\",\"",$template);
$template= str_replace("</if>","\").\"",$template);
code is
<if condition=$mybbuser['uid']== 1 <then>
Other Users <else /> Is User 1 </if>