global $SEC_CHARS;
// Compile constants
- $code = str_replace("{--", '".', str_replace("--}", '."', $code));
+ $code = str_replace('{--', '".', str_replace('--}', '."', $code));
// Compile QUOT and other non-HTML codes
foreach ($SEC_CHARS['to'] as $k=>$from)
}
// But keep simple quotes for later use
- if ($simple) $code = str_replace("'", "{QUOT}", $code);
+ if ($simple) $code = str_replace("'", '{QUOT}', $code);
// Return compiled code
return $code;
{
// Add more variables which you want to use in your template files
global $DATA, $ACTION, $WHAT;
- $REFID = bigintval($_COOKIE['refid']);
+ $REFID = bigintval(get_session('refid'));
if ($template == "member_support_form")
{
// Support request of a member
- $ID = bigintval($_COOKIE['userid']);
+ $ID = bigintval($GLOBALS['userid']);
$result = SQL_QUERY_ESC("SELECT sex, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid='%s' LIMIT 1", array($ID), __FILE__, __LINE__);
list($sex, $surname, $family) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
{
// The local file does exists so we load it. :)
$tmpl_file = implode("", file($file));
- $tmpl_file = str_replace("'", "{QUOT}", $tmpl_file);
+ $tmpl_file = str_replace("'", '{QUOT}', $tmpl_file);
// Compile and run code
$ret = COMPILE_CODE(addslashes($tmpl_file), false, true);
elseif (IS_ADMIN())
{
// Only admins shall see this warning
- $ret = "<BR><SPAN class=\"guest_failed\">".TEMPLATE_404."</SPAN><BR>
+ $ret = "<br /><SPAN class=\"guest_failed\">".TEMPLATE_404."</SPAN><br />
(".basename($file).")
-<BR><BR>";
+<br /><br />";
}
if ($return)
{