avatar_Unmanaged

Топ-50 игроков ExEngine: Кто займет первое место?

Автор Unmanaged, 2018 Фев. 16, 09:49

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

Ключевые слова [SEO] игрокимодульexengine

Unmanaged


EvgGen

Топ 50 и модуль сильнейших скорее всего содержут один и тот же участок кода, который как обычно не прилагается к вопросу и остаётся лишь гадать...

Swoop

дайте хоть код посмотреть

Unmanaged

Цитата: Swoop от 2018 Фев. 17, 10:07  дайте хоть код посмотреть
<?php

// Топ 50 игроков
// Автор: NexT

if(!defined('EXEngine')) {
Exit;
}

// Начинаем буферизацию вывода
ob_start();

// Обработка шапки
if (!$Content ReadCache("top-".GetServer($ServerNum)."-".$Web_URL[1], $Web['cache_top']*60)) {
switch(
$Web_URL[1]) {
case 
'dw'$Class 'Class = 0 OR Class = 1 OR Class = 2 OR Class = 3 and'; break;
case 
'dk'$Class 'Class = 16 OR Class = 17 OR Class = 18 OR Class = 19 and'; break;
case 
'fe'$Class 'Class = 32 OR Class = 33 OR Class = 34 OR Class = 35 and'; break;
case 
'mg'$Class 'Class = 48 OR Class = 49 OR Class = 50 and'; break;
case 
'dl'$Class 'Class = 64 OR Class = 65 OR Class = 66 and'; break;
default  : 
$Class ''; break;
}

echo 
'<h2>Топ 50 игроков</h2>
<div id="top_menu">
<a href="top"><b>Все</b></a>
<a href="top/dw"><font color="#008080"><b>/ DW-SM-GM</b></font></a>
<a href="top/dk"><font color="#FF0000"><b>/ DK-BK-BM</b></font></a>
<a href="top/fe"><font color="#008000"><b>/ FE-ME-HE</b></font></a>
<a href="top/mg"><font color="#191970"><b>/ MG-DM</b></font></a>
<a href="top/dl"><font color="#000000"><b>/ DL-LE</b></font></a>'
;

echo 
'</div>
<table align="center" width="100%" class="top_table" border="0" cellpadding="1" cellspacing="1">
<thead>
<tr class="top_text_default">
<td align="center"><b>№</b></td>
<td align="center">Персонаж</td>
<td align="center">Класс</td>
<td align="center">Уровень</td>
<td align="center">Ресет</td>
<td align="center">Гильдия</td>
</tr>
</thead>
<tbody>'
;

$Result $DB->Query('SELECT TOP 50 * FROM Character WHERE '.$Class.' CtlCode != 32 and CtlCode != 8 and CtlCode != 1 order by Resets desc,cLevel desc');

if (
$DB->NumRows($Result) == 0) {
echo 
'<tr class="charoffline"><td colspan="7"><center>Список пуст!</center></td></tr>';
}

while(
$Info $DB->FetchArray($Result)) {
++
$Count;

$Name $Info['Name'];
$Class GetCharClass($Info['Class'],0);
$Level $Info['cLevel'];
$Resets $Info['Resets'];
$GetGuild $DB->FetchRow($DB->Query("SELECT G_Name FROM GuildMember where Name = '".$Info['Name']."'"));
$Guild $GetGuild[0];
$CheckStatus $DB->FetchRow($DB->Query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id = '".$Info['AccountID']."'"));
$GameIDC $DB->FetchRow($DB->Query("Select GameIDC from AccountCharacter where Id = '".$Info['AccountID']."'"));
if (
$CheckStatus[0] == && $GameIDC[0] == $Info['Name']) {
$Status '#e4ffda';
}
else {
$Status '#fec8c8';
}
$Color $Count 'charoffline' 'charonline';
echo 
'<tr class="'.$Color.'">
<td align="center" style="width:25px; height:20px; padding-left:1px; padding-right:1px; background-color:'
.$Status.';">'.$Count.'</td>
<td align="center"><a href="char/'
.$Name.'">'.$Name.'</a></td>
<td align="center">'
.$Class.'</td>
<td align="center">'
.$Level.'</td>
<td align="center">'
.$Resets.'</td>
<td align="center"><a href="guild/'
.$Guild.'">'.$Guild.'</a></td>
</tr>'
;
}

echo 
'</tbody></table><p><center>Обновление ТОПа происходит раз в '.$Web['cache_top'].' минут(ы).</center></p>';

// Сохранение кэш-файла с контентом
$Content ob_get_contents();
ob_clean();
WriteCache($Content"top-".GetServer($ServerNum)."-".$Web_URL[1]);
}

// останавливаем буферизацию
ob_end_clean();

// Выводим содержимое страницы
echo $Content;

?>


Цитата: EvgGen от 2018 Фев. 16, 19:36  Топ 50 и модуль сильнейших скорее всего содержут один и тот же участок кода, который как обычно не прилагается к вопросу и остаётся лишь гадать...

Модуль ТОП 50
<?php

// Топ 50 игроков
// Автор: NexT

if(!defined('EXEngine')) {
Exit;
}

// Начинаем буферизацию вывода
ob_start();

// Обработка шапки
if (!$Content ReadCache("top-".GetServer($ServerNum)."-".$Web_URL[1], $Web['cache_top']*60)) {
switch(
$Web_URL[1]) {
case 
'dw'$Class 'Class = 0 OR Class = 1 OR Class = 2 OR Class = 3 and'; break;
case 
'dk'$Class 'Class = 16 OR Class = 17 OR Class = 18 OR Class = 19 and'; break;
case 
'fe'$Class 'Class = 32 OR Class = 33 OR Class = 34 OR Class = 35 and'; break;
case 
'mg'$Class 'Class = 48 OR Class = 49 OR Class = 50 and'; break;
case 
'dl'$Class 'Class = 64 OR Class = 65 OR Class = 66 and'; break;
default  : 
$Class ''; break;
}

echo 
'<h2>Топ 50 игроков</h2>
<div id="top_menu">
<a href="top"><b>Все</b></a>
<a href="top/dw"><font color="#008080"><b>/ DW-SM-GM</b></font></a>
<a href="top/dk"><font color="#FF0000"><b>/ DK-BK-BM</b></font></a>
<a href="top/fe"><font color="#008000"><b>/ FE-ME-HE</b></font></a>
<a href="top/mg"><font color="#191970"><b>/ MG-DM</b></font></a>
<a href="top/dl"><font color="#000000"><b>/ DL-LE</b></font></a>'
;

echo 
'</div>
<table align="center" width="100%" class="top_table" border="0" cellpadding="1" cellspacing="1">
<thead>
<tr class="top_text_default">
<td align="center"><b>№</b></td>
<td align="center">Персонаж</td>
<td align="center">Класс</td>
<td align="center">Уровень</td>
<td align="center">Ресет</td>
<td align="center">Гильдия</td>
</tr>
</thead>
<tbody>'
;

$Result $DB->Query('SELECT TOP 50 * FROM Character WHERE '.$Class.' CtlCode != 32 and CtlCode != 8 and CtlCode != 1 order by Resets desc,cLevel desc');

if (
$DB->NumRows($Result) == 0) {
echo 
'<tr class="charoffline"><td colspan="7"><center>Список пуст!</center></td></tr>';
}

while(
$Info $DB->FetchArray($Result)) {
++
$Count;

$Name $Info['Name'];
$Class GetCharClass($Info['Class'],0);
$Level $Info['cLevel'];
$Resets $Info['Resets'];
$GetGuild $DB->FetchRow($DB->Query("SELECT G_Name FROM GuildMember where Name = '".$Info['Name']."'"));
$Guild $GetGuild[0];
$CheckStatus $DB->FetchRow($DB->Query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id = '".$Info['AccountID']."'"));
$GameIDC $DB->FetchRow($DB->Query("Select GameIDC from AccountCharacter where Id = '".$Info['AccountID']."'"));
if (
$CheckStatus[0] == && $GameIDC[0] == $Info['Name']) {
$Status '#e4ffda';
}
else {
$Status '#fec8c8';
}
$Color $Count 'charoffline' 'charonline';
echo 
'<tr class="'.$Color.'">
<td align="center" style="width:25px; height:20px; padding-left:1px; padding-right:1px; background-color:'
.$Status.';">'.$Count.'</td>
<td align="center"><a href="char/'
.$Name.'">'.$Name.'</a></td>
<td align="center">'
.$Class.'</td>
<td align="center">'
.$Level.'</td>
<td align="center">'
.$Resets.'</td>
<td align="center"><a href="guild/'
.$Guild.'">'.$Guild.'</a></td>
</tr>'
;
}

echo 
'</tbody></table><p><center>Обновление ТОПа происходит раз в '.$Web['cache_top'].' минут(ы).</center></p>';

// Сохранение кэш-файла с контентом
$Content ob_get_contents();
ob_clean();
WriteCache($Content"top-".GetServer($ServerNum)."-".$Web_URL[1]);
}

// останавливаем буферизацию
ob_end_clean();

// Выводим содержимое страницы
echo $Content;

?>


Модуль ТОП 10
<?php

// ТОП 10
// Автор: NexT

if(!defined('EXEngine')) {
Exit;
}

ob_start();

if (!
$Content ReadCache("heroes-".GetServer($ServerNum), $Web['cache_top']*60)) {

echo 
'<div class="top_content">
<table>
<tr>
<td class="head"><b>№</b></td>
<td class="head"><b>Игрок</b></td>
<td class="head"><b>Уровень</b></td>
<td class="head"><b> Рес</b></td>
</tr>'
;

$Result $DB->Query('SELECT TOP 10 * FROM Character WHERE '.$Class.' CtlCode != 32 and CtlCode != 8 and CtlCode != 1 order by Resets desc, cLevel desc');

if (
$DB->NumRows($Result) == 0) {
echo 
'<tr><td colspan="4"><center>Список пуст!</center></td></tr>';
}

while(
$Info $DB->FetchArray($Result)) {
++
$Count;

$Name $Info['Name'];
$Level $Info['cLevel'];
$Resets $Info['Resets'];

echo  
'<tr>
<td><div>'
.$Count.'</div></td>
<td><div><a href="char/'
.$Name.'"><font color="#dbb795">'.$Name.'</font></a></div></td>
<td><div>'
.$Level.'</div></td>
<td><div> ['
.$Resets.']</b></div></td>
</tr>'
;
}

echo 
'</table></div>';

$DB->Select_DB($CurrentBase);
$Content ob_get_contents();
ob_clean();
WriteCache($Content"heroes-".GetServer($ServerNum));
}

ob_end_clean();
echo 
$Content;

?>


EvgGen



Похожие темы (5)