View file modules/online.php

File size: 2.98Kb
<?

////////////////////////////////////////
///// Kyber ApiCMS 2013 apicms.ru //////
///// Запрещается продажа данной CMS ///
///// Автор Евгений Медянкин Kyber /////
///// ICQ 626-000-895 или 37-22-47 /////
////////////////////////////////////////

/////////////////////////////////////////
$title = 'Пользователи онлайн';
require_once '../api_core/apicms_system.php';
require_once '../api_core/head.php';
/////////////////////////////////////////
$my_acts = time()-600;
///////////////////////////////////
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `users`  WHERE `activity` > '$my_acts'"),0);
$k_page=k_page($k_post,$api_settings['on_page']);
$page=page($k_page);
$start=$api_settings['on_page']*$page-$api_settings['on_page'];
if ($k_post==0)echo "<div class='content'><center>На сайте пока никого нет</center></div>";
/////////////////////////////////////////
$qii_on=mysql_query("SELECT * FROM `users` WHERE `activity` > '$my_acts'  ORDER BY activity DESC LIMIT $start, $api_settings[on_page]");
while ($post_on = mysql_fetch_assoc($qii_on)){
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = $post_on[id] LIMIT 1"));
if ($ank['level']==1){
echo "<div class='subhead'><table width='100%'><tr><td width='10%'>";
echo apicms_ava40($ank['id']);
echo "</td><td width='90%'><a href='/profile.php?id=".$ank['id']."'><b>".$ank['login']."</b></a> (ADM) <span style='float:right'><small> ".apicms_data($post_on['activity'])." </small></span> </br> ".$ank['my_place']." </br> ";
if ($user['level']==1)echo "<small> IP: <a href='/admin/get_ip.php?ip=".$ank['ip']."'>".$ank['ip']."</a> </small></br> ";
echo "</td></tr></table> </div>";
}
if ($ank['level']==2){
echo "<div class='subhead'><table width='100%'><tr><td width='10%'>";
echo apicms_ava40($ank['id']);
echo "</td><td width='90%'><a href='/profile.php?id=".$ank['id']."'><b>".$ank['login']."</b></a> (MOD) <span style='float:right'><small> ".apicms_data($post_on['activity'])." </small></span> </br> ".$ank['my_place']." </br> ";
if ($user['level']==1)echo "<small> IP: <a href='/admin/get_ip.php?ip=".$ank['ip']."'>".$ank['ip']."</a> </small></br> ";
echo "</td></tr></table> </div>";
}
if ($ank['level']==0){
echo "<div class='subhead'><table width='100%'><tr><td width='10%'>";
echo apicms_ava40($ank['id']);
echo "</td><td width='90%'><a href='/profile.php?id=".$ank['id']."'><b>".$ank['login']."</b></a> <span style='float:right'><small> ".apicms_data($post_on['activity'])." </small></span> </br> ".$ank['my_place']." </br> ";
if ($user['level']==1)echo "<small> IP: <a href='/admin/get_ip.php?ip=".$ank['ip']."'>".$ank['ip']."</a> </small></br> ";
echo "</td></tr></table> </div>";
}
}
/////////////////////////////////////////
if ($k_page > 1){
echo '<div class="subhead"><center>';
str('?',$k_page,$page); // генерируем постраничную навигацию
echo '</center></div>';
}
apicms_foot();
?>