Jump to content
MakeWebGames

ranked


grant

Recommended Posts

ok i have been at this for about 3 days now just cant seem to get it to work ranked in my game well when you go to halloffame it tells you wot your rank is well i want my rank to tell me wot i rank in the game for Strength in my gym so if i was ranked 3 in my game it wld say 3 in all the game and so on for speed ect.. any help wld be great :D

Link to comment
Share on other sites

  • 1 month later...

This works for me..

 

<?php
include (DIRNAME(__FILE__) . '/header.php');
?>

<tr><td class='contenthead'>Hall Of Fame</td></tr>
<tr><td class='contentcontent'>

<div style='text-align:center;'>
[url='halloffame.php?view=exp']Level[/url] | 
[url='halloffame.php?view=strength']Strength[/url] | 
[url='halloffame.php?view=defense']Defense[/url] | 
[url='halloffame.php?view=speed']Speed[/url]
</div>

<tr><td class='contentcontent'>

<table width='100%'>
<tr>
	<td align='center'>Rank</td>
	<td align='center'>Mobster</td>
	<td align='center'>Level</td>
	<td align='center'>Money</td>
	<td align='center'>Gang</td>
	<td align='center'>Online</td>
</tr>

<?php
$view = ($_GET['view'] != "") ? $_GET['view'] : 'exp';
$view = ($_GET['view'] != "") ? $_GET['view'] : 'strength';
$view = ($_GET['view'] != "") ? $_GET['view'] : 'defense';
$view = ($_GET['view'] != "") ? $_GET['view'] : 'speed';

$result = mysql_query("SELECT * FROM `grpgusers` ORDER BY `".$view."` DESC LIMIT 50");
$rank = 0;
while($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$rank++;
$user_hall = new User($line['id']);

echo "
<tr>
	<td>".$rank."</td>
	<td>".$user_hall->formattedname."</td>
	<td>".$user_hall->level."</td>
	<td>$ ".$user_hall->money."</td>
	<td>".$user_hall->formattedgang."</td>
	<td>".$user_hall->formattedonline."</td>
</tr>
</td></tr>";
 }

include (DIRNAME(__FILE__) . '/footer.php');
?>
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...