if your using postbit
admincp> plugin manager
look for ibProArcade: Crowns in Postbit
and replace the code with this
Code:
global $crowncache;
if (!$crowncache)
{
$this->cache['champs'] = array();
$this->cache['tourneys'] = array();
$this->cache['crowns'] = array();
$this->cache['crown'] = $this->registry->db->query_first("SELECT crown_type AS type, show_crowns, show_t_won FROM " . TABLE_PREFIX . "games_settings");
if ($this->cache['crown']['show_crowns'])
{
$thecrowns = $this->registry->db->query_read("
SELECT c.*, g.gname, cat.password FROM " . TABLE_PREFIX . "games_champs AS c, " . TABLE_PREFIX . "games_list AS g, " . TABLE_PREFIX . "games_cats AS cat
WHERE (c.champ_gid=g.gid) AND (g.gcat=cat.c_id) AND trim(password)='' AND g.active=1
");
while ($this_champ = $this->registry->db->fetch_array($thecrowns))
{
if (!isset($this->cache['champs']["$this_champ[champ_mid]"]))
{
$this->cache['champs']["$this_champ[champ_mid]"] = array();
}
$this->cache['champs']["$this_champ[champ_mid]"][] = array(
'gid' => $this_champ['champ_gid'],
'gtitle' => $this_champ['champ_gtitle'],
'gname' => $this_champ['gname']
);
}
}
if ($this->cache['crown']['show_t_won'])
{
$tourneyquery = $this->registry->db->query_read("
SELECT t.champion, u.userid FROM " . TABLE_PREFIX . "tournaments AS t
LEFT JOIN " . TABLE_PREFIX . "user AS u ON (t.champion = u.username)
WHERE champion<>''
");
while ($this_tourney = $this->registry->db->fetch_array($tourneyquery))
{
if (!isset($this->cache['tourneys']["$this_tourney[userid]"]))
{
$this->cache['tourneys']["$this_tourney[userid]"] = 0;
}
$this->cache['tourneys']["$this_tourney[userid]"]++;
}
}
$crowncache = true;
}
$champs =& $this->cache['champs'];
$tourneys =& $this->cache['tourneys'];
$crown =& $this->cache['crown'];
$crowns = '';
if ($crown['show_crowns'])
{
if (!isset($this->cache['crowns']["$post[userid]"]))
{
$crowns = '';
if (isset($champs["$post[userid]"]))
{
if ((count($champs["$post[userid]"]) > 1) && ($crowns[type]!=4))
{
switch ($crown['type'])
{
case 0:
$crowns = '';
break;
case 1:
$crowns = '<marquee width="150" scrollamount="3">';
break;
case 2:
$crowns = '<marquee width="175" name="crownscroll" scrollamount="1" direction="up" height="20">';
break;
case 3:
$crowns = '';
break;
}
$crown_end = ($crown['type'] == 1) ? '' : '<br />';
$counter=0;
foreach ($champs["$post[userid]"] AS $this_game)
{
if ($crown['type'] == 3)
{
if ($counter == 5)
{
$counter = 0; $crowns.= "<br />";
}
}
$imgtext="";
if ($crown['type'] == 3) { $imgtext = "$this_game[gtitle] Champion"; }
$crowns .= "<a href=\"arcade.php?" . $this->registry->session->vars['sessionurl'] . "do=stats&gameid=$this_game[gid]\"> <img src=\"arcade/images/$this_game[gname]2.gif\" border=\"0\" alt=\"$imgtext\" width=\"20\" height=\"20\" />";
if ($crown['type']!=3)
{
$crowns .= $this_game[gtitle]." Champion!</a> " . $crown_end;
}
else
{
$crowns .= "</a> ";
}
$counter++;
}
if ($crown['type'] != 0)
{
$crowns .= '</marquee>';
if ( ($crown['show_t_won']) && (isset($tourneys["$post[userid]"])) )
{
$crowns .= '<br />';
}
}
}
else
{
foreach ($champs["$post[userid]"] AS $this_game )
{
$imgtext = "";
if ($crown['type'] == 3) { $imgtext = "$this_game[gtitle] Champion"; }
$crowns = "<a href=\"arcade.php?" . $this->registry->session->vars['sessionurl'] . "do=stats&gameid=$this_game[gid]\"><img src=\"arcade/images/$this_game[gname]2.gif\" border=\"0\" alt=\"$imgtext\" width=\"20\" height=\"20\" /> ";
if ($crown['type'] != 3)
{
$crowns .= "$this_game[gtitle] Champion!";
}
$crowns .= "</a>";
}
}
}
if ($crown[type]==4)
{
$extra="";
if (count($champs["$post[userid]"])>1)
{
$extra="s";
}
$crowns = "";
if (count($champs["$post[userid]"]) > 0)
{
$crowns = "<img src='arcade/images/trophy.gif' alt='".(count($champs["$post[userid]"]))." Highscore".$extra."'><br />";
}
}
$this->cache['crowns']["$post[userid]"] = $crowns;
}
else
{
$crowns = $this->cache['crowns']["$post[userid]"];
}
}
$champtext = '';
if ($crown['show_t_won'])
{
if (isset($tourneys["$post[userid]"]) )
{
$champtext = "<dt><a href='arcade.php?do=viewtourneyend' target='_blank' alt='123456'>" .$vbphrase[ibpa_tourney] . " </dt></a><b>" . $tourneys[$post[userid]] . "</b>";
}
}
$post['crowns'] = $crowns;
$post['champtext'] = $champtext;
if your using postbit_legacy change the marquee width= to suite