I have make some changes of this hack,
Thanks for Firefly's idea. It's work better now.. I have test this new ver on my board.
http://www.kelvinlo.net/vbb/
Before --> 88 queries
Now --> 33 queries
Step 1: Change index.php & forumdisplay.php
Find this code in
BOTH files:
PHP Code:
// prepare template vars
if (!$showforumdescription) {
$forum['description']='';
}
Add the follow code after this:
PHP Code:
$threadtitle= $DB_site->query_first("SELECT threadid,title FROM thread WHERE forumid=$forum[forumid] order by lastpost DESC");
$forum['thread']=$threadtitle[title];
$forum['threadid']=$threadtitle[threadid];
$lastposttitle=$threadtitle[title];
$lastposttitle_all = $lastposttitle;
if (strlen($lastposttitle) > 30) {
$lastposttitle = substr($lastposttitle,0,28);
$lastposttitle .= "...";
}
Change the templates forumhome_lastpostby:
found this code:
PHP Code:
by <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a>
Add this after it:
PHP Code:
<br><b><a href="showthread.php?s=$session[sessionhash]&threadid=$forum[threadid]" title="$lastposttitle_all">$lastposttitle</a></b>