Файл: forum/chet.php
Строк: 40
<?php
$countmess = $db -> dbcount('COUNT(`id`)','forum_posts');
$countthem = $db -> dbcount('COUNT(`id`)','forum_tems');
$result = $db -> query("SELECT `time` FROM `forum_posts`");
while($a = $result -> fetch_assoc()){
if (strftime("%d.%m.%Y",$a['time']) == date("d.m.Y"))
$c++;
}
if($c>0){
$cb= '+'.$c.'';}
$result2 = $db -> query("SELECT `time` FROM `forum_tems`");
while($a2 = $result2 -> fetch_assoc()){
if (strftime("%d.%m.%Y",$a2['time']) == date("d.m.Y"))
$c2++;
}
if($c2>0){
$ct= '+'.$c2.'';}
echo '<span class="count">'.$countthem.'<span class="chet">'.$ct.'</span>/'.$countmess.'<span class="chet">'.$cb.'</span></span></a>';
$sql = $db -> query("SELECT `id`,`status`,`var`,`name` FROM `forum_tems` ORDER BY `uptime` DESC LIMIT 3");
while ($t = $sql -> fetch_assoc()) {
$col = $db -> dbcount('COUNT(`id`)','golos',"`where`='forum' and `id_w` = '".$t['id']."'");
if($col>0){$st=$diz -> img('golos.png');}else{$st=null;}
if($t['status']==0){$status =''.$diz -> img('r.png').' '.$st.'';}
elseif($t['status']==1){$status=''.$diz -> img('close.png').''.$st.'';}
if($t['var']==1)$zak=$diz -> img('zak.png'); else $zak=null;
$posts = $db -> dbcount('COUNT(`id`)','forum_posts','`tema` = '.$t['id'].'');
$num = isset($ya['num']) ? $ya['num'] : 10;
$tot = intval(($posts - 1) / $num) + 1;
echo '</div><table width="100%" cellpadding=0 cellspacing=0><tr valign="top">
<td width="95%"><div class="menu"><a href="forum/tema'.$t['id'].'" class="menutuch">'.$zak.' '.$status.' '.$t['name'].' <span class="count"/>'.$posts.'</span></a></div></td>
<td><div class="menu"><a href="forum/tema.php?id='.$t['id'].'&page='.$tot.'" class="menutuch">>></a></div></td>
</tr></table>';
}
?>