Файл: www/gp/new_gp.php
Строк: 20
<?php
include '../config.php';
div('Новые группы');
$c=mysql_num_rows(mysql_query("SELECT * FROM `group` WHERE `time`>'".(time()-2592000)."'"));
echo 'Всего групп: '.$c.'<br/>';
$st=30;
$cp=ceil($c/$st);
if(isset($_GET['p']) and !empty($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp){
$p=intval($_GET['p']);
}else{
$p=1;}
$start=$p*$st-$st;
$q=mysql_query("SELECT * FROM `group` WHERE `time`>'".(time()-2592000)."' ORDER BY `time` DESC LIMIT $start,$st");
while($r=mysql_fetch_array($q)){
$n++;
if(is_integer($n/2)){
echo '<div class="msg2">';
}else{
echo '<div class="msg1">';}
$u=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$r[id_user]'"));
$k=mysql_fetch_array(mysql_query("SELECT * FROM `group_cat` WHERE `id`='$r[id_cat]'"));
if($r['close']==0)$close='';
if($r['close']==1)$close='#';
echo 'Создатель: <a href="../info.php?id='.$r['id_user'].'">'.$u['login'].'</a><br/>» <a href="/gp/?cid='.$r['id_cat'].'">'.htmlspecialchars(stripslashes($k['name'])).'</a><br/>'.$close.' <a href="/gp/?gid='.$r['id'].'"><b>'.htmlspecialchars(stripslashes($r['name'])).'</b></a> ['.date('d.m/H:i',$r['time']).']<br/>';
echo '</div>';}
navi($p,$cp,'new_gp.php?');
echo '</div>';
include '../foot.php';
echo '</div>';
?>