<?php
$titlu='Sitemap forum';
require'f_sitemap.php';
echo sitemap($adresasite[0].'/forum','Forum');
$categorii=$conn->query('SELECT`id`,`nume`FROM`forum_categorii`ORDER BY`pozitie`,`id`');
while($categorie=$categorii->fetch_row())
{
$y2=1;
$z2=1;
echo sitemap($adresasite[0].'/forum/categorie/'.$categorie[0].'-'.seo($categorie[1]),'Forum, categoria '.htmlspecialchars($categorie[1]));
$forumuri=$conn->query('SELECT`id`,`nume`FROM`forum_forumuri`WHERE`cid`="'.$categorie[0].'"&&`clid`="0"ORDER BY`pozitie`,`id`');
while($forum=$forumuri->fetch_row())
{
if(ceil($y2/$pepagyna)>$z2)
{
$z2++;
echo sitemap($adresasite[0].'/forum/categorie/'.$categorie[0].'-'.seo($categorie[1]).'/pagina/'.$z2,'Forum, categoria '.htmlspecialchars($categorie[1]).' - pagina '.$z2);
}
$y3=1;
$z3=1;
echo sitemap($adresasite[0].'/forum/forum/'.$forum[0].'-'.seo($forum[1]),'Forum '.htmlspecialchars($forum[1]));
$topicuri=$conn->query('SELECT`id`,`nume`FROM`forum_topicuri`WHERE`fid`="'.$forum[0].'"&&`urcat`="1"ORDER BY`activitate`DESC,`id`');
while($topic=$topicuri->fetch_row())
{
echo sitemap($adresasite[0].'/forum/topic/'.$topic[0].'-'.seo($topic[1]),'Topic '.htmlspecialchars($topic[1]));
$postarile=ceil(($conn->query('SELECT COUNT(*)FROM`forum_postari`WHERE`tid`="'.$topic[0].'"')->fetch_row()[0]+1)/$pepagyna);
for($postari=1;$postari<$postarile;$postari++)
{
echo sitemap($adresasite[0].'/forum/topic/'.$topic[0].'-'.seo($topic[1]).'/pagina/'.($postari+1),'Topic '.htmlspecialchars($topic[1]).' - pagina '.($postari+1));
}
}
$topicuri=$conn->query('SELECT`id`,`nume`FROM`forum_topicuri`WHERE`fid`="'.$forum[0].'"&&`urcat`="0"ORDER BY`activitate`DESC,`id`');
while($topic=$topicuri->fetch_row())
{
if(ceil($y3/$pepagyna)>$z3)
{
$z3++;
echo sitemap($adresasite[0].'/forum/forum/'.$forum[0].'-'.seo($forum[1]).'/pagina/'.$z3,'Forum '.htmlspecialchars($forum[1]).' - pagina '.$z3);
}
echo sitemap($adresasite[0].'/forum/topic/'.$topic[0].'-'.seo($topic[1]),'Topic '.htmlspecialchars($topic[1]));
$postarile=ceil(($conn->query('SELECT COUNT(*)FROM`forum_postari`WHERE`tid`="'.$topic[0].'"')->fetch_row()[0]+1)/$pepagyna);
for($postari=1;$postari<$postarile;$postari++)
{
echo sitemap($adresasite[0].'/forum/topic/'.$topic[0].'-'.seo($topic[1]).'/pagina/'.($postari+1),'Topic '.htmlspecialchars($topic[1]).' - pagina '.($postari+1));
}
$y3++;
}
$y2++;
}
}
echo$x2;
require'f_fun.php';