jamiee Posted September 23, 2009 Posted September 23, 2009 ::::::::::: Leaderboard ::::::::::::: Screenshot: http://i795.photobucket.com/albums/yy238/devtek_solutions/Leaderboard.jpg Add the following to the "login" SQL table: If value does not equal 0 the affected users will not show up. [mysql]`staff` int(11) NOT NULL DEFAULT '0',[/mysql] Add the following code to leaderboard.php: <?php require("top.php"); ?> <? require("usercheck.php"); require("prison_check.php"); ?> <form method="post"> <table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table"> <tr> <td colspan="3" align="left" class="head">Top 10 Ranked Players: </td> </tr> <tr> <td width="150" align="left" class="sub">Name:</td> <td width="150" align="left" class="sub">Rank:</td> <td width="250" align="left" class="sub">Gang:</td> </tr> <? $result = mysql_query("SELECT name,gang,exp,rank FROM login WHERE staff='0' AND sitestate='0' ORDER BY exp + 0 DESC LIMIT 0,10") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table ?> <tr> <td width="150" align="left" class="cell"><?php echo "<a href=\"view_profile.php?name=". $row['name'] ."\" onFocus=\"if(this.blur)this.blur()\">".$row['name']."</a>"; ?></td> <td width="150" align="left" class="cell"><?php echo $rank_array[$row['rank']]; ?></td> <td width="250" align="left" class="cell"><?php if(empty($row['gang'])){ echo "No Gang."; }else{ echo "<a href=\"view_gang.php?name=". $row['gang'] ."\" onFocus=\"if(this.blur)this.blur()\" >".$row['gang']."</a>"; }?></td> </tr> <?php } // while ?> </table> <table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table"> <tr> <td colspan="3" align="left" class="head">Top 10 wealthiest Players: </td> </tr> <tr> <td width="150" align="left" class="sub">Name:</td> <td width="150" align="left" class="sub">Wealth:</td> <td width="250" align="left" class="sub">Gang:</td> </tr> <? $result = mysql_query("SELECT money,name,gang FROM login WHERE staff='0' AND sitestate='0' ORDER BY money + 0 DESC LIMIT 0,10") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table ?> <tr> <td width="150" align="left" class="cell"><?php echo "<a href=\"view_profile.php?name=". $row['name'] ."\" onFocus=\"if(this.blur)this.blur()\">".$row['name']."</a>"; ?></td> <td width="150" align="left" class="cell"><?php if($row['money'] >= 0 ){ $profile_wealth = $wealth_array[0];} if($row['money'] >= 25000 ){ $profile_wealth = $wealth_array[1];} if($row['money'] >= 50000 ){ $profile_wealth = $wealth_array[2];} if($row['money'] >= 100000 ){ $profile_wealth = $wealth_array[3];} if($row['money'] >= 250000 ){ $profile_wealth = $wealth_array[4];} if($row['money'] >= 500000 ){ $profile_wealth = $wealth_array[5];} if($row['money'] >= 1000000 ){ $profile_wealth = $wealth_array[6];} if($row['money'] >= 10000000 ){ $profile_wealth = $wealth_array[7];} if($row['money'] >= 1000000000 ){ $profile_wealth = $wealth_array[8];} if($row['money'] >= 10000000000 ){ $profile_wealth = $wealth_array[9];} echo $profile_wealth; ?></td> <td width="250" align="left" class="cell"><?php if(empty($row['gang'])){ echo "No Gang."; }else{ echo "<a href=\"view_gang.php?name=". $row['gang'] ."\" onFocus=\"if(this.blur)this.blur()\" >".$row['gang']."</a>"; }?></td> </tr> <?php } // while ?> </table> </p> </form> <?php require("bottom.php"); ?> Add the following to the top.php navigation: Leaderboard Enjoy the free script. :) Quote
ossukoss Posted August 2, 2013 Posted August 2, 2013 Parse error: syntax error, unexpected T_VARIABLE in /home/a5245387/public_html/files/leaderboard.php on line 20 Quote
rockwood Posted August 15, 2013 Posted August 15, 2013 <?php require("top.php"); ?> <?php require("usercheck.php"); require("prison_check.php"); ?> <form method="post"> <table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table"> <tr> <td colspan="3" align="left" class="head">Top 10 Ranked Players:</td> </tr> <tr> <td width="150" align="left" class="sub">Name:</td> <td width="150" align="left" class="sub">Rank:</td> <td width="250" align="left" class="sub">Gang:</td> </tr> <?php $result = mysql_query("SELECT name,gang,exp,rank FROM login WHERE staff='0' AND sitestate='0' ORDER BY exp + 0 DESC LIMIT 0,10") or die(mysql_error()); // keeps getting the next row until there are no more to get while ($row = mysql_fetch_array($result)) { // Print out the contents of each row into a table ?> <tr> <td width="150" align="left" class="cell"><?php echo "<a href=\"view_profile.php?name=" . $row['name'] . "\" onFocus=\"if(this.blur)this.blur()\">" . $row['name'] . "</a>"; ?></td> <td width="150" align="left" class="cell"><?php echo $rank_array[$row['rank']]; ?></td> <td width="250" align="left" class="cell"><?php if (empty($row['gang'])) { echo "No Gang."; } else { echo "<a href=\"view_gang.php?name=" . $row['gang'] . "\" onFocus=\"if(this.blur)this.blur()\" >" . $row['gang'] . "</a>"; }?></td> </tr> <?php } // while ?> </table> <table width="550" border="0" align="center" cellpadding="0" cellspacing="2" class="table"> <tr> <td colspan="3" align="left" class="head">Top 10 wealthiest Players:</td> </tr> <tr> <td width="150" align="left" class="sub">Name:</td> <td width="150" align="left" class="sub">Wealth:</td> <td width="250" align="left" class="sub">Gang:</td> </tr> <?php $result = mysql_query("SELECT money,name,gang FROM login WHERE staff='0' AND sitestate='0' ORDER BY money + 0 DESC LIMIT 0,10") or die(mysql_error()); // keeps getting the next row until there are no more to get while ($row = mysql_fetch_array($result)) { // Print out the contents of each row into a table ?> <tr> <td width="150" align="left" class="cell"><?php echo "<a href=\"view_profile.php?name=" . $row['name'] . "\" onFocus=\"if(this.blur)this.blur()\">" . $row['name'] . "</a>"; ?></td> <td width="150" align="left" class="cell"><?php if ($row['money'] >= 0) { $profile_wealth = $wealth_array[0]; } if ($row['money'] >= 25000) { $profile_wealth = $wealth_array[1]; } if ($row['money'] >= 50000) { $profile_wealth = $wealth_array[2]; } if ($row['money'] >= 100000) { $profile_wealth = $wealth_array[3]; } if ($row['money'] >= 250000) { $profile_wealth = $wealth_array[4]; } if ($row['money'] >= 500000) { $profile_wealth = $wealth_array[5]; } if ($row['money'] >= 1000000) { $profile_wealth = $wealth_array[6]; } if ($row['money'] >= 10000000) { $profile_wealth = $wealth_array[7]; } if ($row['money'] >= 1000000000) { $profile_wealth = $wealth_array[8]; } if ($row['money'] >= 10000000000) { $profile_wealth = $wealth_array[9]; } echo $profile_wealth;?> </td> <td width="250" align="left" class="cell"><?php if (empty($row['gang'])) { echo "No Gang."; } else { echo "<a href=\"view_gang.php?name=" . $row['gang'] . "\" onFocus=\"if(this.blur)this.blur()\" >" . $row['gang'] . "</a>"; }?></td> </tr> <?php } // while ?> </table> </p> </form> <?php require("bottom.php"); ?> try now Quote
KyleMassacre Posted July 18, 2023 Posted July 18, 2023 2 minutes ago, omarka said: where to add it can u tell me please Just to be sure, are you using GLv1 or GLv2? This module was written for V1 which is not compatible with V2 Quote
KyleMassacre Posted July 18, 2023 Posted July 18, 2023 17 minutes ago, omarka said: owhh sry am using v2 Yup, that could be the problem lol Quote
ags_cs4 Posted July 18, 2023 Posted July 18, 2023 9 hours ago, KyleMassacre said: Just to be sure, are you using GLv1 or GLv2? This module was written for V1 which is not compatible with V2 i worked on gl v1 and this is not even gl some random engine i think Quote
KyleMassacre Posted July 18, 2023 Posted July 18, 2023 12 minutes ago, ags_cs4 said: i worked on gl v1 and this is not even gl some random engine i think I'm pretty sure its V1. Jamie used to work on that engine a lot back in the day and the "top.php" gives it away for me. Quote
ags_cs4 Posted July 18, 2023 Posted July 18, 2023 1 hour ago, KyleMassacre said: I'm pretty sure its V1. Jamie used to work on that engine a lot back in the day and the "top.php" gives it away for me. tbh it could be the early version, as the v1 i used to play with was lot similar to gl v2 is the structure of the modules 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.