Yesterday at 07:40 PM NTLDR said this in Post #4 Firstly, you don't need to eval all those variables. Remember that the scope of all those variables is local to that function, this results in the problem of nothing showing:
PHP Code:
function showlast5posts($forumpath, $forumid){
global $DB_site;
$getlast5posts = $DB_site->query(" SELECT threadid, title
FROM thread
WHERE forumid = '".intval($forumid)"'
ORDER BY lastpost DESC
LIMIT 5");
The above is more like what you want. Also note that $templatesused only works before you have required global.php, so add the template along with the others at the top. Secondly I think using this method is very bad, especially if you have alot of forums as this adds one query per forum.
sorry about that.. i'm new to PHP myself, i thought u would've had to eval those variables in order to use them in templates...
i missed the global thing to, i get caught on that a lot, sorry about the false info