Re: v2 hall of shame
I tried this on my V2 McCodes and it didn't work. So I tried editing, and realised that the links were a bit wrong. After sorting them, I made it similar to the Hall Of Fame, where you can filter users. Basically, if you have less than 20 users, the user with the highest, will show at the bottom, obviously. Here's what I edited.
Please note, that I called mine hos.php, so if you want to edit it, then just change the links, that's all. If you can't be bothered, just ask me, and I'll do it.
<?php
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 "<h3>Hall Of Fame</h3><hr />
Filter: [$bt1[url='hos.php?action={$_GET[']Non-Donators[/url]$bet1 | $bt2[url='hos.php?action={$_GET[']Donators[/url]$bet2 | $bt3[url='hos.php?action={$_GET[']All Users[/url]$bet3]<hr />
<table width=75% cellspacing=1 class='table'> <tr> <td>[url='hos.php?action=level&filter={$filter}']LEVEL[/url]</td> <td>[url='hos.php?action=money&filter={$filter}']MONEY[/url]</td> <td>[url='hos.php?action=respect&filter={$filter}']RESPECT[/url]</td> <td>[url='hos.php?action=crystals&filter={$filter}']CRYSTALS[/url]</td> <td>[url='hos.php?action=total&filter={$filter}']TOTAL STATS[/url]</td> </tr>
<tr> <td>[url='hos.php?action=strength&filter={$filter}']STRENGTH[/url]</td> <td>[url='hos.php?action=agility&filter={$filter}']AGILITY[/url]</td> <td>[url='hos.php?action=guard&filter={$filter}']GUARD[/url]</td> <td>[url='hos.php?action=labour&filter={$filter}']LABOUR[/url]</td> <td>[url='hos.php?action=iq&filter={$filter}']IQ[/url]</td> </tr> </table>";
switch($_GET['action'])
{
case "level":
hof_level();
break;
case "money":
hof_money();
break;
case "credits":
hof_credits();
break;
case "respect":
hof_respect();
break;
case "total":
hof_total();
break;
case "strength":
hof_strength();
break;
case "speed":
hof_speed();
break;
case "defence":
hof_defence();
break;
case "dexterity":
hof_dexterity();
break;
case "work":
hof_work();
break;
}
function hof_level()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the Lowest levels
<table width=75%><tr style='background:black'> <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 ORDER BY level ASC,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>{$r['username']} [{$r['userid']}]$et</td> <td>$t{$r['level']}$et</td> </tr>";
}
print "</table>";
}
function hof_money()
{
global $ir,$db,$userid,$h;
print "Showing the 10 users with the LOWEST amount of money
<table width=75%><tr style='background:black'> <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 ORDER BY money ASC,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>{$r['username']} [{$r['userid']}]$et</td> <td>$t\$".money_formatter($r['money'],'')."$et</td> </tr>";
}
print "</table>";
}
function hof_credits()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the LOWEST amount of credits
<table width=75%><tr style='background:black'> <th>Pos</th> <th>User</th> <th>credits</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 ORDER BY credits ASC,userid ASC LIMIT 50");
$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>{$r['username']} [{$r['userid']}]$et</td> <td>$t".money_formatter($r['credits'],'')."$et</td> </tr>";
}
print "</table>";
}
function hof_respect()
{
global $ir,$db,$userid,$h;
print "Showing the 20 Forces with the LOWEST amount of respect
<table width=75%><tr style='background:black'> <th>Position</th> <th>Force</th> <th>Respect</th> </tr>";
$q=$db->query("SELECT * FROM gangs ORDER BY gangRESPECT ASC,gangID ASC LIMIT 50");
$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>";
}
function hof_total()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the LOWEST total stats
<table width=75%><tr style='background:black'> <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 ORDER BY (us.strength+us.agility+us.guard+us.labour+us.IQ) ASC,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>{$r['username']} [{$r['userid']}]$et</td> </tr>";
}
print "</table>";
}
function hof_strength()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the LOWEST strength
<table width=75%><tr style='background:black'> <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 ORDER BY us.strength ASC,u.userid ASC LIMIT 50");
$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>{$r['username']} [{$r['userid']}]$et</td> </tr>";
}
print "</table>";
}
function hof_speed()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the LOWEST speed
<table width=75%><tr style='background:black'> <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 ORDER BY us.agility ASC,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>{$r['username']} [{$r['userid']}]$et</td> </tr>";
}
print "</table>";
}
function hof_defence()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the LOWEST defence
<table width=75%><tr style='background:black'> <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 ORDER BY us.guard ASC,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>{$r['username']} [{$r['userid']}]$et</td> </tr>";
}
print "</table>";
}
function hof_dexterity()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the LOWEST dexterity
<table width=75%><tr style='background:black'> <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 ORDER BY us.labour ASC,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>{$r['username']} [{$r['userid']}]$et</td> </tr>";
}
print "</table>";
}
function hof_work()
{
global $ir,$db,$userid,$h;
print "Showing the 20 users with the LOWEST iq
<table width=75%><tr style='background:black'> <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 ORDER BY us.IQ ASC,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>{$r['username']} [{$r['userid']}]$et</td> </tr>";
}
print "</table>";
}
$h->endpage();
?>
:-)