-яaкi- GamersAdmin
Posts : 16 Join date : 2010-07-03
| Subject: Guild Ranking Script Mon Jul 05, 2010 4:43 am | |
| PHP Code: - Spoiler:
<?php //This script made by TheUnreal. Released for Ragezone. -->Say thanks! //Connect the database $connect = mssql_connect("localhost","sa","PASSWORD"); //Set the number of guilds to show below $num = "5"; ?> <h1>Guild ranking - Top <?php echo $num;?> guilds</h1><hr /><br /> <?php //Created by TheUnreal echo '<div align="center"><table width="100%" border="1" bgcolor="#EEEEEE" style="text-align:center;">'; echo '<td width="5%" bgcolor="#FFFFFF"><b>Rank'; echo '<td width="25%" bgcolor="#FFFFFF"><b>Name'; echo '<td width="25%" bgcolor="#FFFFFF"><b>Level'; echo '<td width="25%" bbgcolor="#FFFFFF"><b>Leader'; echo'</tr>'; $rank=1; mssql_select_db("CHARACTER_01_DBF"); $getguilds = mssql_query('SELECT TOP '.$num.' * FROM GUILD_TBL ORDER BY m_nLevel DESC'); while ($consulta = mssql_fetch_assoc($getguilds)) { $guildid = $consulta['m_idGuild']; $getleader = mssql_query('SELECT m_idPlayer FROM GUILD_MEMBER_TBL WHERE m_idGuild = "'.$guildid.'" AND m_nMemberLv = "0"'); while ($leaderid = mssql_fetch_assoc($getleader)) { $uid = $leaderid['m_idPlayer']; } $getname = mssql_query('SELECT m_szName FROM CHARACTER_TBL WHERE m_idPlayer = "'.$uid.'"'); while ($leadername = mssql_fetch_assoc($getname)) { $leader = $leadername['m_szName']; } echo '<tr><td bgcolor="#FFF0F0">'.$rank.'</td>'; echo '<td bgcolor="#FFF0F0"><a href="?page=viewguild&guild='.$consulta['m_szGuild'].'">'.$consulta['m_szGuild'].'</a></td>'; echo '<td bgcolor="#FFF0F0">'.$consulta['m_nLevel'].'</td>'; echo '<td bgcolor="#FFF0F0">'.$leader.'</td></tr>'; $rank++; } //Ragezone ?> </table>
Credits to : theunreal from ragezone | |
|