Файл: online.php
Строк: 92
<?
include 'system/core.php';
$_title = 'Онлайн '.mysql_result(mysql_query('select count(`id`) from `user` where `online` > "'.(time()-3600).'"'),0).' человек';
include 'system/header.php';
if(!$user['id'])
{
header('Location: /index.php/?m=guest'); exit;
}
echo '<div class="tegi"><b>Онлайн '.mysql_result(mysql_query('select count(`id`) from `user` where `online` > "'.(time()-3600).'"'),0).' человек</b></div></div></div> ';
include 'modules/op/c.php';
include 'modules/privat/c.php';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek))
{
echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>';
}
echo '</div>';
echo '</div>';
include 'system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
//////////////////////////////////////////////////////
$cop = $user['on_page'];
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `user` where `online` > '".(time()-3600)."'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p'])){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}
else
{
$p = 1;
}
$start = $p*$cop-$cop;
$online = mysql_query("SELECT * FROM `user` where `online` > '".(time()-3600)."' ORDER BY `online` DESC LIMIT $start,$cop");
while($online2 = mysql_fetch_assoc($online))
{
echo '<div class="post2">'.ustatus($online2['id']).' <a href="/us'.$online2['id'].'">'.uname($online2['id']).'</a> '.uaccess($online2['id']).' ('.times($online2['online']).')</div>';
}
echo '<div class="spis">Стр. ';
if($p-2>0) echo '<a href="/online.php?p=1"><<</a> ';
if($p-1>0) echo '<a href="/online.php?p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/online.php?p='.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/online.php?p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/online.php?p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/online.php?p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/online.php?p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/online.php?p='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/online.php?p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/online.php?p='.ceil($ca/$cop).'">>></a>';
echo '</div></div>';
include 'system/footer.php';
?>