Файл: users.php
Строк: 128
<?
define('ROOT','./');
require_once ('system/power.php');
switch($do){
case 'was':
$users = $db -> dbcount('COUNT(`id`)','users');
$ulr = $db -> query("SELECT `lasttime` FROM `users`");
while($a = $ulr -> fetch_assoc()){
if (strftime("%d.%m.%Y",$a['lasttime']) == date("d.m.Y"))
$cr++;
}
$count=$cr+0;
$now=$users-$count;
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
$diz -> head(language('Посетители').' '.$count);
$diz -> title(language('Посетители').': '.$count);
if($count>0){
$ulr = $db -> query("SELECT `id`,`lasttime` FROM `users` order by `lasttime` desc LIMIT ".$start.",".$num);
while ($us = $ulr -> fetch_assoc()) {
if (strftime("%d.%m.%Y",$us['lasttime']) == date("d.m.Y")){
echo '<a href="'.ROOT.'id'.$us['id'].'" class="mail"><table><tr valign="top"><td>
'.$fuser->avatar($us['id'],56,55,1).'</td><td>
'.$fuser -> famname($us['id'],0);
if($nastr['date_reg']==1)echo '<br/>'.$fuser->ifsex($us['id'],'Зарегистрирован','Зарегистрирована').' '.$func -> times(date('d m Y',$us['time']));
if($us['lasttime']!=0)echo '<br/>'.$fuser->ifsex($us['id'],'Был в сети','Была в сети').' '.$func -> times(date('d m Y',$us['lasttime']));
echo '</td></tr></table></a>';
}
}
$act = '?do=was';
echo ''.$func -> pagenav($act,$page,$total).'';
}else echo'<div class="fon">'.language('Информация отсутствует').'</div>';
echo '<div class="levo"><a href="users.php" class="levo_tuch">'.$diz -> icon('back.png').' '.language('Назад').'</a></div>';
break;
////новички
case 'new_us':
$count = $db -> dbcount('COUNT(*)','users','`time` > '.(time()-86400).'');
if ($count==0)$k_u=0;else $k_u=$count;
$diz -> head(language('Новички').' '.$k_u);
$diz -> title(language('Новички').': '.$k_u);
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
if($k_u>0){
$sql = $db -> query("SELECT `id`,`login`,`time`,`lasttime` FROM `users` where `time` > '".(time()-86400)."' ORDER BY `id` LIMIT ".$start.",".$num);
while ($us = $sql -> fetch_assoc()) {
echo '<a href="'.ROOT.'id'.$us['id'].'" class="mail"><table><tr valign="top"><td>
'.$fuser->avatar($us['id'],56,55,1).'</td>
<td>'.$fuser -> famname($us['id'],0);
if($nastr['date_reg']==1)echo '<br/>'.$fuser->ifsex($us['id'],'Зарегистрирован','Зарегистрирована').' '.$func -> times(date('d m Y',$us['time']));
if($us['lasttime']!=0)echo '<br/>'.$fuser->ifsex($us['id'],'Был в сети','Была в сети').' '.$func -> times(date('d m Y',$us['lasttime']));
echo '</td></tr></table></a>';
}
$act = '?do=new_us';
echo $func -> pagenav($act,$page,$total);
}else echo'<div class="fon">'.language('Информация отсутствует').'</div>';
echo '<div class="levo"><a href="users.php" class="levo_tuch">'.$diz -> icon('back.png').' '.language('Назад').'</a></div>';
break;
default:
$diz -> head('Пользователи');
$count = $db -> dbcount('COUNT(`id`)','users');
$diz -> title('Пользователи');
$ulr = $db -> query("SELECT `lasttime` FROM `users`");
while($a = $ulr -> fetch_assoc()){
if (strftime("%d.%m.%Y",$a['lasttime']) == date("d.m.Y"))
$cr++;
}
$count2=$cr+0;
$count3 = $db -> dbcount('COUNT(`id`)','users','`time` > '.(time()-86400).'');
if ($count3==0)$count3=0;
else $count3=$count3;
echo'<div class="but_razdel"><a href="?do=was" class="button_razdel" style="width:50%">'.language('Посетители').' <span class="count">'.$count2.'</span></a>
<a href="?do=new_us" class="button_razdel" style="width:50%">'.language('Новички').' <span class="count">'.$count3.'</span></a></div>';
$count_m = $db -> dbcount('COUNT(`id`)','users','`sex` = "m"');
$count_w = $db -> dbcount('COUNT(`id`)','users','`sex` = "w"');
if(!$page){
echo '<div class="fon">
'.language('Пользователей').': '.$count.'<br/>
'.language('Парней').': '.$count_m.'<br/>
'.language('Девушек').': '.$count_w.'<br/>
</div>';
}
if($count>0){
$num = isset($ya['num']) ? $ya['num'] : 10;
$total = intval(($count - 1) / $num) + 1;
if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] < 1 )
{
$page = 1;
} elseif($_GET['page'] > $total)
{ $page = $total;
} else $page = (int)$_GET['page'];
$start = $page * $num - $num;
$sql = $db -> query("SELECT `id`,`login`,`time`,`lasttime` FROM `users` ORDER BY `lasttime` DESC LIMIT ".$start.",".$num);
while ($users = $sql -> fetch_assoc()) {
echo '<a href="'.ROOT.'id'.$users['id'].'" class="mail"><table><tr valign="top">
<td>'.$fuser -> avatar($users['id'],56,55,1).'</td><td>
'.$fuser -> famname($users['id'],0).' '.$fuser -> online($users['id']);
if($db->settings('date_reg')==1)echo '<br/>'.$fuser->ifsex($users['id'],'Зарегистрирован','Зарегистрирована').' '.$func -> times(date('d m Y H:s',$users['time']));
if($users['lasttime']!=0)echo '<br/>'.$fuser->ifsex($users['id'],'Был в сети','Была в сети').' '.$func -> times(date('d m Y H:s',$users['lasttime']));
echo '</div></td></tr></table></a>';
}
echo $func -> pagenav('?',$page,$total);
}else echo'<div class="fon">'.language('Информация отсутствует').'</div>';
}
echo '<div class="levo"><a href="index.php" class="levo_tuch">'.$diz -> icon('home.png').' '.language('На главную').'</a></div>';
#####Копирайт#######
$diz -> out($msg);
?>