Ok już sobie poradzilem znalazlem identyczny temat na zagranicznym forum i podaje kod jak ktos by chcial zmodyfikowac swoje forum:
Zapytanie do bazy:
$lp_result = dbquery("SELECT post_id, t1.thread_id, thread_subject FROM ".$db_prefix."posts t1
LEFT JOIN ".$db_prefix."threads t2 ON t2.thread_id = t1.thread_id
WHERE t1.forum_id='".$data['forum_id']."' ORDER BY post_datestamp DESC LIMIT 1"
);
list($lp_post, $lp_thread, $lp_subject) = dbarraynum($lp_result);
I link do teamtu:
<a href='".BASEDIR."forum/viewthread.php?forum_id=".$data['forum_id']."&thread_id=$lp_thread' title='".trimlink($lp_subject, 50)."' class='side'>".trimlink($lp_subject, 35)."</a>
|