<?php
require'f_forumm.php';
require'f_conectare.php';
conectare('forum, categoria '.$cnume,'forum/categorie/'.$cid.'-'.seo($cinfo[1]));
$head[1]='categoria '.$cnume.' din forumul de pe site-ul '.$adresasite[1];
$titlu='Forum, categoria '.$cnume;
if($de==0)
$head[3]='<link rel="canonical" href="'.$adresasite[0].'/forum/categorie/'.$cid.'-'.seo($cinfo[1]).($page>1?'/pagina/'.$page:'').'" />';
require'f_sus.php';
if($de>0)
require'f_nou.php';
echo$div[4].img('categorie.gif',1).'Forum, categoria '.$cnume.$div[5];
$elemente=$conn->query('SELECT COUNT(*)FROM`forum_forumuri`WHERE`cid`="'.$cid.'"&&`clid`="0"')->fetch_row()[0];
if($elemente>0)
{
require'f_paginare1.php';
require'f_profil.php';
$items=$conn->query('SELECT`id`,`nume`FROM`forum_forumuri`WHERE`cid`="'.$cid.'"&&`clid`="0"ORDER BY`pozitie`,`id`,`nume`LIMIT '.$limit_start.','.$pe_pagina);
while($item=$items->fetch_row())
{
$nops=$conn->query('SELECT COUNT(*)FROM`forum_postari`,`forum_topicuri`WHERE`forum_postari`.`tid`=`forum_topicuri`.`id`&&`forum_topicuri`.`fid`="'.$item[0].'"')->fetch_row();
$lpt=$conn->query('SELECT`id`,`nume`FROM`forum_topicuri`WHERE`fid`="'.$item[0].'"ORDER BY`activitate`DESC LIMIT 1')->fetch_row();
$nopss=$conn->query('SELECT COUNT(*)FROM`forum_postari`WHERE`tid`="'.$lpt[0].'"')->fetch_row();
if($nopss[0]==0)
$pynfo=$conn->query('SELECT`de`FROM`forum_topicuri`WHERE`id`="'.$lpt[0].'"')->fetch_row();
else
$pynfo=$conn->query('SELECT`de`FROM`forum_postari`WHERE`tid`="'.$lpt[0].'"ORDER BY`data`DESC LIMIT 1')->fetch_row();
echo$div[1].'<a href="/forum/forum/'.$item[0].'-'.seo($item[1]).'">'.img('forum.png',2).$item[1].'</a> cu <strong>'.number_format($conn->query('SELECT COUNT(*)FROM`forum_topicuri`WHERE`fid`="'.$item[0].'"')->fetch_row()[0]).'</strong> topicuri și <strong>'.number_format($nops[0]).'</strong> postări<br />Ultima postare în <a href="/forum/topic/'.$lpt[0].'-'.seo($lpt[1]).'/tip/last">'.htmlspecialchars($lpt[1]).'</a> scrisa de '.profil($pynfo[0]).$div[0];
}
require'f_paginare2.php';
}
else
echo$div[7].'Nu sunt adaugate forumuri în aceasta categorie!'.$div[0];
require'f_jos.php';