Вот
<?
/**
* @package JohnCMS
* @link http://johncms.com
* @copyright Copyright (C) 2008-2011 JohnCMS Community
* @license LICENSE.txt (see attached file)
* @version VERSION.txt (see attached file)
* @author http://johncms.com/about
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$mp = new mainpage();
$req = mysql_query("SELECT * FROM `users` WHERE `vip` != '0' ORDER BY RAND() LIMIT 0,9");
$res = mysql_fetch_assoc($req);
if($datauser['vip']==0){
echo "<div class='menu'>нет лидеров</div>";
} else {
echo '<div class="menu">';
echo '<table cellpadding="0" cellspacing="0"><tr><td>';
if (file_exists(($rootpath . 'files/users/avatar/' . $res['id'] . '.png')))
echo '<img src="../files/users/avatar/' . $res['id'] . '.png" width="32" height="32" alt="" /> ';
else
echo '<img src="../images/empty.png" width="32" height="32" alt="" /> ';
echo '</td><td>';
if ($res['sex'])
echo '<img src="../theme/' . $set_user['skin'] . '/images/' . ($res['sex'] == 'm' ? 'm' : 'w') . ($res['datereg'] > $realtime - 86400 ? '_new' : '') . '.png" width="16" height="16" align="middle" /> ';
else
echo '<img src="../images/del.png" width="12" height="12" align="middle" /> ';
// Ник юзера и ссылка на его анкету
if ($user_id && $user_id != $res['user_id']) {
echo '<a href="../str/anketa.php?id=' . $res['id'] . '"><b>' . $res['name'] . '</b></a> ';
} else {
echo '<b>' . $res['name'] . '</b> ';
}
// Метка должности
$user_rights = array (
3 => '(FMod)',
6 => '(Smd)',
7 => '(Adm)',
9 => '(SV!)'
);
echo $user_rights[$res['rights']];
// Метка Онлайн / Офлайн
echo ($realtime > $res['lastdate'] + 300 ? '<span class="red"> [Off]</span> ' : '<span class="green"> [ON]</span> ');
echo '<div class="status">'.$res['text_vip'].'</div>';
echo '</td></tr></table>';
echo '</div>';
}
echo '<div class="menu"><img src="../vip/lid.gif" alt=""/><a href="../vip/index.php">Лидеры дня</a></div>';
/*
-----------------------------------------------------------------
Блок информации
-----------------------------------------------------------------
*/
echo '<div class="phdr"><b>' . $lng['information'] . '</b></div>';
echo $mp->news;
echo '<div class="menu"><a href="news/index.php">' . $lng['news_archive'] . '</a> (' . $mp->newscount . ')</div>' .
'<div class="menu"><a href="pages/faq.php">' . $lng['information'] . ', FAQ</a></div>';
/*
-----------------------------------------------------------------
Блок общения
-----------------------------------------------------------------
*/
echo '<div class="phdr"><b>' . $lng['dialogue'] . '</b></div>';
// Ссылка на гостевую
if ($set['mod_guest'] || $rights >= 7)
echo '<div class="menu"><a href="guestbook/index.php">' . $lng['guestbook'] . '</a> (' . counters::guestbook() . ')</div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `stol_guest` WHERE `adm`='" . (isset($_SESSION['ga']) ? 1 : 0) . "'"), 0);
echo '<div class="menu"><a href="stol/index.php">Стол заказов</a> (' . $total . ')</div>';
// Ссылка на Форум
if ($set['mod_forum'] || $rights >= 7)
echo '<div class="menu"><a href="forum/">' . $lng['forum'] . '</a> (' . counters::forum() . ')</div>';
$chat_online = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `lastdate` > '" . ($realtime - 300) . "' AND `place` LIKE 'chat%'"), 0);
echo '<div class="menu"><a href="chat/">' . $lng['chat'] . '</a> (' . $chat_online . ')</div>';
/*
-----------------------------------------------------------------
Блок полезного
-----------------------------------------------------------------
*/
echo '<div class="phdr"><b>' . $lng['useful'] . '</b></div>';
// Ссылка на загрузки
if ($set['mod_down'] || $rights >= 7)
include_once $SERVER['DOCUMENT_ROOT'].'download/functions.php';
echo'<div class="menu"><a href="download/index.html">Загруз-Зона </a>('.dcount_simba().')</div>';
// Ссылка на библиотеку
if ($set['mod_lib'] || $rights >= 7)
echo '<div class="menu"><a href="library/">' . $lng['library'] . '</a> (' . counters::library() . ')</div>';
// Ссылка на библиотеку
if ($set['mod_gal'] || $rights >= 7)
echo '<div class="menu"><a href="gallery/">' . $lng['gallery'] . '</a> (' . counters::gallery() . ')</div>';
if ($user_id || $set['active']) {
echo '<div class="phdr"><b>' . $lng['community'] . '</b></div>' .
'<div class="menu"><a href="users/index.php">' . $lng['users'] . '</a> (' . counters::users() . ')</div>' .
'<div class="menu"><a href="users/album.php">' . $lng['photo_albums'] . '</a> (' . counters::album() . ')</div>';
}
echo '<div class="phdr"><a href="http://gazenwagen.com">Gazenwagen</a></div>';
?>