Изписва ми в сайта, когато дам в Rankings->devilsquare/bloodcastle rankings-Couldnt connect to Sql server.А при другите статистики за герой,гилдии,убийства и др си работи (демек Муонлайн датабейса се връзва нормално). Но явно има проблем със ранкинг датабейса.
Ето и devilsquare.php :
<?
require("./config.php");
if($web['connection']=='mssql'){
$db = 'mssql';
$connect_mssql = mssql_connect($web['dbhost'],$web['dbuser'],$web['dbpassword'],Ranking);
if (!$connect_mssql) die("Couldn't connect to SQL Server");
}
$query = "SELECT top 20 charactername,class,point,class from event_info order by Point desc";
$result = mssql_query($query);
echo '
<center>
<table class="news-head" width="70%" align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td><b><font color="#996600">Category</b>:</font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=rankings"> Characters Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=devilsquare"> Devil Square Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=bloodcastle"> Blood Castle Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=guilds"> Guild Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=pk"> PK Rankings</a></font></td></tr>
</tbody></table><br><br>
<table height=0 cellspacing=1 cellpadding=1 width=450 border=0 bordercolor=DarkGray>';
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
if($row[2]==NULL){$row[2]="0";}
$rank = $i+1;
if($row[1]==0){$cl='Dark Wizard';}
elseif($row[1]==1){$cl='Soul Master';}
elseif($row[1]==2){$cl='Grand Master';}
elseif($row[1]==16){$cl='Dark Knight';}
elseif($row[1]==17){$cl='Blade Knight';}
elseif($row[1]==18){$cl='Blade Master';}
elseif($row[1]==19){$cl='Blade Master';}
elseif($row[1]==32){$cl='Elf';}
elseif($row[1]==33){$cl='Muse Elf';}
elseif($row[1]==34){$cl='High Elf';}
elseif($row[1]==48){$cl='Magic Gladiator';}
elseif($row[1]==49){$cl='Duel Master';}
elseif($row[1]==64){$cl='Dark Lord';}
elseif($row[1]==65){$cl='Lord Emperor';}
elseif($row[1]==66){$cl='Lord Emperor';}
elseif($row[1]==80){$cl='Summoner';}
elseif($row[1]==81){$cl='Bloody Summoner';}
elseif($row[1]==82){$cl='Dimension Master';}
elseif($row[1]==83){$cl='Dimension Master';}
else{$cl=$row[1];}
if($row[3]==0){$pic='<img src=images/small_dw.png>';}
elseif($row[3]==1){$pic='<img src=images/small_dw.png>';}
elseif($row[3]==2){$pic='<img src=images/small_dw.png>';}
elseif($row[3]==16){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==17){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==18){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==19){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==32){$pic='<img src=images/small_elf.png>';}
elseif($row[3]==33){$pic='<img src=images/small_elf.png>';}
elseif($row[3]==34){$pic='<img src=images/small_elf.png>';}
elseif($row[3]==48){$pic='<img src=images/small_mg.png>';}
elseif($row[3]==49){$pic='<img src=images/small_mg.png>';}
elseif($row[3]==64){$pic='<img src=images/small_dl.png>';}
elseif($row[3]==65){$pic='<img src=images/small_dl.png>';}
elseif($row[3]==66){$pic='<img src=images/small_dl.png>';}
elseif($row[3]==80){$pic='<img src=images/small_sum.png>';}
elseif($row[3]==81){$pic='<img src=images/small_sum.png>';}
elseif($row[3]==82){$pic='<img src=images/small_sum.png>';}
elseif($row[3]==83){$pic='<img src=images/small_sum.png>';}
else{$pic=$row[3];}
echo "
<tr><td class='news-head' rowspan='2' width='50'><table style='border='0' cellpadding='0' cellspacing='0'>$pic</table></td><td class='news-head' align='center'>
Name</td><td class='news-head' align='center'>
Class </td><td class='news-head' align='center'>
Score </td><td class='news-head' align='center'>
Rank </td></tr><tr><td class='news-rest' align='center'>
<font color=white>$row[0]</font></td><td class='news-rest' align='center'>
$cl</td><td class='news-rest' align='center'>
$row[2]</td>
<td class='news-rest' align='center'>
$rank</td></tr>";
}
echo "</table>";
?>
</table>
Това е config.php
<?
if (eregi("inc/config.php", $_SERVER['SCRIPT_NAME'])) { header("Location: index.php"); }
//Sql server detailes
error_reporting(E_ALL ^E_NOTICE ^E_WARNING);
$web['connection'] = 'mssql';
$web['dbhost'] = '127.0.0.1';
$web['database'] = 'MuOnline';
$web['dbuser'] = 'sa';
$web['dbpassword'] = '731216';
$dbc = mssql_connect($web['dbhost'], $web['dbuser'], $web['dbpassword']) or die("Couldn't connect to SQL Server!");
$selected = mssql_select_db($web['database'],$dbc) or die("Couldn't open database");
//Reset Settings (Keep Stats, Keep Skills & Keep Inventory Items)
//See files clear_reset_do.php in modules foldier
//PK Settings
//See files clear_pk_do.php in modules foldier
// Website config settings
$web['title'] = 'SozopolMu'; // Website title
$web['vote'] = 'http://votelink.com/'; // Vote link
//DownLoad settings
$web['client1desc'] = '<b>SozopolMu Client [65mb]</b><b><font color="white" size="+3">V Clienta nqma virus!Ako otchete virus sprete si antivirusnata!</font></br> '; // Client 1 Description
$web['client1link'] = 'http://www.4shared.com/rar/vS9rdDN_/SozopolMu.html
'; // Client 1 link
$web['client2desc'] = '<b>Sounds [75mb]</b> '; // Client 2 Description
$web['client2link'] = 'http://www.4shared.com/rar/BfnADoew/Sounds.html?'; // Client 2 link
//Setings for statistics
$web['servername'] = "SozopolMu"; // Server name
$web['serverversion'] = "98r"; // Server Version here
$web['exp'] = "100x"; // Server xp
$web['drop'] = "50%"; // Server drop
?>
Ето и devilsquare.php :
<?
require("./config.php");
if($web['connection']=='mssql'){
$db = 'mssql';
$connect_mssql = mssql_connect($web['dbhost'],$web['dbuser'],$web['dbpassword'],Ranking);
if (!$connect_mssql) die("Couldn't connect to SQL Server");
}
$query = "SELECT top 20 charactername,class,point,class from event_info order by Point desc";
$result = mssql_query($query);
echo '
<center>
<table class="news-head" width="70%" align="center" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td><b><font color="#996600">Category</b>:</font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=rankings"> Characters Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=devilsquare"> Devil Square Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=bloodcastle"> Blood Castle Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=guilds"> Guild Rankings</a></font></td></tr>
<tr><td></td><td><font color="#996600">»<a href="?id=pk"> PK Rankings</a></font></td></tr>
</tbody></table><br><br>
<table height=0 cellspacing=1 cellpadding=1 width=450 border=0 bordercolor=DarkGray>';
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
if($row[2]==NULL){$row[2]="0";}
$rank = $i+1;
if($row[1]==0){$cl='Dark Wizard';}
elseif($row[1]==1){$cl='Soul Master';}
elseif($row[1]==2){$cl='Grand Master';}
elseif($row[1]==16){$cl='Dark Knight';}
elseif($row[1]==17){$cl='Blade Knight';}
elseif($row[1]==18){$cl='Blade Master';}
elseif($row[1]==19){$cl='Blade Master';}
elseif($row[1]==32){$cl='Elf';}
elseif($row[1]==33){$cl='Muse Elf';}
elseif($row[1]==34){$cl='High Elf';}
elseif($row[1]==48){$cl='Magic Gladiator';}
elseif($row[1]==49){$cl='Duel Master';}
elseif($row[1]==64){$cl='Dark Lord';}
elseif($row[1]==65){$cl='Lord Emperor';}
elseif($row[1]==66){$cl='Lord Emperor';}
elseif($row[1]==80){$cl='Summoner';}
elseif($row[1]==81){$cl='Bloody Summoner';}
elseif($row[1]==82){$cl='Dimension Master';}
elseif($row[1]==83){$cl='Dimension Master';}
else{$cl=$row[1];}
if($row[3]==0){$pic='<img src=images/small_dw.png>';}
elseif($row[3]==1){$pic='<img src=images/small_dw.png>';}
elseif($row[3]==2){$pic='<img src=images/small_dw.png>';}
elseif($row[3]==16){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==17){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==18){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==19){$pic='<img src=images/small_dk.png>';}
elseif($row[3]==32){$pic='<img src=images/small_elf.png>';}
elseif($row[3]==33){$pic='<img src=images/small_elf.png>';}
elseif($row[3]==34){$pic='<img src=images/small_elf.png>';}
elseif($row[3]==48){$pic='<img src=images/small_mg.png>';}
elseif($row[3]==49){$pic='<img src=images/small_mg.png>';}
elseif($row[3]==64){$pic='<img src=images/small_dl.png>';}
elseif($row[3]==65){$pic='<img src=images/small_dl.png>';}
elseif($row[3]==66){$pic='<img src=images/small_dl.png>';}
elseif($row[3]==80){$pic='<img src=images/small_sum.png>';}
elseif($row[3]==81){$pic='<img src=images/small_sum.png>';}
elseif($row[3]==82){$pic='<img src=images/small_sum.png>';}
elseif($row[3]==83){$pic='<img src=images/small_sum.png>';}
else{$pic=$row[3];}
echo "
<tr><td class='news-head' rowspan='2' width='50'><table style='border='0' cellpadding='0' cellspacing='0'>$pic</table></td><td class='news-head' align='center'>
Name</td><td class='news-head' align='center'>
Class </td><td class='news-head' align='center'>
Score </td><td class='news-head' align='center'>
Rank </td></tr><tr><td class='news-rest' align='center'>
<font color=white>$row[0]</font></td><td class='news-rest' align='center'>
$cl</td><td class='news-rest' align='center'>
$row[2]</td>
<td class='news-rest' align='center'>
$rank</td></tr>";
}
echo "</table>";
?>
</table>
Това е config.php
<?
if (eregi("inc/config.php", $_SERVER['SCRIPT_NAME'])) { header("Location: index.php"); }
//Sql server detailes
error_reporting(E_ALL ^E_NOTICE ^E_WARNING);
$web['connection'] = 'mssql';
$web['dbhost'] = '127.0.0.1';
$web['database'] = 'MuOnline';
$web['dbuser'] = 'sa';
$web['dbpassword'] = '731216';
$dbc = mssql_connect($web['dbhost'], $web['dbuser'], $web['dbpassword']) or die("Couldn't connect to SQL Server!");
$selected = mssql_select_db($web['database'],$dbc) or die("Couldn't open database");
//Reset Settings (Keep Stats, Keep Skills & Keep Inventory Items)
//See files clear_reset_do.php in modules foldier
//PK Settings
//See files clear_pk_do.php in modules foldier
// Website config settings
$web['title'] = 'SozopolMu'; // Website title
$web['vote'] = 'http://votelink.com/'; // Vote link
//DownLoad settings
$web['client1desc'] = '<b>SozopolMu Client [65mb]</b><b><font color="white" size="+3">V Clienta nqma virus!Ako otchete virus sprete si antivirusnata!</font></br> '; // Client 1 Description
$web['client1link'] = 'http://www.4shared.com/rar/vS9rdDN_/SozopolMu.html
'; // Client 1 link
$web['client2desc'] = '<b>Sounds [75mb]</b> '; // Client 2 Description
$web['client2link'] = 'http://www.4shared.com/rar/BfnADoew/Sounds.html?'; // Client 2 link
//Setings for statistics
$web['servername'] = "SozopolMu"; // Server name
$web['serverversion'] = "98r"; // Server Version here
$web['exp'] = "100x"; // Server xp
$web['drop'] = "50%"; // Server drop
?>