I've been curious for awhile on how to have a simple column to the left or right on vBindex displaying just the titles from a forum (say, a "Review" forum) and using it on the main page to attract attention to that particular forum. I'm not sure if this has been posted here before, but here's nothing.
It's more or less the news code already embedded in NTLDR's code from Teck, but I'll go ahead and post up how I did it anyway for those of you that were curious: [instead of having to install a large, bulky article archive]
In vbindex.php, find
PHP Code:
// news (based on code by TECK)
// -------------------------
Above it, add:
PHP Code:
$articleforum = "2";
$articleposts = "10";
$maxarticletitlechars = "22";
// ARTICLE (based on code by TECK/NEWS/VBINDEX)
// -------------------------
$articlequery=$articlequery=$DB_site->query("SELECT thread.*,threadpost.pagetext AS pagetext FROM thread LEFT JOIN post AS threadpost ON (thread.tpostid = threadpost.postid) WHERE forumid = '$articleforum' ORDER BY thread.dateline DESC LIMIT $articleposts");
while ($article=$DB_site->fetch_array($articlequery)) {
$articlethreadid=$article[threadid];
$articleusername=$article[postusername];
$articleuserid=$article[postuserid];
$comments=$article[replycount];
if ($maxarticletitlechars!=0) {
if (strlen($article[title]) > $maxarticletitlechars) {
$article[title] = substr($article[title],0,$maxarticletitlechars);
$article[title] .= "..";
}
}
$articletitle="<a href=\"$bburl/showthread.php?threadid=$articlethreadid\">$article[title]</a>";
// end avatar
eval("\$articlebits .= \"".gettemplate('home_articlebit')."\";");
}
eval("\$article = \"".gettemplate('home_article')."\";");
// -------------------------
// end article
Set $articleforum as the forumID of the particular forum you're after for topics.
Set $articleposts as how many topics you'd like to display
Set $maxarticletitlechars to how many characters you'd like the subject to display [useful if you're in tight table quarters and want to make your topic look clean].
Add two templates, home_article and home_articlebit:
In
home_article:
PHP Code:
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center">
<tr>
<td align="left"><img src="images/left2.gif"></td>
<td align="center" width="100%" background="images/catbg2.gif" valign="bottom"><b><smallfont>reviews</smallfont></b></td>
<td align="right"><img src="images/right2.gif"></td>
</tr></table>
<table cellpadding="0" cellspacing="0" border="0" bgcolor="{tablebordercolor}" width="100%">
<tr>
<td>
<table cellpadding="4" cellspacing="1" border="0" width="100%"><tr><td bgcolor="{firstaltcolor}" align="left">
$articlebits
</td></tr>
</table>
</tr>
</table>
Just noticed in the template above -- my layout uses the left/right/background table header graphics. You may have to adjust this to match your layout.
And add the second template:
In
home_articlebit:
PHP Code:
<smallfont>
-$articletitle<br>
</smallfont>
Modify the template where you'd like this to display on vBIndex [whether it be in the header, footer, home itself] and add..
.. to the template. Load up your vBIndex and if there were existing posts already in the forum, they should begin displaying. Just thought I'd post this in case anyone was curious.

Now it's your job to keep everything on topic. :P