Скрипты для сайта/панели и пр.

Перейти вниз

Скрипты для сайта/панели и пр.

Сообщение  Admin в Пн Дек 06, 2010 11:34 pm

Онлаин игроков.
Код:

<?
$file = file ("c:\RF_Server\SystemSave\ServerDisplay.ini");
foreach($file as $line)
{
if(strspn($line, "[") != 1)
parse_str($line);
}

function statuscheck($serverip, $port) {
$sockres = @fsockopen($serverip, $port, $errno, $errstr, 1);
if (!$sockres) {
return "<img src=/images/off.gif>";
} else {
@fclose($sockres);
return "<img src=/images/on.gif>";
}
}

//MSSQL settings

$dbuser = 'sa';
$dbpasswd = '******'; // пароль к базе
$base = "RF_WORLD";
$dbhost = "127.0.0.1\SQLEXPRESS,61433";

$conn=mssql_connect($dbhost,$dbuser,$dbpasswd);
$selected=mssql_select_db('RF_World', $conn);


$query ='SELECT t1.Name,t1.Lv, t1.Serial,t2.PvpPoint,t2.[Kill],t2.Death,t3.OnlineStatus,t3.Map
FROM tbl_base AS t1, tbl_pvporderview AS t2, tbl_general AS t3
WHERE t1.Serial = t2.Serial and t2.Serial = t3.Serial and DeleteName = "*" and AccountSerial < "2000000000" and t3.OnlineStatus>=dateadd(minute,-5,getdate())
ORDER BY t2.PvpPoint DESC, t1.Lv desc';


$query2 ='SELECT t1.Name,t1.Lv, t1.Serial,t2.PvpPoint,t2.[Kill],t2.Death,t3.OnlineStatus
FROM tbl_base AS t1, tbl_pvporderview AS t2, tbl_general AS t3
WHERE t1.Serial = t2.Serial and t2.Serial = t3.Serial and DeleteName = "*" and AccountSerial < "2000000000" and t3.OnlineStatus>=dateadd(minute,-5,getdate())
ORDER BY t2.PvpPoint DESC, t1.Lv desc';

//$result=mssql_query("SELECT TOP 50 Serial,TotalPlayMin,PvpPoint,GuildSerial FROM Rf_world.dbo.tbl_general where OnlineStatus>=dateadd(minute,-5,getdate())ORDER BY PvpPoint DESC");
$result = mssql_query($query);
$result2 = mssql_query($query2);

$top_pvp_users=array();
for($x=0;$top_pvp_users[$x]=mssql_fetch_assoc($result2);$x++)
echo '
<p>';
echo "
<p>\n";
echo "\n";

echo '
<p>';
echo '<font face=Lucinda>';
echo '<center><table border=2 border-style= solid bordercolor=lime cellSpacing=0 align=center';
echo '<tr><td width="100" ><center><font face=Lucinda size=2 color=#768a62><b>Кора</td></b><td width="100" ><center><font face=Lucinda size=2 color=#aa9286><b>Акретия</td><td width="100" ><center><font face=Lucinda size=2 color=#768a62><b>Беллато</td></b></font>';

{
echo '<tr><td width=100 ><center><font face=Lucinda size=2 color=#86b2ba>';
echo $C_Num;
echo '</font></td><td width=100><center><font face=Lucinda size=2 color=#86b2ba><b><tb>';
echo $A_Num;
echo '</font></td><td width=100 ><center><font face=Lucinda size=2 color=#86b2ba><b><tb>';
echo $B_Num;
}

echo '</table>';
echo '';
echo '
<p>';

echo '
<p>';
echo '<font face=Lucinda>';
echo '<center><table border=2 border-style= solid bordercolor=lime cellSpacing=0 align=center';
echo '<tr><td width="100" ><center><font face=Lucinda size=2 color=#768a62>Место</td><td><font face=Lucinda size=2 color=#aa9286><b>Ник</td><td><font face=Lucinda size=2 color=#768a62><b>Очки PvP</td><td><font face=Lucinda size=2 color=#aa9286><b>Kill</td><td><font face=Lucinda size=2 color=#768a62><b>Уровень</a></td></b></font>';



for($i=0;$i < count($top_pvp_users)-1;++$i)
{
$row = mssql_fetch_row($result);

echo '<tr><td width=100 ><center><font face=Lucinda size=2 color=#86b2ba>';
echo $i + 1;
echo '</font></td><td width=100><font face=Lucinda size=2 color=#86b2ba><b><tb>';
echo $row[0];
echo '</font></td><td width=100 ><font face=Lucinda size=2 color=#86b2ba><b><tb>';
echo (int)$row[3];
echo '</font></td><td width=100 ><font face=Lucinda size=2 color=#86b2ba><b><tb>';
echo $row[4];


echo '</b></font></td><td width=100 ><b><font face=Lucinda size=2 color=#86b2ba>';
echo $row[1];
echo'</td></tr>';

echo '<tr><td height=1></td><td></td><td ></td><td ></td><td><td ><td ></td>';
}
echo '</table>';
echo '';
echo '
<p>';

echo '';
echo '';
echo '<br>';

$conn=mssql_close();
?>

Открываем базу и выполняем скрипт
Код:

ALTER TABLE [dbo].[tbl_general] ADD [OnlineStatus] datetime CONSTRAINT [DF_tbl_base_OnlineStatus] DEFAULT 0 NOT NULL GO CREATE TRIGGER [dbo].[OnlineСheck] ON [dbo].[tbl_general] FOR INSERT, UPDATE AS BEGIN SET NOCOUNT ON; IF UPDATE(TotalPlayMin) UPDATE tbl_general SET tbl_general.OnlineStatus = GETDATE() FROM tbl_general INNER JOIN inserted ON tbl_general.Serial = inserted.Serial END GO

Статус сервера.
Код:

<?php
$serverip = "127.0.0.1"; # ВАШ IP
$online='<font color="green">Online</font>';
$offline='<font color="red">Offline</font>';

function statuscheck($serverip, $port) {
$sockres = @fsockopen($serverip, $port, $errno, $errstr, 1);
if (!$sockres) {
return $offline;;
} else {
@fclose($sockres);
return $online;
}
}
echo "Login Server: ". statuscheck($serverip, "10001");
echo "<br>World Server: " . statuscheck($serverip, "27780");
?>

Скрипт показа Гильдий.
Код:

<?
$sql_user = 'логин';
$sql_pwd = 'пасс';
$base = "rf_world";
$host = "127.0.0.1";


$conn=mssql_connect($host,$sql_user,$sql_pwd) or die("<center><b>Критическая ошибка</b><br>Невозможно подключиться к базе<br><br><a href=register.php><img src=retour.jpg border=0></a></center>");

@mssql_select_db($base, $conn) or die("<center><b>Критическая ошибка</b><br>База не существует, либо нет доступа<br><br><a href=register.php><img src=retour.jpg border=0></a></center>");


$result=mssql_query("SELECT top 50 id,Race,MemberCount,Grade,CreateDt FROM tbl_Guild ORDER BY MemberCount DESC ");

$g=0;
echo '
<table id=uo border=1 cellpadding=0 cellspacing=0 width="100%" height=15 align=center>
<tr id=uo>
<td id=uo width="3%" align=center><font size=2><font color=#7A6A0C>#</font></td></font>
<td id=uo width="20%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Название</b></font></span></td></font>
<td id=uo width="5%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Уровень</b></font></span></td></font>
<td id=uo width="8%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Раса</b></font></span></td></font>
<td id=uo width="15%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Дата создания</b></font></span></td></font>
<td id=uo width="5%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Кол-во</b></font></span></td></font>
</tr>';

while ($rows=mssql_fetch_array($result))
{
$g++;
if ($rows['Race']=="0")
$Race="Bellato";
if ($rows['Race']=="2")
$Race="Accretia";
if ($rows['Race']=="1")
$Race="Cora";

echo '<tr id=uo>
<td id=uo width=3% align=center><font size=2>'.$g.'</font></td>
<td id=uo width=20% align=center><font size=2>'.htmlspecialchars($rows['id']).'
<td id=uo width=5% align=center><font size=2>'.$rows['Grade'].'
<td id=uo width=8% align=center><font size=2>'.$Race.'
<td id=uo width=15% align=center><font size=2>'.$rows['CreateDt'].'
<td id=uo width=5% align=center><font size=2>'.$rows['MemberCount'];

echo '</font></td>';
}

print "</tr>\n";
print "</tbody>\n</table>\n";

?>
<p>&nbsp;</p>
<p>&nbsp;</p>
<?
ob_end_flush();
?>

Показываем забаненых.
Код:

<?
$sql_user = 'логин'; // SQL ID
$sql_pwd = 'пасс'; // SQL PASSWORD (change it to your password mssql)
$base = "RF_User"; // SQL BASE name (don't change it's by default)
$host = "127.0.0.1"; // SQL HOST (change it to your IP ex : gamenet.perm.ru)

$conn=mssql_connect($dbhost,$dbuser,$dbpasswd) or die("<center><b>Критическая ошибка</b><br>Невозможно подключиться к базе<br></center>");
@mssql_select_db($base, $conn) or die("<center><b>Критическая ошибка</b><br>База не существует, либо нет доступа<br></center>");

if(!isset($_GET['type'])){
$type = "> 1";
} elseif(isset($_GET['type']) && $_GET['type'] == "temporary"){
$type = "< 999";
} elseif(isset($_GET['type']) && $_GET['type'] == "permanent"){
$type = "> 998";
}

$data = mssql_query("SELECT * FROM tbl_UserBan WHERE nPeriod $type ORDER BY dtStartDate DESC") or die('SELECT INVALID');
?>

<table width="100%" border="0" cellspacing="2" cellpadding="1" align="center">
<tr bgcolor="#000000"><td width="15%">Аккаунт</td>
<td width="22%">Начало</td>
<td width="13%">Срок</td>
<td width="13%" align="center">Тип бана</td>
<td width="21%">Причина</td>
<td width="10%">Забанил/Изменил</td>
</tr>
<?
$i = 0;
$c1 = "#000000";
$c2 = "#000000";
while ($row = mssql_fetch_row($data)){

$account_query = mssql_query("SELECT [Name]
FROM [rf_world].[dbo].[tbl_base] WHERE [rf_world].[dbo].[tbl_base].[AccountSerial] = $row[0] and DCK='0'");
$account = mssql_fetch_row($account_query);
if(!empty($account[0])){
$color = (($i % 2) == 0) ? $c1 : $c2 ;
$i++ ;
echo "<tr bgcolor='".$color."'>
<td>$account[0]</td>
<td>$row[1]</td>
<td>";
switch ($row[2]){
case (999):
$period = "бессрочно";
break;

case (336):
$period = "2 недели";
break;

case (168):
$period = "неделя";
break;

case (23):
$period = "сутки";
break;
case (24):
$period = "сутки";
break;
case (12):
$period = "12 часов";
break;
case (6):
$period = "6 часов";
break;
case (1):
$period = "1 час";
break;
}
echo $period;
echo "</td>
<td align="center">";
if($row[3] == 0) {
echo "аккаунт";
}
else echo "чат";
echo "</td>
<td>$row[4]</td>
<td>$row[5]</td>
</tr>";
}
}
?>
</table>

<p>&nbsp;</p>
<p>&nbsp;</p>
<?
ob_end_flush();
?>

Онлайн/офлайн сервера общий онлайн и кол-во онлайн по расам.
Код:

<?
$file = file ("Путь до файла\SystemSave\ServerDisplay.ini");
foreach($file as $line)
{
if(strspn($line, "[") != 1)
parse_str($line);
}

function statuscheck($serverip, $port) {
$sockres = @fsockopen($serverip, $port, $errno, $errstr, 1);
if (!$sockres) {
return "&nbsp;<font color='red'><b>Off-Line</b></font>";
} else {
@fclose($sockres);
return "&nbsp;&nbsp;<font color='green'><b>On-Line</b></font>";
}
}

//Вывод на экран статус сервера и онлайн рас

$serverip = "127,0,0,1";

echo "<b><font size=2 color=#ffffff>";
echo "<div> ";
echo "Логин: " . statuscheck($serverip, "10001");
echo "</div> ";
echo "<div> ";
echo "Сервер:" . statuscheck($serverip, "27780");
echo "</div> ";

echo "<tr><td><b><font size=2 color=#000000>";
echo "<font color=#ffffff> Всего онлайн: &nbsp<font color=lime> $UserNum";
echo "<div> ";
echo "<font color=#ffffff> Accretia: &nbsp<font color=lime> $A_Num";
echo "</div> ";
echo "<div> ";
echo "<font color=#ffffff> Bellato: &nbsp<font color=lime> $B_Num";
echo "</div> ";
echo "<div> ";
echo "<font color=#ffffff> Cora: &nbsp&nbsp<font color=lime> $C_Num";
echo "</div> ";

?>

Удаления автобанов FireGuard
Код:

<?php
$db_host = '127.0.0.1';
$db_user = 'логин';
$db_pass = 'пароль';
$msconnect=mssql_connect("$db_host","$db_user","$db_pass");

function unban()
{
$sql = "DELETE FROM rf_user.dbo.tbl_UserBan WHERE nPeriod = 24";
$res = mssql_query ($sql);
if ($res) $text.="Баны сняты"; else $text.= "Ошибка!";
return $text;
}
echo unban();

Показ текущих патриархов
Код:

<?php
# Private by Freelance Design Center
# Script for GamerGrad Server

define("_HOST_", "localhost");# host
define("_HOSTUSER_", "sa");# login
define("_HOSTPASS_", "");#password
define("_WORLD_", "rf_world");#world
$msconnect=mssql_connect(_HOST_,_HOSTUSER_,_HOSTPASS_);
$res = mssql_query("SELECT * FROM "._WORLD_.".dbo.tbl_racebattle_log ORDER BY idx DESC ");
$row = mssql_fetch_assoc($res);
$resulty1 = mssql_query("SELECT Name FROM "._WORLD_.".dbo.tbl_base WHERE Serial = '".$row[bossserial0]."'");
$Name0 = trim(@MSSQL_RESULT($resulty1,0,"Name"));
$resulty1 = mssql_query("SELECT Name FROM "._WORLD_.".dbo.tbl_base WHERE Serial = '".$row[bossserial1]."'");
$Name1 = trim(@MSSQL_RESULT($resulty1,0,"Name"));
$resulty1 = mssql_query("SELECT Name FROM "._WORLD_.".dbo.tbl_base WHERE Serial = '".$row[bossserial2]."'");
$Name2 = trim(@MSSQL_RESULT($resulty1,0,"Name"));

echo "<p><big>Представители расы</big></p>";
echo "<p>Федерация Беллато: <b>".$Name0.'</b></p>';
echo "<p>Альянс Кора: <b>".$Name1.'</b></p>';
echo "<p>Империя Акретия: <b>".$Name2.'</b></p>';
?>

TOP 30 по PvpPoint и патриархи рас
Код:

<?php
//MSSQL settings

$dbuser = 'пользователь';
$dbpasswd = 'пароль';
$base = "RF_WORLD";
$dbhost = "host";


# Private by Freelance Design Center
# Script for GamerGrad Server

define("_HOST_", "NEXT-A1B874E30F");# host
define("_HOSTUSER_", "sa");# login
define("_HOSTPASS_", "Max619");#password
define("_WORLD_", "rf_world");#world
$msconnect=mssql_connect(_HOST_,_HOSTUSER_,_HOSTPASS_);
$res = mssql_query("SELECT * FROM "._WORLD_.".dbo.tbl_racebattle_log ORDER BY idx DESC ");
$row = mssql_fetch_assoc($res);

$resulty1 = mssql_query("SELECT Name,Lv FROM "._WORLD_.".dbo.tbl_base WHERE Serial = '".$row[bossserial0]."'");
$Name0 = trim(@MSSQL_RESULT($resulty1,0, "Name"));
$Name10 = trim(@MSSQL_RESULT($resulty1,0, "Lv"));

$resulty1 = mssql_query("SELECT Name,Lv FROM rf_world.dbo.tbl_base WHERE Serial = '".$row[bossserial1]."'");
$Name1 = trim(@MSSQL_RESULT($resulty1,0,"Name"));
$Name11 = trim(@MSSQL_RESULT($resulty1,0, "Lv"));

$resulty1 = mssql_query("SELECT Name,Lv FROM "._WORLD_.".dbo.tbl_base WHERE Serial = '".$row[bossserial2]."'");
$Name2 = trim(@MSSQL_RESULT($resulty1,0,"Name"));
$Name12 = trim(@MSSQL_RESULT($resulty1,0, "Lv"));

$resulty1 = mssql_query("SELECT PvpPoint FROM "._WORLD_.".dbo.tbl_pvporderview WHERE Serial = '".$row[bossserial0]."'");
$Name50 = trim(@MSSQL_RESULT($resulty1,0,"PvpPoint"));

$resulty1 = mssql_query("SELECT PvpPoint FROM "._WORLD_.".dbo.tbl_pvporderview WHERE Serial = '".$row[bossserial1]."'");
$Name51 = trim(@MSSQL_RESULT($resulty1,0,"PvpPoint"));

$resulty1 = mssql_query("SELECT PvpPoint FROM "._WORLD_.".dbo.tbl_pvporderview WHERE Serial = '".$row[bossserial2]."'");
$Name52 = trim(@MSSQL_RESULT($resulty1,0,"PvpPoint"));

echo "<font face=Lucinda size=2 font color=#80FF80><p><big>Представители расы</big></p>";
echo "<p>Федерация Беллато: <b>".$Name0. "<b> Lvl:" .$Name10. "<b> PvP:" .(int)$Name50.'</b></p>';
echo "<p>Альянс Кора: <b>".$Name1."<b> Lvl:" .$Name11."<b> PvP:" .(int)$Name51.'</b></p>';
echo "<p>Империя Акретия: <b>".$Name2. "<b> Lvl:" .$Name12."<b> PvP:" .(int)$Name52.'</b></p></font>';




$conn=mssql_connect($dbhost,$dbuser,$dbpasswd);
$selected=mssql_select_db('RF_World', $conn);

$query ='SELECT t1.Name,t1.Class,t1.Lv,t1.Gold, t1.Serial,t2.PvpPoint
FROM tbl_base AS t1, tbl_pvporderview AS t2
WHERE t1.Serial = t2.Serial and DeleteName = "*" and AccountSerial < "2000000000"
ORDER BY t2.PvpPoint DESC, t1.Lv desc';

$result = mssql_query($query);
echo '
<p>';
echo "
<p>\n";
echo "\n";

echo 'Рейтинг по ПвП очкам';

echo '
<p>';
echo '<font face=Lucinda>';
echo '<center><table border=0 cellSpacing=3 align=center';
echo '<tr><td width="120"><center><font face=Lucinda size=2>Место</td><td><font face=Lucinda size=2><b>Игровой ник</td><td><font face=Lucinda size=2><b>Золото</td><td><font face=Lucinda size=2><b>Очки PvP</td><td><font face=Lucinda size=2><b>Класс</td><td><font face=Lucinda size=2><b>Уровень</a></td></b></font>';



for($i=0;$i < 30;++$i)
{
$row = mssql_fetch_row($result);

echo '<tr><td width=120 ><center><font face=Lucinda size=2>';
echo $i + 1;
echo '</font></td><td width=100><font face=Lucinda size=2 color=#FF0013><b><tb>';
echo $row[0];
echo '</font></td><td width=100 ><font face=Lucinda size=2 color=#FF0013><b><tb>';
echo $row[3];
echo '</font></td><td width=100 ><font face=Lucinda size=2 color=#FF0013><b><tb>';
echo (int)$row[5];


echo '</B></font></tb></td><td width=200 ><font face=Lucinda size=2 font >';
if($row[1] == 0){
echo '<font face=Lucinda size=2 font color=#80FF80></font>';
}
if($row[1] == ASB0){
echo 'Accretia Specialist';
}
if($row[1] == CWB0){
echo 'Cora Warrior';
}
if($row[1] == ARS1){
echo 'Accretia Striker';
}
if($row[1] == BWS1){
echo 'Bellato Berserk';
}
if($row[1] == BWF1){
echo 'Bellato Commando';
}
if($row[1] == BWF2){
echo 'Bellato Miller';
}
if($row[1] == BRF1){
echo 'Bellato Diversant';
}
if($row[1] == BRF2){
echo 'Bellato Sniper';
}
if($row[1] == BFF1){
echo 'Bellato Psionik';
}
if($row[1] == BFF2){
echo 'Bellato Magician';
}
if($row[1] == BSF1){
echo 'Bellato Driver';
}
if($row[1] == BSF2){
echo 'Bellato Craftsman';
}
if($row[1] == BWS2){
echo 'Bellato Barbarian';
}
if($row[1] == BWS3){
echo 'Bellato Defender';
}
if($row[1] == BRS1){
echo 'Bellato Observer';
}
if($row[1] == BRS2){
echo 'Bellato Guard';
}
if($row[1] == BRS3){
echo 'Bellato Spy';
}
if($row[1] == BFS1){
echo 'Bellato mag(волшебник)';
}
if($row[1] == BFS2){
echo 'Bellato medium';
}
if($row[1] == BFS3){
echo 'Bellato Wonder(Чудотворец)';
}
if($row[1] == BSS1){
echo 'Bellato Armor Rider';
}
if($row[1] == BSS2){
echo 'Bellato Metal smith';
}
if($row[1] == CRB0){
echo 'Cora Ranger';
}
if($row[1] == AWF1){
echo 'Accretia Destroyer';
}
if($row[1] == AWF2){
echo 'Accretia Gladiator';
}
if($row[1] == ARF1){
echo 'Accretia Canonnair';
}
if($row[1] == ARF2){
echo 'Accretia Spy(лазутчик)';
}
if($row[1] == ASF1){
echo 'Accretia Engineer';
}
if($row[1] == AWS1){
echo 'Accretia Punisher';
}
if($row[1] == AWS2){
echo 'Accretia Hedge-hopper(Штурмовик)';
}
if($row[1] == AWS3){
echo 'Accretia Landsknecht';
}
if($row[1] == ARS2){
echo 'Accretia Dementer';
}
if($row[1] == ARS3){
echo 'Accretia Phantom';
}
if($row[1] == ASF1){
echo 'Accretia Block-mechanic';
}
if($row[1] == ASF2){
echo 'Accretia Leader of block(Лидер звена)';
}

if($row[1] == CFB0){
echo 'Cora Spiritualist';
}
if($row[1] == CWF1){
echo 'Cora Knight';
}
if($row[1] == CWF2){
echo 'Cora Champion';
}
if($row[1] == CRF1){
echo 'Cora Archer';
}
if($row[1] == CRF2){
echo 'Cora Hunter';
}
if($row[1] == CFF1){
echo 'Cora Caster';
}
if($row[1] == CFF2){
echo 'Cora Summoner';
}
if($row[1] == CSF1){
echo 'Cora CraftsMan';
}
if($row[1] == CWS1){
echo 'Cora Templar(храмовник)';
}
if($row[1] == CWS2){
echo 'Cora Keeper';
}
if($row[1] == CWS3){
echo 'Cora Dark Knight';
}
if($row[1] == CRS1){
echo 'Cora Hireling(Наемник)';
}
if($row[1] == CRS2){
echo 'Cora Apostatenator(отступник)';
}
if($row[1] == CRS3){
echo 'Cora Assasin';
}
if($row[1] == CFS1){
echo 'Cora Warlock';
}
if($row[1] == CFS2){
echo 'Cora Dark Priest';
}
if($row[1] == CFS3){
echo 'Cora Grazier';
}
if($row[1] == CSS1){
echo 'Cora Artist';
}
if($row[1] == CSB0){
echo 'Cora Specialist';
}
if($row[1] == BWB0){
echo 'Bellato Warrior';
}
if($row[1] == BRB0){
echo 'Bellato Ranger';
}
if($row[1] == BFB0){
echo 'Bellato Spiritualist';
}
if($row[1] == BSB0){
echo 'Bellato Specialist';
}
if($row[1] == AWB0){
echo 'Accretia Warrior';
}
if($row[1] == ARB0){
echo 'Accretia Ranger';
}
if($row[1] == AFB0){
echo 'Accretia Spiritualist';
}
echo '</b></font></td><td width=60 ><b><font face=Lucinda size=2>';
echo $row[2];
echo'</td></tr>';

echo '<tr><td height=1></td><td></td><td ></td><td ></td><td><td ><td ></td>';
}
echo '</table>';
echo '';
echo '
<p>';

echo '';
echo '';
echo '<br>';

$conn=mssql_close();
?>

TOP 50 Лучших игроков
Код:

<?php
$sql_user = '';
$sql_pwd = '';
$base = "rf_world";
$host = "";


$conn=mssql_connect($host,$sql_user,$sql_pwd) or die("<center><b>Критическая ошибка</b><br>Невозможно подключиться к базе<br><br><a href=register.php><img src=retour.jpg border=0></a></center>");

@mssql_select_db($base, $conn) or die("<center><b>Критическая ошибка</b><br>База не существует, либо нет доступа<br><br><a href=register.php><img src=retour.jpg border=0></a></center>");


$result=mssql_query("SELECT top 50 Name,Lv,Race,Class FROM tbl_base ORDER BY Lv DESC ");

$g=0;
echo '
<table id=uo border=1 cellpadding=0 cellspacing=0 width="100%" height=15 bordercolor=red align=center>
<tr id=uo>
<td id=uo width="3%" align=center><font size=2><font color=#7A6A0C>#</font></td></font>
<td id=uo width="10%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Ник</b></font></span></td></font>
<td id=uo width="5%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Раса</b></font></span></td></font>
<td id=uo width="10%" align=center><span lang="ru"><font size=2><font color=#7A6A0C><b>Класс</b></font></span></td></font>
<td id=uo width="5%" align=center class="sortedColumn"><span lang="ru"><font size=2><font color=#7A6A0C><b>Уровень</b></font></span></td></font>
</tr>';

while ($rows=mssql_fetch_array($result))
{
$g++;
if ($rows['Race']=="0")
$Race="Bellato";
if ($rows['Race']=="2")
$Race="Cora";
if ($rows['Race']=="4")
$Race="Accretia";

if ($rows['Class']="BWB0")
$Class="Warrior";
if ($rows['Class']="CWB0")
$Class="Warrior";
if ($rows['Class']="AWB0")
$Class="Warrior";

if ($rows['Class']="BRB0")
$Class="Ranger";
if ($rows['Class']="BRB0")
$Class="Ranger";
if ($rows['Class']="CRB0")
$Class="Ranger";

if ($rows['Class']="BFB0")
$Class="Spiritualist";
if ($rows['Class']="BFB0")
$Class="Spiritualist";

if ($rows['Class']="BSB0")
$Class="Specialist";
if ($rows['Class']="BSB0")
$Class="Specialist";
if ($rows['Class']="CSB0")
$Class="Specialist";

echo '<tr id=uo>
<td id=uo width=1% align=center><font size=2>'.$g.'</font></td>
<td id=uo width=7% align=center><font size=2>'.$rows['Name'].'
<td id=uo width=7% align=center><font size=2>'.$Race.'
<td id=uo width=7% align=center><font size=2>'.$Class.'
<td id=uo width=7% align=center><font size=2>'.$rows['Lv'];
echo '</font></td>';
}

print "</tr>\n";
print "</tbody>\n</table>\n";
?>

Счетчик ЧипВара с настройкой
Код:

<?php
$conf_gmt=0; //Поправка по GMT, если время на веб-сервере отличается от времени на игровом сервере. Если время совпадает - указываем 0
$conf_ygmt=2; //GMT ВАШЕГО пояса. Украина +2, Россия +3

$conf_cw1=5; //Время первого ЧВ
$conf_cw2=13; //Время второго ЧВ
$conf_cw3=21; //Время третьего ЧВ

//Дальше трогать ничего не нужно

$h=Date(H);
$datem=date(i);
$h=$h+$conf_gmt;

if ($h>=25) {
$h=$h-24;
}
if($h < $conf_cw2 && $h >= $conf_cw1)
{ $hh=2;$hc=$conf_cw2; }
if($h >= $conf_cw2 && $h < $conf_cw3)
{ $hh=3;$hc=$conf_cw3; }
if($h >= $conf_cw3 && $h <= 23)
{ $hh=1;$hc=$conf_cw1; }
if($h >= 00 && $h < $conf_cw1)
{ $hh=1;$hc=$conf_cw1; }
if($h >= $conf_cw1 && $h <= $conf_cw2)
{ $hh=2;$hc=$conf_cw2; }
if ($h==24)
{ $hh=1;$hc=$conf_cw1; }
if ($h==0)
{ $hh=1;$hc=$conf_cw1; }


$inh=($hc-$h)-2;
$inm=60-$datem;

$chipwar1="<div>".$hh." ChipWar at ".$hc.":00<br>";
$chipwar3="Time left: ".$inh.":".$inm."<br>Server time: ".$h.":".$datem."<br>(GMT +".$conf_ygmt.")<br><br>".$conf_cw1.":00 - ".$conf_cw2.":00 - ".$conf_cw3.":00</div>";

$chipwar=$chipwar1.$chipwar3;

echo $chipwar;
?>

Sleep

Admin
Admin

Сообщения : 71
Дата регистрации : 2010-12-06
Возраст : 26
Откуда : Москва

Посмотреть профиль http://rf-moscow.2x2forumy.net

Вернуться к началу Перейти вниз

Вернуться к началу


 
Права доступа к этому форуму:
Вы не можете отвечать на сообщения