<?php
require'f_forumm.php';
require'f_conectare.php';
conectare('forum '.$fnume,'forum/forum/'.$fid.'-'.seo($finfo[2]));
$titlu='Forum '.$fnume;
if($de==0)
{
if($go=='')
$head[3]='<link rel="canonical" href="'.$adresasite[0].'/forum/forum/'.$fid.'-'.seo($finfo[2]).($page>1?'/pagina/'.$page:'').'" />';
}
if($finfo[1]>0)
$back[2]='<a href="/forum/categorie/'.$finfo[1].'-'.seo($cinfo[1]).'">'.img('categorie.gif',1).$cnume.'</a>';
else
$back[2]='<a href="/grup/id/'.$finfo[3].'-'.seo($cinfo[1]).'">'.img('grupuri.png',2).'Grup '.$cnume.'</a>';
require'f_sus.php';
if($de>0)
require'f_nou.php';
echo$div[4].img('forum.png',2).'Forum '.$fnume.$div[5].$div[10].'<a href="/adauga-topic-nou/forum/'.$fid.'-'.seo($finfo[2]).'">Adaugă topic nou</a><br />';
$norf=$conn->query('SELECT COUNT(*)FROM`rss`WHERE`fid`="'.$fid.'"')->fetch_row();
if($norf[0]>0)
echo'<a href="/flux-rss/categorie/'.$fid.'-'.seo($finfo[2]).'">'.img('stiri.png',2).$fnume.'</a><br />';
if($finfo[3]==0)
{
if($de>0)
{
$abonat=$conn->query('SELECT COUNT(*)FROM`forum_abonati_forumuri`WHERE`fid`="'.$fid.'"&&`de`="'.$de.'"')->fetch_row();
if($abonat[0]==0)
echo'Nu ești abonat la acest forum<br /><a href="/abonare-forum/forum/'.$fid.'-'.seo($finfo[2]).'/tip/abonare">Abonează-te</a>';
else
echo'Esti abonat la acest forum<br /><a href="/abonare-forum/forum/'.$fid.'-'.seo($finfo[2]).'/tip/dezabonare">Dezabonează-te</a>';
}
$abo=$conn->query('SELECT COUNT(*)FROM`forum_abonati_forumuri`WHERE`fid`="'.$fid.'"')->fetch_row();
echo'<br /><a href="/abonati-forum/forum/'.$fid.'-'.seo($finfo[2]).'">Membrii abonați</a> <strong>'.number_format($abo[0]).'</strong><br />';
}
echo'<br /><small>BBCode: <strong>[url=/forum/forum/'.$fid.'-'.seo($finfo[2]).']'.$fnume.'[/url]</strong></small>'.$div[0];
$form[0]='/forum/forum/'.$fid.'-'.seo($finfo[2]).'" method="get';
$form[1]=1;
require'f_scris3.php';
$form[2]=$div[1].'Sorteaza topicuri:<br />'.scris3('go','toate,,Toate::noi,,De la ultima ta vizita::aletale,,In care ai postat','toate').$div[0];
$form[3]='go';
$form[4]='Vizualizeaza';
require'f_form.php';
echo$div[4];
if($go=='noi')
echo'Vizualizeaza topicurile cu postări noi de la ultima ta vizita';
elseif($go=='aletale')
echo'Vizualizeaza topicurile în care ai postat';
else
echo'Vizualizeaza toate topicurile din acest forum';
echo$div[5];
if($finfo[4]==1)
echo$div[7].'<img src="'.$domenii_statice[2].'closed.gif" alt="topic închis" />Acest forum este inchis!'.$div[0];
if($page==1)
{
$topics=$conn->query('SELECT`id`,`nume`,`inchis`,`vizualizari`,`tid`FROM`forum_topicuri`WHERE`fid`="'.$fid.'"&&`urcat`="1"ORDER BY`activitate`DESC,`id`,`nume`LIMIT 5');
while($topic=$topics->fetch_row())
{
$iml='<img src="'.$domenii_statice[1].'normal.gif" alt="" />';
$atxt='';
if($topic[2]==1)
{
$iml='<img src="'.$domenii_statice[2].'closed.gif" alt="topic închis" />';
$atxt='(X)';
}
if($topic[4]>0)
$pltx=img('vot.gif',2);
else
$pltx='';
$nop=$conn->query('SELECT COUNT(*)FROM`forum_postari`WHERE`tid`="'.$topic[0].'"')->fetch_row();
echo$div[1].'<a href="/forum/topic/'.$topic[0].'-'.seo($topic[1]).'">'.$iml.$pltx.htmlspecialchars($topic[1]).' <strong>'.$nop[0].'</strong>'.$atxt.'</a>'.$div[0];
}
}
if($go!='')
$x2='/forum/'.$fid.'-'.seo($finfo[2]).'/tip/'.$go;
if($go=='noi')
{
$activitate_membru=$conn->query('SELECT`lastvst`FROM`membrii`WHERE`id`="'.$de.'"')->fetch_row()[0];
$elemente=$conn->query('SELECT COUNT(*)FROM`forum_topicuri`WHERE`fid`="'.$fid.'"&&`urcat`="0"&&`activitate`>="'.$activitate_membru.'"')->fetch_row()[0];
}
elseif($go=='aletale')
$elemente=$conn->query('SELECT COUNT(*)FROM`forum_topicuri`,`forum_postari`WHERE`forum_topicuri`.`id`=`forum_postari`.`tid`&&`forum_topicuri`.`fid`="'.$fid.'"&&`forum_topicuri`.`urcat`="0"&&`forum_postari`.`de`="'.$de.'"')->fetch_row()[0];
else
$elemente=$conn->query('SELECT COUNT(*)FROM`forum_topicuri`WHERE`fid`="'.$fid.'"&&`urcat`="0"')->fetch_row()[0];
if($elemente>0)
{
require'f_paginare1.php';
if($limit_start<0)
$limit_start=0;
if($go=='noi')
$topics=$conn->query('SELECT`id`,`nume`,`inchis`,`vizualizari`,`mutat`,`tid`FROM`forum_topicuri`WHERE`fid`="'.$fid.'"&&`urcat`="0"&&`activitate`>="'.$activitate_membru.'"ORDER BY`activitate`DESC,`id`,`nume`LIMIT '.$limit_start.','.$pe_pagina);
elseif($go=='aletale')
$topics=$conn->query('SELECT`forum_topicuri`.`id`,`forum_topicuri`.`nume`,`forum_topicuri`.`inchis`,`forum_topicuri`.`vizualizari`,`forum_topicuri`.`mutat`,`forum_topicuri`.`tid`FROM`forum_topicuri`,`forum_postari`WHERE`forum_topicuri`.`id`=`forum_postari`.`tid`&&`forum_topicuri`.`fid`="'.$fid.'"&&`forum_topicuri`.`urcat`="0"&&`forum_postari`.`de`="'.$de.'"GROUP BY`forum_topicuri`.`id`ORDER BY`forum_topicuri`.`activitate`DESC,`forum_topicuri`.`id`,`forum_topicuri`.`nume`LIMIT '.$limit_start.','.$pe_pagina);
else
$topics=$conn->query('SELECT`id`,`nume`,`inchis`,`vizualizari`,`mutat`,`tid`FROM`forum_topicuri`WHERE`fid`="'.$fid.'"&&`urcat`="0"ORDER BY`activitate`DESC,`id`,`nume`LIMIT '.$limit_start.','.$pe_pagina);
while($topic=$topics->fetch_row())
{
$nop=$conn->query('SELECT COUNT(*)FROM`forum_postari`WHERE`tid`="'.$topic[0].'"')->fetch_row();
$iml='<img src="'.$domenii_statice[1].'normal.gif" alt="" />';
if($nop[0]>24)
$iml='<img src="'.$domenii_statice[2].'hot.gif" alt="" />';
if($topic[4]==1)
$iml='<img src="'.$domenii_statice[1].'moved.gif" alt="mutat" />';
if($topic[2]==1)
$iml='<img src="'.$domenii_statice[2].'closed.gif" alt="topic închis" />';
if($topic[5]>0)
$pltx=img('vot.gif',2);
else
$pltx='';
$atxt='';
if($topic[2]==1)
$atxt='(X)';
echo$div[1].'<a href="/forum/topic/'.$topic[0].'-'.seo($topic[1]).'">'.$iml.$pltx.htmlspecialchars($topic[1]).' <strong>'.number_format($nop[0]).'</strong>'.$atxt.'</a>'.$div[0];
}
require'f_paginare2.php';
}
else
echo$div[7].'Nu sunt topicuri în acest forum'.($go==''?'':', după criteriul selectat').'!'.$div[0];
echo$div[1].'<a href="/adauga-topic-nou/forum/'.$fid.'-'.seo($finfo[2]).'">Adaugă topic nou</a>'.$div[0];
require'f_jos.php';