- Joined
- May 26, 2011
- Messages
- 1,167
- Reaction score
- 235
I have a problem with my ranking script. would you be able to help me?
I test for season 1/2/3/4/5/ but is now show me the character you create but for 97d+99i is work 100% with no problems
Character Table
PHP Script / Ranking
Thanks for help.
I test for season 1/2/3/4/5/ but is now show me the character you create but for 97d+99i is work 100% with no problems
Character Table
PHP:
CREATE TABLE [dbo].[Character](
[AccountID] [varchar](10) NOT NULL,
[Name] [varchar](10) NOT NULL,
[cLevel] [int] NULL,
[LevelUpPoint] [int] NULL,
[Class] [tinyint] NULL,
[Experience] [int] NULL,
[Strength] [int] NULL,
[Dexterity] [int] NULL,
[Vitality] [int] NULL,
[Energy] [int] NULL,
[Leadership] [int] NULL,
[Inventory] [varbinary](1728) NULL,
[MagicList] [varbinary](180) NULL,
[Money] [int] NULL,
[Life] [real] NULL,
[MaxLife] [real] NULL,
[Mana] [real] NULL,
[MaxMana] [real] NULL,
[BP] [real] NULL,
[MaxBP] [real] NULL,
[Shield] [real] NULL,
[MaxShield] [real] NULL,
[MapNumber] [smallint] NULL,
[MapPosX] [smallint] NULL,
[MapPosY] [smallint] NULL,
[MapDir] [tinyint] NULL,
[PkCount] [int] NULL,
[PkLevel] [int] NULL,
[PkTime] [int] NULL,
[MDate] [smalldatetime] NULL,
[LDate] [smalldatetime] NULL,
[CtlCode] [tinyint] NULL,
[DbVersion] [tinyint] NULL,
[Quest] [varbinary](50) NULL,
[ChatLimitTime] [smallint] NULL,
[FruitPoint] [int] NULL,
[EffectList] [varbinary](208) NULL,
[FruitAddPoint] [int] NOT NULL,
[FruitSubPoint] [int] NOT NULL,
[ResetCount] [int] NOT NULL,
[MasterResetCount] [int] NOT NULL,
[resetsWeek] [int] NOT NULL,
[resetsMonth] [int] NOT NULL,
[PkCountWeb] [int] NOT NULL,
[Resets] [int] NOT NULL,
[MResets] [int] NOT NULL,
[image] [varchar](50) NULL,
[MasterResetDay] [int] NOT NULL,
[MasterResetWek] [int] NOT NULL,
[MasterResetMon] [int] NOT NULL,
[PkCountWebHero] [int] NOT NULL,
[HeroDay] [int] NOT NULL,
[HeroWeek] [int] NOT NULL,
[HeroMonth] [int] NOT NULL,
[PKDay] [int] NOT NULL,
[PKWeek] [int] NOT NULL,
[PKMonth] [int] NOT NULL,
[ResetDay] [int] NOT NULL,
[ResetWek] [int] NOT NULL,
[ResetMon] [int] NOT NULL,
[OnlineHourDay] [int] NOT NULL,
[OnlineHourWek] [int] NOT NULL,
[OnlineHourMon] [int] NOT NULL,
[OnlineHour] [int] NOT NULL,
PHP Script / Ranking
PHP:
<?php
$page2 = clean_var($_GET['page']);
$mode = clean_var($_GET['mode']);
$class = clean_var($_GET['class']);
//Decode Class Mode
if($class == '') { $classmode = ""; }
elseif($class == 0) { $classmode = "WHERE Class='0'"; }
elseif($class == 1) { $classmode = "WHERE Class='1'"; }
elseif($class == 16) { $classmode = "WHERE Class='16'"; }
elseif($class == 17) { $classmode = "WHERE Class='17'"; }
elseif($class == 32) { $classmode = "WHERE Class='32'"; }
elseif($class == 33) { $classmode = "WHERE Class='33'"; }
elseif($class == 48) { $classmode = "WHERE Class='48'"; }
if ($mode == '')
{
$search = "SELECT * FROM Character $classmode where ctlcode ='0' order by GrandResets desc,Resets desc,cLevel desc";
}
if ($mode == 5) {
if($classmode !='') { $classmode = str_replace('WHERE','AND',$classmode); }
$search = "SELECT Character.TOP $limit,MEMB_STAT.ServerName FROM AccountCharacter,MEMB_STAT,Character WHERE MEMB_STAT.ConnectStat=1 AND AccountCharacter.Id=MEMB_STAT.memb___id AND Character.AccountID=MEMB_STAT.memb___id AND AccountCharacter.GameIDC=Character.Name $classmode ORDER by GrandResets desc,Resets desc,cLevel desc ";}
$msquery = "$search";
$msresults= mssql_query($msquery);
$lines = '100';
if(!isset($_GET['pages']))
{
$limit='0';
}
else
{
$page = secure($_GET['pages']);
$pages = $page - 1;
$limit = $lines * $pages;
}
echo '
<table class=tmem border=0 cellspacing=1 height=10 width=500>
<td> <b><center>#</center></b></font></td>
<td> <b><center>Name</center></b></font></td>
<td> <b><center>LVL</center></b></font></td>
<td> <b><center>RR</center></b></font></td>
<td> <b><center>GR</center></b></font></td>
<td> <b><center>Class</center></b></font></td>
<td> <b><center>Rank</center></b></font></td>
<td> <b><center>Guild</center></b></font></td>
<td> <b><center>Status</center></b></font></td>
';
if($page == '') { $page = 1; }
$RowPerPage = 100;
$startRows = ($page-1)*$RowPerPage + 0;
$msquery = "$search";
$msresults= mssql_query($msquery);
$num_of_rows = mssql_num_rows ($msresults);
@mssql_data_seek($msresults, $startRows);
$total_pages = ceil($num_of_rows / $RowPerPage);
;
for($i=0; $i<$RowPerPage; $i++) {
$row = mssql_fetch_array($msresults);
$connect = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$row[AccountID]'");
$conn = mssql_fetch_array($connect);
$querys = mssql_query("SELECT * FROM AccountCharacter WHERE id='$row[AccountID]'");
$rows = mssql_fetch_array($querys);
$guild_mem = mssql_query("SELECT * FROM GuildMember WHERE name='$row[Name]'");
$guild = mssql_fetch_array($guild_mem);
$guild_info = mssql_query("SELECT * FROM Guild WHERE g_name='$guild[G_Name]'");
$guilds = mssql_fetch_array($guild_info);-
$memb = mssql_query("SELECT COUNT(*) FROM GuildMember WHERE G_Name='$guild[G_Name]'");
$totalmemb = mssql_result($memb, 0, 0);
$rank = $i+1+$limit;
;
if($conn['ConnectStat'] == 1 AND $rows['GameIDC'] == $row['Name']) { $status ='<img src="http://demonumu.sytes.net/images/on.gif">'; }
else { $status='<img src="http://demonumu.sytes.net/images/off.gif">'; }
//Class
if ($row[IsVip] == 0) { $acceslevel = "Normal"; }
if ($row[IsVip] == 1) { $acceslevel = "<font color='green'>VIP</font>"; }
if ($row['Class'] == 0) { $classes = "Dark Wizzard"; }
if ($row['Class'] == 1) { $classes = "Soul Master"; }
if($row['Class'] == 3) { $classes = "Grand Master"; }
if($row['Class'] == 16) { $classes = "Dark Knight"; }
if($row['Class'] == 17) { $classes = "Blade Knight"; }
if($row['Class'] == 19) { $classes = "Blade Master"; }
if($row['Class'] == 32) { $classes = "Elf"; }
if($row['Class'] == 33) { $classes = "Muse Elf"; }
if($row['Class'] == 34) { $classes = "High Elf"; }
if($row['Class'] == 48) { $classes = "Magic Gladiator"; }
if($row['Class'] == 50) { $classes = "Duel Master"; }
if($row['Class'] == 64) { $classes = "Dark Lord"; }
if($row['Class'] == 66) { $classes = "Lord Emporer"; }
if($row['Class'] == 80) { $classes = "Summoner"; }
if($row['Class'] == 81) { $classes = "Bloody Summoner"; }
if($row['Class'] == 82) { $classes = "Dimension Master"; }
if ($rank == 1) {
$row['Name'] = "<font color=red>$row[Name]</font>";
$rank = "<font color=red>$rank</font>";
$row['cLevel'] = "<font color=red>$row[cLevel]</font>";
$row['Resets'] = "<font color=red>$row[Resets]</font>";
$row['GrandResets'] = "<font color=red>$row[GrandResets]</font>";
$classes = "<font color=red>$classes</font>";
$guilds['G_Name'] = "<font color=red>$guilds[G_Name]</font>";
$acceslevel = "<font color=red>$acceslevel</font>";
}
if ($rank == 2) {
$row['Name'] = "<font color=blue>$row[Name]</font>";
$rank = "<font color=blue>$rank</font>";
$row['cLevel'] = "<font color=blue>$row[cLevel]</font>";
$row['Resets'] = "<font color=blue>$row[Resets]</font>";
$row['GrandResets'] = "<font color=blue>$row[GrandResets]</font>";
$classes = "<font color=blue>$classes</font>";
$guilds['G_Name'] = "<font color=blue>$guilds[G_Name]</font>";
$acceslevel = "<font color=blue>$acceslevel</font>";
}
if ($rank == 3) {
$row['Name'] = "<font color=green>$row[Name]</font>";
$rank = "<font color=green>$rank</font>";
$row['cLevel'] = "<font color=green>$row[cLevel]</font>";
$row['Resets'] = "<font color=green>$row[Resets]</font>";
$row['GrandResets'] = "<font color=green>$row[GrandResets]</font>";
$classes = "<font color=green>$classes</font>";
$guilds['G_Name'] = "<font color=green>$guilds[G_Name]</font>";
$acceslevel = "<font color=green>$acceslevel</font>";
}
if($guilds['G_Name']==NULL) { $guilds['G_Name'] = '<font color="silver">-</font>'; $link =""; } else { $link ="<a href='?op=guild&guild=".htmlspecialchars($guilds['G_Name'])."'>"; }
if(!$row){ break; }
echo "<tr cellpadding='2' cellspacing='1' >
<td align=center><b><center>$rank</center></b></font></td>
<td align=center><b><center>$row[Name]</a></center></b></font></td>
<td align=center><b><center>$row[cLevel]</center></b></td>
<td align=center><b><center>$row[Resets]</center></b></td>
<td align=center><b><center>$row[GrandResets]</center></b></td>
<td align=center><b><center>$classes</center></b></td>
<td align=center><b><center>$acceslevel</center></b></td>
<td align=center><b><center>$guilds[G_Name]</center></b></td>
<td align=center><b><center>$status</center></b></td>
</tr>
";
}
?>
</table>
<?php
if(!isset($_GET['pages'])) { $page = '1'; }
$result1 = 1+$limit;
$result2 = $result1+$lines-1;
$count = mssql_query("Select count(*) From Character");
$resultyeah = mssql_result($count, 0, 0);
$next = $page + 1;
$prev = $page - 1;
if($resultyeah > $result2) { $nextpage = " <a href='index.php?page=ranking&pages=$next' title='Next Page'>-> </a> "; }
if($page >= "2") { $prevpage = "<a href=index.php?page=ranking&pages=$prev title='Previous Page'><- </a> "; }
echo"
<table class=tmem border=0 cellspacing=0 height=10 width=500>
<tr>
<td> <b>
$prevpage [$page || <b>$result1-$result2</b>] <span class='text-information'>$nextpage</span>
</td>
</tr>
</table></br>
";
?>
Thanks for help.
Last edited: