Thanks for all the help guys, but I'm having some trouble with it...
I get this error when I try to save the template:
Quote:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']' in /home/mysite/public_html/includes/adminfunctions_template.php(3537) : eval()'d code on line 14
|
Here is my plugin using forumhome_start
Code:
$p = parse_ini_file_quotes_safe("http://jabba.dynelabs.com/client/status.php");
function parse_ini_file_quotes_safe($f)
{
$f=@file($f);
for ($i=0;$i<@count($f);$i++)
{
$newsec=0;
$w=@trim($f[$i]);
if ($w)
{
if ((!$r) or ($sec))
{
if ((@substr($w,0,1)=="[") and (@substr($w,-1,1))=="]") {$sec=@substr($w,1,@strlen($w)-2);$newsec=1;}
}
if (!$newsec)
{
$w=@explode("=",$w);$k=@trim($w[0]);unset($w[0]); $v=@trim(@implode("=",$w));
if ((@substr($v,0,1)=="\"") and (@substr($v,-1,1)=="\"")) {$v=@substr($v,1,@strlen($v)-2);}
if ($sec) {$r[$sec][$k]=$v;} else {$r[$k]=$v;}
}
}
}
return $r;
}
And here is my template.
Code:
<if condition="$p['maintenance-mode']">
<FONT color=\"#FF8000\">Maintenance</FONT></B><BR>
<else /><if condition="$p['server-status']=='online'">
<B><FONT color=\"#00FF00\">Online</FONT></B><BR>
<else />
<B><FONT color=\"#FF0000\">Offline</FONT></B><BR>
</if>
</if>
Jabbas in Town<BR>
<B><FONT color="<if condition="$p['users-online']">#00FF00<else />#FF0000</if>">
$p[users-online]</FONT></B><BR>