assignInclude("BODY", $templatecache['guides'], T_BYVAR); eval($templatecache['phpinclude']); $tpl->prepare(); $tpl->assignGlobal("VERSION",$miraversion); noads(); $tpl->assign("TITLE", "Main Categories"); $subs = miraquery("SELECT s.id,s.name,s.short,count(m.id) as numarticles FROM sections s LEFT JOIN mainlist_cats m ON m.cat=s.id WHERE s.cat_status=1 AND s.status=1 GROUP BY s.id ORDER BY s.name",$db); while ($row = mira_fetch_array($subs)) { if ($row[numarticles]) { $tpl->newBlock("SECTIONS"); $tpl->assign("TOPIC", linkback($row[id],$row[short])); $tpl->assign("TITLE", stripslashes($row[name])); $tpl->assign("NUM", stripslashes($row[numarticles])); $newstuff = miraquery("SELECT m.id,m.title FROM mainlist AS m, mainlist_cats AS c WHERE m.id=c.id AND c.cat=".intval($row[id])." AND m.status>=2 GROUP BY m.id ORDER BY m.datechanged DESC LIMIT 2", $db); while ($row2 = mira_fetch_array($newstuff)) { $tpl->newBlock("ARTICLES"); $tpl->assign("TOPIC", $row[short]); $tpl->assign("ARTICLEID", $row2[id]); $tpl->assign("ATITLE", stripslashes($row2[title])); } } } $screencontent = $tpl->getOutputContent(); echo $screencontent; if ($enable_cache and $cacheok) { $cache->save($screencontent); } } if ($debug) { echo ""; echo "$numqueries database queries total"; echo "
Execution time = ".elapsed($scriptexec_start)." seconds\n"; /*$varlist = get_defined_vars(); while (list($var,$val) = each($varlist)) { echo "$var => $val
\n"; }*/ echo "
"; } if ($enable_gzip) { new gzip_encode(); } ?>