TheBigChief Posted April 22, 2009 Posted April 22, 2009 Hi Peeps, can anyone help me change it so that userlist.php shows this instead of levels. if ($user['level'] < 15) { $rank = " Wannabe [img=images/ranks/1.gif]"; } else if ($user['level'] < 30) { $rank = " Petty Thief [img=images/ranks/2.gif]"; } else if ($user['level'] < 60) { $rank = " Shoplifter [img=images/ranks/3.gif]"; } else if ($user['level'] < 90) { $rank = " Car Jacker [img=images/ranks/4.gif]"; } else if ($user['level'] < 110) { $rank = " Criminal [img=images/ranks/5.gif]"; } else if ($user['level'] < 140) { $rank = " Thief [img=images/ranks/6.gif]"; } else if ($user['level'] < 170) { $rank = " Con Artist [img=images/ranks/7.gif]"; } else if ($user['level'] < 200) { $rank = " Drug Runner [img=images/ranks/8.gif]"; } else if ($user['level'] < 230) { $rank = " Drug Dealer [img=images/ranks/9.gif]"; } else if ($user['level'] < 260) { $rank = " Fraudster [img=images/ranks/10.gif]"; } else if ($user['level'] < 290) { $rank = " Armed Robber [img=images/ranks/11.gif]"; } else if ($user['level'] < 310) { $rank = " Bank Robber [img=images/ranks/12.gif]"; } else if ($user['level'] < 340) { $rank = " Money Launderer"; } else if ($user['level'] < 370) { $rank = " Big Shot"; } else if ($user['level'] < 400) { $rank = " Assassin"; } else if ($user['level'] < 430) { $rank = " Hitman"; } else if ($user['level'] < 460) { $rank = " Gang Leader"; } else if ($user['level'] < 490) { $rank = " Criminal Mastermind"; } else if ($user['level'] < 510) { $rank = " Overlord"; } else if ($user['level'] > 600) { $rank = " Beyond the Law"; } else { $rank = " Fool"; I just dont know where to put it - it works great on the profile page. Quote
Dayo Posted April 22, 2009 Posted April 22, 2009 Re: [V2] Userlist Help Needed have you added print 'Rank: $rank'; Quote
TheBigChief Posted April 22, 2009 Author Posted April 22, 2009 Re: [V2] Userlist Help Needed have you added print 'Rank: $rank'; Here is what I have in full <?php include "globals.php"; $_GET['st'] = abs((int) $_GET['st']); $st=($_GET['st']) ? $_GET['st'] : 0; $by=($_GET['by']) ? $_GET['by'] : 'userid'; $ord=($_GET['ord']) ? $_GET['ord'] : 'ASC'; print "<h3>Userlist</h3>"; $cnt=mysql_query("SELECT userid FROM users",$c); $membs=mysql_num_rows($cnt); $pages=(int) ($membs/100)+1; if($membs % 100 == 0) { $pages--; } print "Pages: "; for($i=1;$i <= $pages;$i++) { $stl=($i-1)*100; print "[url='userlist.php?st=$stl&by=$by&ord=$ord']$i[/url] "; } print " Order By: [url='userlist.php?st=$st&by=userid&ord=$ord']User ID[/url] | [url='userlist.php?st=$st&by=username&ord=$ord']Username[/url] | [url='userlist.php?st=$st&by=level&ord=$ord']Level[/url] | [url='userlist.php?st=$st&by=money&ord=$ord']Money[/url] [url='userlist.php?st=$st&by=$by&ord=asc']Ascending[/url] | [url='userlist.php?st=$st&by=$by&ord=desc']Descending[/url] "; $q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100"); $no1=$st+1; $no2=$st+100; print "Showing users $no1 to $no2 by order of $by $ord. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>ID</th><th>Name</th><th>Money</th><th>Level</th><th>Gender</th><th>Online</th></tr>"; while($r=$db->fetch_row($q)) { $d=""; if($r['donatordays']) { $r['username'] = "<font color=red>{$r['username']}</font>";$d="[img=donator.gif]"; } print "<tr><td>{$r['userid']}</td><td>[url='viewuser.php?u={$r[']{$r['gangPREF']} {$r['username']} $d[/url]</td><td>\${$r['money']}</td><td>{$r['level']}</td><td>{$r['gender']}</td><td>"; if($r['laston'] >= time()-15*60) { print "<font color=green>[b]Online[/b]</font>"; } else { print "<font color=red>[b]Offline[/b]</font>"; } print "</td></tr>"; } print "</table>"; $h->endpage(); ?> Quote
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.