From fb99632c933620b88400c7892a9211bf4936687b Mon Sep 17 00:00:00 2001 From: "neatelves@gmail.com" Date: Sun, 31 Jul 2011 17:47:04 +0000 Subject: [PATCH] =?utf8?q?=D0=9A=D0=BE=D0=BD=D0=B4=D0=B8=D1=86=D0=B8=D0=B8?= =?utf8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=BD=D1=8F=D1=82=D0=B8=D1=8F=20?= =?utf8?q?=D1=88=D0=BA=D1=83=D1=80.=20=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20?= =?utf8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF?= =?utf8?q?=D1=80=D0=B8=20=D0=B2=D1=8B=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?utf8?q?=D0=BD=D0=BE=D0=BC=20=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://cswowd-fork.googlecode.com/svn/trunk@113 e451fad0-63ce-11de-bed1-e3a98b22654c --- conf.php.in | 4 ++++ lang/lang.en.php | 1 + lang/lang.ru.php | 1 + module/online/online.php | 21 ++++++++++++++++----- module/show/show_item.php | 1 + 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/conf.php.in b/conf.php.in index 65ddfba..bf2796d 100644 --- a/conf.php.in +++ b/conf.php.in @@ -29,6 +29,10 @@ $config =array ( 'cpassword' => '', // mysql password 'cdbName' =>'characters', // mysql data base name (characters db) +// Server on\off(online status) +'host' => '127.0.0.1', // host +'port' => '8085', // port + //Other 'lang'=>'ru', // Язык интерфейса сайта ru,en 'client_charset'=> 'utf8', // Кодировка клиента (не рекомендую менять - так как родная кодировка сайта utf8) diff --git a/lang/lang.en.php b/lang/lang.en.php index 392a8c7..7a66e2e 100644 --- a/lang/lang.en.php +++ b/lang/lang.en.php @@ -7,6 +7,7 @@ $lang = array( 'find' => 'Find', 'main' => 'Main', 'error' => 'Error', +'offline' => 'Server is offline', # Site 'www_creature'=>'http://wowhead.com/npc=%d', diff --git a/lang/lang.ru.php b/lang/lang.ru.php index b3dbce9..c6f1346 100644 --- a/lang/lang.ru.php +++ b/lang/lang.ru.php @@ -7,6 +7,7 @@ $lang = array( 'find' => 'Найти', 'main'=> 'Главная', 'error' => 'Ошибка', +'offline' => 'Сервер выключен', # Site 'www_creature'=>'http://ru.wowhead.com/npc=%d', diff --git a/module/online/online.php b/module/online/online.php index 01cd292..622ccb4 100644 --- a/module/online/online.php +++ b/module/online/online.php @@ -36,6 +36,13 @@ function onlineMapRenderCallback($data, $x, $y) return ''."\n"; } +function onoff_realm() +{ + global $config; + $s = @fsockopen($config['host'], $config['port'], $errno, $errstr, (float)0.5); + if($s){@fclose($s);return true;} else return false; +} + $online = @$_REQUEST['online']; $width = isset($_REQUEST['width']) ? $_REQUEST['width'] : 700; @@ -75,20 +82,24 @@ else echo "".$lang['daily_quest_date']."".$daily_quest_date.""; echo "".$lang['weekly_quest_date']."".$weekly_quest_date.""; echo "".$lang['monthly_quest_date']."".$monthly_quest_date.""; - if ($s = getGameEventActive()) + if ($ae = getGameEventActive()) { echo "".$lang['active_event'].""; - foreach ($s as $s1) + foreach ($ae as $ae1) { - if (getGameEventActiveName($s1['event'])) - echo "".getGameEventName($s1['event']).""; + if (getGameEventActiveName($ae1['event'])) + echo "".getGameEventName($ae1['event']).""; } } echo ""; - +if (onoff_realm()) +{ if ($number <= 0) echo $lang['online_no_players']; else $list->createReport($number.' '.$lang['online_players']); } +else + echo $lang['offline']; +} ?> \ No newline at end of file diff --git a/module/show/show_item.php b/module/show/show_item.php index 977969a..37c52a3 100644 --- a/module/show/show_item.php +++ b/module/show/show_item.php @@ -348,6 +348,7 @@ else // Ошкурено с мобов //******************************************************************************** $skin =& new CreatureReportGenerator('skin'); + $fields = array('NPC_REPORT_LEVEL', 'NPC_REPORT_RNAME', 'LOOT_REPORT_REQ', 'LOOT_REPORT_CHANCE', 'NPC_REPORT_MAP'); if ($skin->Init($fields, $baseLink, 'skinLIST', $config['fade_limit'], 'chance')) { $skin->lootItem($entry); -- 2.11.4.GIT