Str1ke
-
Публикации
2 -
Зарегистрирован
-
Посещение
Сообщения, опубликованные пользователем Str1ke
-
-
Есть скрипт ( выводит рейтинг игроков в онлаин игре)
echo "<table align=\"center\"><td><tr><img src=\"/rang/1.jpg\"></td></tr></table>";echo "<table align=\"center\" border=\"0\" class=\"bg2\" cellspacing=\"1\" cellpadding=\"0\" width=\"90%\">";
echo "<tr class=\"bg1\"><td width=\"45%\"><p> Персонаж</p></td>
<td width=\"45%\"><p> Локация</p></td>
</tr>";
function cmp($a, $
{
$a[2] = intval($a[2]);
$b[2] = intval($b[2]);
if ($a[5] == $b[2]) {
return 0;
}
return ($a[2] > $b[2]) ? -1 : 1;
}
// загрузка
$page_content = file("http://gapi.ereality.ru/online_heroes.txt"'>http://gapi.ereality.ru/online_heroes.txt");
#ID|НАЗВАНИЕ|УРОВЕНЬ|ОЧКИ
foreach ($page_content as $line){
$result[] = explode('|', $line);
}
usort($result, "cmp");
foreach ($result as $result){
$pers_name = $result[1];
$pers_level = $result[2];
$pers_rang = $result[3];
$pers_clan = $result[6];
$pers_loc = $result[5];
$pers_sclon = $result[4];
$pers_clan2 = $result[7];
if ($result[3] == 1) {echo "<tr class=\"bg1\"><td width=\"45%\"><p> <img src=\"http://img.ereality.ru/a/".$pers_sclon.".gif\"'>http://img.ereality.ru/a/".$pers_sclon.".gif\" title=\"Склонность \" border = 0><img src='http://img.ereality.ru/clan/".$result'>http://img.ereality.ru/clan/".$result[6].".gif'>".$pers_name."[".$pers_level."]<a href = \"http://www.ereality.ru/info.php?".$pers_name."\"'>http://www.ereality.ru/info.php?".$pers_name."\" target = '_blank'><img src=\"http://img.ereality.ru/diz/inf.gif\"'>http://img.ereality.ru/diz/inf.gif\" title=\"Информация о ".$pers_name."\" border = 0></a></p></td>";
if ($result[5] == 0) {echo "<td width=\"45%\"><p> <b><font color=purple>Туманный город</font></b></p></td></tr>";}
if ($result[5] == 1) {echo "<td width=\"45%\"><p> <b><font color=green>Остров Весеннего Листа</font></b></p></td></tr>";}
if ($result[5] == 2) {echo "<td width=\"45%\"><p> <b>Подземный мир</p></b></td></tr>";}
if ($result[5] == 3) {echo "<td width=\"45%\"><p> <b><font color=orange>Остров Покинутых Песков</font></b></p></td></tr>";}
if ($result[5] == 6) {echo "<td width=\"45%\"><p> <b><font color=red>Остров Заключённых</font></b></p></td></tr>";}
if ($result[5] == 4) {echo "<td width=\"45%\"><p> <b><font color=blue>Остров Дыхания Льдов</font></b></p></td></tr>";}
}}
echo "</table>";
Делаю модуль
1 в engine.php добавляю:
case "pvp" :include ENGINE_DIR.'/modules/pvp.php';
break;
2 создаём файл модуля pvp.php с содержимым:
<?if(!defined('DATALIFEENGINE')){
die("404 No file!");
}
$pvp = dle_cache("pvp", $config['skin']);
if(!$pvp) {
echo "<table align=\"center\"><td><tr><img src=\"/rang/1.jpg\"></td></tr></table>";
echo "<table align=\"center\" border=\"0\" class=\"bg2\" cellspacing=\"1\" cellpadding=\"0\" width=\"90%\">";
echo "<tr class=\"bg1\"><td width=\"45%\"><p> Персонаж</p></td>
<td width=\"45%\"><p> Локация</p></td>
</tr>";
function cmp($a, $
{
$a[2] = intval($a[2]);
$b[2] = intval($b[2]);
if ($a[5] == $b[2]) {
return 0;
}
return ($a[2] > $b[2]) ? -1 : 1;
}
// загрузка
$page_content = file("http://gapi.ereality.ru/online_heroes.txt"'>http://gapi.ereality.ru/online_heroes.txt");
#ID|НАЗВАНИЕ|УРОВЕНЬ|ОЧКИ
foreach ($page_content as $line){
$result[] = explode('|', $line);
}
usort($result, "cmp");
foreach ($result as $result){
$pers_name = $result[1];
$pers_level = $result[2];
$pers_rang = $result[3];
$pers_clan = $result[6];
$pers_loc = $result[5];
$pers_sclon = $result[4];
$pers_clan2 = $result[7];
if ($result[3] == 1) {echo "<tr class=\"bg1\"><td width=\"45%\"><p> <img src=\"http://img.ereality.ru/a/".$pers_sclon.".gif\"'>http://img.ereality.ru/a/".$pers_sclon.".gif\" title=\"Склонность \" border = 0><img src='http://img.ereality.ru/clan/".$result'>http://img.ereality.ru/clan/".$result[6].".gif'>".$pers_name."[".$pers_level."]<a href = \"http://www.ereality.ru/info.php?".$pers_name."\"'>http://www.ereality.ru/info.php?".$pers_name."\" target = '_blank'><img src=\"http://img.ereality.ru/diz/inf.gif\"'>http://img.ereality.ru/diz/inf.gif\" title=\"Информация о ".$pers_name."\" border = 0></a></p></td>";
if ($result[5] == 0) {echo "<td width=\"45%\"><p> <b><font color=purple>Туманный город</font></b></p></td></tr>";}
if ($result[5] == 1) {echo "<td width=\"45%\"><p> <b><font color=green>Остров Весеннего Листа</font></b></p></td></tr>";}
if ($result[5] == 2) {echo "<td width=\"45%\"><p> <b>Подземный мир</p></b></td></tr>";}
if ($result[5] == 3) {echo "<td width=\"45%\"><p> <b><font color=orange>Остров Покинутых Песков</font></b></p></td></tr>";}
if ($result[5] == 6) {echo "<td width=\"45%\"><p> <b><font color=red>Остров Заключённых</font></b></p></td></tr>";}
if ($result[5] == 4) {echo "<td width=\"45%\"><p> <b><font color=blue>Остров Дыхания Льдов</font></b></p></td></tr>";}
}}
echo "</table>";
$tpl->load_template('static.tpl');
$tpl->set('{description}', " ");
$tpl->set('{static}', $pvp);
$tpl->compile('content');
$tpl->clear();
?>
Но вместо того чтобы выводиться в контенте он выводиться наверху страницы...
Если несложно подскажите в чём ошибка ?
Нужна Помощь С Созданием Модуля
в Запросы на создание модификаций
Опубликовано:
Спасибо огромное
Всё получилось