execute('SELECT p.id, p.title, p.seotitle, p.level, COUNT(v.postcat) as bobo FROM category p LEFT JOIN articles v ON v.postcat = p.id WHERE p.level = '.$DB->qstr('1').' GROUP BY p.id'); if(!$rb) print $DB->ErrorMsg(); else while(!$rb->EOF) { $category[] = $rb->fields; $rb->MoveNext(); } $rc = $DB->execute('SELECT * FROM articles ORDER BY postid DESC LIMIT 12'); if(!$rc) print $DB->ErrorMsg(); else while(!$rc->EOF) { $articles[] = $rc->fields; $rc->MoveNext(); } $smarty->caching = $caching; $smarty->assign('category',@$category); $smarty->assign('articles',@$articles); include ('includes/menu.php'); $smarty->display('links.php'); $smarty->display('footer.php'); $DB->Close(); ?> Top