I am trying to create a module in vBadvanced showing the last comments, based on recent thread module. but I bdo not get it to work
PHP Code:
($hook = vBulletinHook::fetch_hook('vba_cmps_module_recthreads_start')) ? eval($hook) : false;
$recthreadcount = 0; // set a counter for things like adding something at the bottom of this module.
$threads = $db->query_read("
SELECT $rtrating_fields threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, thread.lastpostid, pollid, thread.forumid, thread.open, sticky
$rthread_fields
FROM " . TABLE_PREFIX . "thread as thread
$rthread_join
WHERE open != 10
AND thread.visible = 1 " .
iif($mod_options['portal_threads_cutoffdate'],
'AND thread.lastpost > ' . (TIMENOW - $mod_options['portal_threads_cutoffdate'] * 86400)
) .
iif($ignusers,
' AND thread.postuserid NOT IN(' . $ignusers . ')'
) . "
$vba_threads_condition
ORDER BY $mod_options[portal_threads_orderby] $mod_options[portal_threads_direction]
LIMIT 10
");
$mods['threadcount'] = $db->num_rows($threads);
/////// add me
$comment = $db->query_read("SELECT pagetext FROM " . TABLE_PREFIX . "post where postid = ".$thread[lastpostid]."
LIMIT 10
");
I do not how to call thread.lastpostid
mmm...any help or idea??