Olá meus amigos de forum
preciso de ajuda neste código que está me dando o seguinte erro:
Fatal error: Call to a member function query() on a non-object in C:\xampp\htdocs\rep.php on line 7
código:
<?PHP
//Cyber's REPutation System 6.1 for Gesior AAC
$main_content .= '
<style type="text/css">tr.over:hover {background-color: '.$config['site']['darkborder'].';;}</style>
<style type="text/css"><White{color:white}}></style>';
$rep_pos = $SQL->query('SELECT name, rep FROM players WHERE rep > 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep DESC LIMIT 10;');
$rep_neg = $SQL->query('SELECT name, rep FROM players WHERE rep < 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep ASC LIMIT 10;');
$rep_pos2 = $SQL->query('SELECT name, rep FROM players WHERE rep > 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep DESC LIMIT 10;');
$rep_neg2 = $SQL->query('SELECT name, rep FROM players WHERE rep < 0 AND name NOT LIKE "%Sample" AND name != "Account Manager" AND deleted = 0 AND group_id = 1 ORDER BY rep ASC LIMIT 10;');
$players_pos = 0;
$players_neg = 0;
foreach($rep_pos2 as $posplayer)
{
$players_pos++;
}
foreach($rep_neg2 as $negplayer)
{
$players_neg++;
}
$i = 0;
if ($players_pos)
foreach($rep_pos as $player) {
$i++;
$bgcolor = $config['site']['darkborder'];
$bgcolor = $config['site']['lightborder'];
$rank = getReputation($player['rep']);
$players_rows .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% STYLE="border: 1px solid #000;'.($i != $players_pos ? 'border-bottom: none;' : null).'"><TR BGCOLOR='.$bgcolor.' CLASS="over">
<TD WIDTH="44%"><A HREF="?subtopic=characters&name='.urlencode($player['name']).'"> '.$player['name'].$rs.$bs.'</A></TD>
<TD WIDTH="20%" STYLE="border-left: 1px solid #000; border-right: 1px solid #000;"> '.$player['rep'].'</TD>
<TD WIDTH="36%"> '.$rank[0].'<br />'.$rank[1].'</TD></TR></TABLE>';
}
else // DO NOT MODIFY
$players_rows .= ' There are no players with positive reputation.';
$o = 0;
if ($players_neg)
foreach($rep_neg as $player) {
$o++;
$bgcolor = $config['site']['darkborder'];
$bgcolor = $config['site']['lightborder'];
$rank = getReputation($player['rep']);
$players_rows2 .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% STYLE="border: 1px solid #000;'.($o != $players_neg ? 'border-bottom: none;' : null).'"><TR BGCOLOR='.$bgcolor.' CLASS="over">
<TD WIDTH="44%"><A HREF="?subtopic=characters&name='.urlencode($player['name']).'"> '.$player['name'].$rs.$bs.'</A></TD>
<TD WIDTH="20%" STYLE="border-left: 1px solid #000; border-right: 1px solid #000;"> '.$player['rep'].'</TD>
<TD WIDTH="36%"> '.$rank[0].'<br />'.$rank[1].'</TD></TR></TABLE>';
}
else // DO NOT MODIFY
$players_rows2 .= ' There are no players with negative reputation.';
// DO NOT MODIFY \/
if ($players_rows == ' There are no players with positive reputation.')
{$bar1='http://i29.tinypic.com/2cmm4o2.jpg';}
else
{$bar1='repPics.php?type=1';}
if ($players_rows2 == ' There are no players with negative reputation.')
{$bar2='http://i30.tinypic.com/o51imx.jpg';}
else
{$bar2 = 'repPics.php?type=2';}
// DO NOT MODIFY /\
$main_content .= '
<br/><center><img src="'.$bar1.'" width="50%"/><img src="'.$bar2.'" width="50%"/></center><br/>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'">
<TD WIDTH="22%"><strong> <span class="white">NAME</span></strong></TD>
<TD WIDTH="10%"><strong> <span class="white">POINTS</span></strong></TD>
<TD WIDTH="18%"><strong> <span class="white">RANK</span></strong></TD>
<TD WIDTH="22%"><strong> <span class="white">NAME</span></strong></TD>
<TD WIDTH="10%"><strong> <span class="white">POINTS</span></strong></TD>
<TD WIDTH="18%"><strong> <span class="white">RANK</span></strong></TD></TR><TR>
<TD WIDTH="50%" COLSPAN="3" VALIGN="TOP">'.$players_rows.'</TD>
<TD COLSPAN="3" VALIGN="TOP">'.$players_rows2.'</TD>
</TR></TABLE><br/>';
$main_content .= '
<center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100% style="background-color: #9C084A">
<TR align="left" bgcolor="'.$config['site']['darkborder'].'">
<TD WIDTH=25%><strong>RANK</strong></TD>
<TD WIDTH=20%><strong>OUTFIT</strong></TD>
<TD WIDTH=15% align="center"><strong>POINTS</strong></TD>
<TD WIDTH=25% align="center"><strong>BAR</strong></TD>
<TD WIDTH=15% align="center"><strong>POWER</strong></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#215868"><strong> Legend</strong></TD>
<TD BGCOLOR="#215868"> <img src="images/rep/legend.gif"/></TD>
<TD BGCOLOR="#215868"><center><strong>5000</strong></center></TD>
<TD BGCOLOR="#215868"><strong> (==========>>+)</strong></TD>
<TD BGCOLOR="#215868"><center>7</center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#31849b"><strong> Hero</strong></TD>
<TD BGCOLOR="#31849b"> <img src="http://images2.wikia.nocookie.net/__cb20050501020324/tibia/en/images/6/6f/Hero.gif"/></TD>
<TD BGCOLOR="#31849b"><center><strong>2000</strong></center></TD>
<TD BGCOLOR="#31849b"><strong> (==========>+=)</strong></TD>
<TD BGCOLOR="#31849b"><center>6</center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#4bacc6"><strong> Acclaimed</strong></TD>
<TD BGCOLOR="#4bacc6"> <img src="http://images3.wikia.nocookie.net/__cb20050531205626/tibia/en/images/e/e8/Elf_Arcanist.gif"/></TD>
<TD BGCOLOR="#4bacc6"><center><strong>1500</strong></center></TD>
<TD BGCOLOR="#4bacc6"><strong> (==========+==)</strong></TD>
<TD BGCOLOR="#4bacc6"><center>5</center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#92cddc"><strong> Hailed</strong></TD>
<TD BGCOLOR="#92cddc"></TD
<TD BGCOLOR="#92cddc"><center><strong>1000</center></TD>
<TD BGCOLOR="#92cddc"><strong> (=========|===)</strong></TD>
<TD BGCOLOR="#92cddc"><center>4</center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#b6dde8"><span style="color:black;font-weight:bold"> Popular</span></TD>
<TD BGCOLOR="#b6dde8"></TD
<TD BGCOLOR="#b6dde8"><center><span style="color:black;font-weight:bold">500</center></span></TD>
<TD BGCOLOR="#b6dde8"><span style="color:black;font-weight:bold"> (========|====)</strong></span></TD>
<TD BGCOLOR="#b6dde8"><center><span style="color:black;font-weight:bold">3</span></center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#daeef3"><strong> <span style="color:black;font-weight:bold">Avowed</span></TD>
<TD BGCOLOR="#daeef3"></TD>
<TD BGCOLOR="#daeef3"><center><span style="color:black;font-weight:bold">300</span></center></TD>
<TD BGCOLOR="#daeef3"> <span style="color:black;font-weight:bold">(=======|=====)</span></TD>
<TD BGCOLOR="#daeef3"><center><span style="color:black;font-weight:bold">2</span></center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#f2eff5"><span style="color:black;font-weight:bold"> Unknown</span></TD>
<TD BGCOLOR="#f2eff5"></TD>
<TD BGCOLOR="#f2eff5"><center><span style="color:black;font-weight:bold">0</span></center></TD>
<TD BGCOLOR="#f2eff5"><span style="color:black;font-weight:bold"> (======|======)</span></TD>
<TD BGCOLOR="#f2eff5"><center><span style="color:black;font-weight:bold">1</span></center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#f2dbdb"><span style="color:black;font-weight:bold"> Creeping</span></TD>
<TD BGCOLOR="#f2dbdb"></TD>
<TD BGCOLOR="#f2dbdb"><center><span style="color:black;font-weight:bold">-300</span></center></TD>
<TD BGCOLOR="#f2dbdb"><span style="color:black;font-weight:bold"> (=====|=======)</span></TD>
<TD BGCOLOR="#f2dbdb"><center><span style="color:black;font-weight:bold">2</span></center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#e5b8b7"><span style="color:black;font-weight:bold"> Villain</span></TD>
<TD BGCOLOR="#e5b8b7"></TD>
<TD BGCOLOR="#e5b8b7"><center><span style="color:black;font-weight:bold">-500</span></center></TD>
<TD BGCOLOR="#e5b8b7"><span style="color:black;font-weight:bold"> (====|========)</span></TD>
<TD BGCOLOR="#e5b8b7"><center><span style="color:black;font-weight:bold">3</span></center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#d99594"><strong> Killer</strong></TD>
<TD BGCOLOR="#d99594"></TD>
<TD BGCOLOR="#d99594"><center><strong>-1000</strong></center></TD>
<TD BGCOLOR="#d99594"><strong> (===|=========)</strong></TD>
<TD BGCOLOR="#d99594"><center>4</center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#c0504d"><strong> Slayer</strong></TD>
<TD BGCOLOR="#c0504d"> <img src="http://images2.wikia.nocookie.net/__cb20060327220853/tibia/en/images/8/8d/Pig.gif"/></TD>
<TD BGCOLOR="#c0504d"><center><strong>-1500</strong></center></TD>
<TD BGCOLOR="#c0504d"><strong> (==*==========)</strong></TD>
<TD BGCOLOR="#c0504d"><center>5</center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#943634"><strong> Evil</strong></TD>
<TD BGCOLOR="#943634"> <img src="http://images1.wikia.nocookie.net/__cb20081212000350/tibia/en/images/4/46/Undead_Gladiator.gif"/></TD>
<TD BGCOLOR="#943634"><center><strong>-2000</strong></center></TD>
<TD BGCOLOR="#943634"><strong> (=*<==========)</strong></TD>
<TD BGCOLOR="#943634"><center>6</center></TD>
</TR>
<TR align="left">
<TD BGCOLOR="#632423"><strong> Power Abuser</strong></TD>
<TD BGCOLOR="#632423"> <img src="http://images2.wikia.nocookie.net/__cb20091128072335/tibia/en/images/2/29/Draken_Warmaster.gif"/></TD>
<TD BGCOLOR="#632423"><center><strong>-5000</strong></center></TD>
<TD BGCOLOR="#632423"><strong> (*<<==========)</strong></TD>
<TD BGCOLOR="#632423"><center>7</center></TD>
</TR></TABLE></center><br/><div align="right"><span style="font-size:smaller;text-align:left">Scripted by <a href="http://otland.net/members/cybershot/">Cybermaster</a></span></div>';