Выводит одну тему а не пять. Что не так тут ?
<?php
$theme = DB::$dbs-
>queryFetch("SELECT * FROM
".FORUMS_THEME." ORDER BY
`activ` DESC LIMIT 5"
;
if (!empty($theme)) {
echo DIV_BLOCK;
$posts = DB::$dbs-
>querySingle("SELECT COUNT
(`id`) FROM ".FORUMS_POST."
WHERE `theme_id` = ? ", array
($theme['id']));
$post = DB::$dbs-
>queryFetch("SELECT * FROM
".FORUMS_POST." WHERE
`theme_id` = ? ORDER BY `time`
DESC LIMIT 5", array($theme
['id']));
$page = ceil(($posts /
$config['write']['forum_post']));
echo '<li><a href="'.HOME.'/
forum/'.$theme['forum_id'].'/'.
$theme['forumc_id'].'/'.$theme
['id'].'/">'.$theme['name'].'</a>
['.$posts.'] <a href="'.HOME.'/
forum/'.$theme['forum_id'].'/'.
$theme['forumc_id'].'/'.$theme
['id'].'/?p='.$page.'">[>>]</a></
li>';
[93] echo CLOSE_DIV;
}
?>