Naffer20 Posted December 23, 2011 Share Posted December 23, 2011 I'd like to implement it so it will show the amount of exp a user has in a skill for example strength. I've got this, but i need to change it so that it will go into userstats and get the Strength amount, any ideas? { $p++; if($r['gangID'] == $ir['gang']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td><td>$t".money_formatter($r['strength'],'')."$et</td> </tr>"; } Quote Link to comment Share on other sites More sharing options...
bineye Posted December 23, 2011 Share Posted December 23, 2011 money_formatter($r['strength']) Why??? Stats aren't money... If you have joined the tables users to userstats (which should already be the case as it is a hall of fame for that stat), then <td>".number_format($r['strength'])."</td> would suffice. Quote Link to comment Share on other sites More sharing options...
Naffer20 Posted December 23, 2011 Author Share Posted December 23, 2011 Why??? Stats aren't money... If you have joined the tables users to userstats (which should already be the case as it is a hall of fame for that stat), then <td>".number_format($r['strength'])."</td> would suffice. Didn't work. An nope, in my db I've got a users table & a userstats table. Here's the function function hof_strength() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest strength<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Stat</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.strength DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>".number_format($r['strength'],'')."$et</td> </tr>"; } Quote Link to comment Share on other sites More sharing options...
bineye Posted December 23, 2011 Share Posted December 23, 2011 function hof_strength() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest strength<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Stat</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.strength DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['strength']}$et</td> </tr>"; } try this first, then if it doesn't work, tell us if there is an error code, or describe what it displays. "Didn't work" doesn't help anyone because we can't see your page Quote Link to comment Share on other sites More sharing options...
Naffer20 Posted December 23, 2011 Author Share Posted December 23, 2011 (edited) I got this error. :D Parse error: syntax error, unexpected $end in /home/mafiasta/public_html/halloffame.php on line 340 <?php //HOF include "globals.php"; $filters=array( 'nodon' => 'AND donatordays=0', 'don' => 'AND donatordays > 0', 'all' => ''); $filter=(isset($filters[$_GET['filter']])) ? $_GET['filter'] : 'all'; $myf=$filters[$filter]; $bt1=($filter=="nodon") ? "<b>" : ""; $bet1=($filter=="nodon") ? "</b>" : ""; $bt2=($filter=="don") ? "<b>" : ""; $bet2=($filter=="don") ? "</b>" : ""; $bt3=($filter=="all") ? "<b>" : ""; $bet3=($filter=="all") ? "</b>" : ""; print " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Hall Of Fame</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'><br> <br><br> Filter: [$bt1<a href='halloffame.php?action={$_GET['action']}&filter=nodon'>Non-Donators</a>$bet1 | $bt2<a href='halloffame.php?action={$_GET['action']}&filter=don'>Donators</a>$bet2 | $bt3<a href='halloffame.php?action={$_GET['action']}&filter=all'>All Users</a>$bet3] <table width=75% cellspacing=1 class='table'> <tr> <td><a href='halloffame.php?action=level&filter={$filter}'>LEVEL</a></td> <td><a href='halloffame.php?action=money&filter={$filter}'>MONEY</a></td> <td><a href='halloffame.php?action=respect&filter={$filter}'>RESPECT</a></td> <td><a href='halloffame.php?action=crystals&filter={$filter}'>CRYSTALS</a></td> <td><a href='halloffame.php?action=total&filter={$filter}'>TOTAL STATS</a></td> <td><a href='halloffame.php?action=mine_level&filter={$filter}'>MINE LEVEL</a></td> <td><a href='halloffame.php?action=robskill&filter={$filter}'>ROB SKILL</a></td> </tr> <tr> <td><a href='halloffame.php?action=strength&filter={$filter}'>STRENGTH</a></td> <td><a href='halloffame.php?action=agility&filter={$filter}'>AGILITY</a></td> <td><a href='halloffame.php?action=guard&filter={$filter}'>GUARD</a></td> <td><a href='halloffame.php?action=labour&filter={$filter}'>LABOUR</a></td> <td><a href='halloffame.php?action=iq&filter={$filter}'>IQ</a></td> <td><a href='halloffame.php?action=ratings&filter={$filter}'>MOST RATED</a></td> <td><a href='halloffame.php?action=enemy_count&filter={$filter}'>MOST HATED</a></td> </tr> <tr> <td><a href='halloffame.php?action=bankmoney&filter={$filter}'>BANK MONEY</a></td> <td><a href='halloffame.php?action=cybermoney&filter={$filter}'>CYBER BANK MONEY</a></td> <td><a href='halloffame.php?action=posts&filter={$filter}'>FORUM POSTS</a></td></table>"; switch($_GET['action']) { case "level": hof_level(); break; case "money": hof_money(); break; case "crystals": hof_crystals(); break; case "respect": hof_respect(); break; case "total": hof_total(); break; case "strength": hof_strength(); break; case "agility": hof_agility(); break; case "guard": hof_guard(); break; case "labour": hof_labour(); break; case "iq": hof_iq(); break; case "ratings": hof_ratings(); break; case "mine_level": hof_mine_level(); break; case "enemy_count": hof_enemy_count(); break; case "robskill": hof_robskill(); break; case "bankmoney": hof_bankmoney(); break; case "cybermoney": hof_cybermoney(); break; case "posts": hof_posts(); break; } function hof_level() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest levels<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Level</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY level DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_money() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of money<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Money</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY money DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['money'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_crystals() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of crystals<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Crystals</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY crystals DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t".money_formatter($r['crystals'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_respect() { global $db,$ir,$c,$userid; print "Showing the 20 gangs with the highest amount of respect<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>Gang</th> <th>Respect</th> </tr>"; $q=$db->query("SELECT * FROM gangs ORDER BY gangRESPECT DESC,gangID ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['gangID'] == $ir['gang']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangNAME']} [{$r['gangID']}]$et</td> <td>$t".money_formatter($r['gangRESPECT'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_total() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest total stats<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY (us.strength+us.agility+us.guard+us.labour+us.IQ) DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_strength() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest strength <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Stat</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.strength DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['strength']}$et</td> </tr>"; } function hof_agility() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest agility<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.agility DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_guard() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest guard<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.guard DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_labour() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest labour<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.labour DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_ratings() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest ratings<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.ratings DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_mine_level() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest mine level<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.mine_level DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_posts() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest form posts<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Amount</th></tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.posts DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['gangID'] == $ir['gang']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td><td>$t".money_formatter($r['posts'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_bankmoney() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of bank money<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Bank Money</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY bankmoney DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['bankmoney'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_cybermoney() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of cyber bank money<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Cyber Bank Money</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY cybermoney DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['cybermoney'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_enemy_count() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest enemy count <br> This is based upon how many people have you on there enemy list.<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.enemy_count DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_robskill() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest rob skill <br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Stat</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.robskill DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td></td></tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } function hof_iq() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest IQ<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.IQ DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div><br></div></div></div></div></div>"; } $h->endpage(); ?> Edited December 23, 2011 by Naffer20 Quote Link to comment Share on other sites More sharing options...
bineye Posted December 23, 2011 Share Posted December 23, 2011 <?php //HOF include "system.php"; $filters=array( 'nodon' => 'AND donatordays=0', 'don' => 'AND donatordays > 0', 'all' => ''); $filter=(isset($filters[$_GET['filter']])) ? $_GET['filter'] : 'all'; $myf=$filters[$filter]; $bt1=($filter=="nodon") ? "<b>" : ""; $bet1=($filter=="nodon") ? "</b>" : ""; $bt2=($filter=="don") ? "<b>" : ""; $bet2=($filter=="don") ? "</b>" : ""; $bt3=($filter=="all") ? "<b>" : ""; $bet3=($filter=="all") ? "</b>" : ""; print " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> Hall Of Fame</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'> Filter: [$bt1<a href='halloffame.php?action={$_GET['action']}&filter=nodon'>Non-Donators</a>$bet1 | $bt2<a href='halloffame.php?action={$_GET['action']}&filter=don'>Donators</a>$bet2 | $bt3<a href='halloffame.php?action={$_GET['action']}&filter=all'>All Users</a>$bet3] <table width=75% cellspacing=1 class='table'> <tr> <td><a href='halloffame.php?action=level&filter={$filter}'>LEVEL</a></td> <td><a href='halloffame.php?action=money&filter={$filter}'>MONEY</a></td> <td><a href='halloffame.php?action=respect&filter={$filter}'>RESPECT</a></td> <td><a href='halloffame.php?action=crystals&filter={$filter}'>CRYSTALS</a></td> <td><a href='halloffame.php?action=total&filter={$filter}'>TOTAL STATS</a></td> <td><a href='halloffame.php?action=mine_level&filter={$filter}'>MINE LEVEL</a></td> <td><a href='halloffame.php?action=robskill&filter={$filter}'>ROB SKILL</a></td> </tr> <tr> <td><a href='halloffame.php?action=strength&filter={$filter}'>STRENGTH</a></td> <td><a href='halloffame.php?action=agility&filter={$filter}'>AGILITY</a></td> <td><a href='halloffame.php?action=guard&filter={$filter}'>GUARD</a></td> <td><a href='halloffame.php?action=labour&filter={$filter}'>LABOUR</a></td> <td><a href='halloffame.php?action=iq&filter={$filter}'>IQ</a></td> <td><a href='halloffame.php?action=ratings&filter={$filter}'>MOST RATED</a></td> <td><a href='halloffame.php?action=enemy_count&filter={$filter}'>MOST HATED</a></td> </tr> <tr> <td><a href='halloffame.php?action=bankmoney&filter={$filter}'>BANK MONEY</a></td> <td><a href='halloffame.php?action=cybermoney&filter={$filter}'>CYBER BANK MONEY</a></td> <td><a href='halloffame.php?action=posts&filter={$filter}'>FORUM POSTS</a></td></table>"; switch($_GET['action']) { case "level": hof_level(); break; case "money": hof_money(); break; case "crystals": hof_crystals(); break; case "respect": hof_respect(); break; case "total": hof_total(); break; case "strength": hof_strength(); break; case "agility": hof_agility(); break; case "guard": hof_guard(); break; case "labour": hof_labour(); break; case "iq": hof_iq(); break; case "ratings": hof_ratings(); break; case "mine_level": hof_mine_level(); break; case "enemy_count": hof_enemy_count(); break; case "robskill": hof_robskill(); break; case "bankmoney": hof_bankmoney(); break; case "cybermoney": hof_cybermoney(); break; case "posts": hof_posts(); break; } function hof_level() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest levels <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Level</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY level DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_money() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of money <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Money</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY money DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['money'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_crystals() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of crystals <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Crystals</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY crystals DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t".money_formatter($r['crystals'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_respect() { global $db,$ir,$c,$userid; print "Showing the 20 gangs with the highest amount of respect <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>Gang</th> <th>Respect</th> </tr>"; $q=$db->query("SELECT * FROM gangs ORDER BY gangRESPECT DESC,gangID ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['gangID'] == $ir['gang']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangNAME']} [{$r['gangID']}]$et</td> <td>$t".money_formatter($r['gangRESPECT'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_total() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest total stats <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY (us.strength+us.agility+us.guard+us.labour+us.IQ) DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_strength() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest strength <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Stat</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.strength DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t".number_format($r['strength'])."$et</td> </tr>"; } } function hof_agility() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest agility <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.agility DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_guard() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest guard <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.guard DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_labour() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest labour <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.labour DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_ratings() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest ratings <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.ratings DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_mine_level() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest mine level <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.mine_level DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_posts() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest form posts <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Amount</th></tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.posts DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['gangID'] == $ir['gang']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td><td>$t".money_formatter($r['posts'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_bankmoney() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of bank money <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Bank Money</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY bankmoney DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['bankmoney'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_cybermoney() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest amount of cyber bank money <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Cyber Bank Money</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY cybermoney DESC,userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['cybermoney'],'')."$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_enemy_count() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest enemy count This is based upon how many people have you on there enemy list. <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY u.enemy_count DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_robskill() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest rob skill <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Stat</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.robskill DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td></td></tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } function hof_iq() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest IQ <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.IQ DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> </tr>"; } print "</table></div><div><img src='images/generalinfo_btm.jpg' alt='' /></div></div></div></div></div></div>"; } $h->endpage(); ?> Get yourself a copy of Notepad++, then when you get an error, copy it in there and go to the line that it tells you the error is on. I found a number of errors there, and none were the original function that you said. Quote Link to comment Share on other sites More sharing options...
Naffer20 Posted December 23, 2011 Author Share Posted December 23, 2011 Didn't work. An nope, in my db I've got a users table & a userstats table. Here's the function function hof_strength() { global $db,$ir,$c,$userid, $myf; print "Showing the 20 users with the highest strength<br /> <table width=75% cellspacing=1 class='table'><tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Stat</th> </tr>"; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY us.strength DESC,u.userid ASC LIMIT 20"); $p=0; while($r=$db->fetch_row($q)) { $p++; if($r['userid'] == $userid) { $t="<b>";$et="</b>"; } else { $t="";$et=""; } print "<tr> <td>$t$p$et</td> <td>$t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et</td> <td>".number_format($r['strength'],'')."$et</td> </tr>"; } I've fixed my HOF code, just need something that will show the userstats in HOF. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.