View Full Version : Have a module pull X number or thread titles?
TrickyD
04-21-2005, 02:40 AM
I'd like something like this site (http://forums.operationsports.com/vBulletin/cmps_index.php) has where their module pulls a center number of thread titles and displays them.
Has anyone here done this or would be willing to tell me how to accomplish it?
I've played around a bit, but haven't had any success.
Thanks in advance.
LEAD_WEIGHT
04-21-2005, 04:24 AM
Which Module is it this one »New At Operation Sports at the link mention :confused:
U could just ask the webmaster or right-click to get general thinking :D
TrickyD
04-21-2005, 05:02 AM
"New At Operation Sports" yep that part.
I tried grabbing the source code, but I think it goes a lot deeper than that.
I will try sending them an email, but I figured someone on here may have even told them how to do it or perhaps has an effecient way as well.
Thanks!
Frankenberrie
04-21-2005, 09:57 AM
I would use this on most of my sites if released..
fossen
04-21-2005, 08:36 PM
I'm the guy that hacked that together, but it's nothing very fancy.
There's a content.php, and then a content module.
The section in the content.php that pulls those thread titles is this:
//Now, our news
$newsContent = "";
$newslimit = "LIMIT 15";
$counter = 0;
$getnews = $DB_site->query("
SELECT thread.threadid, thread.title, replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=replycount, replycount+1, views) AS views, forumid, post.postid, pagetext, allowsmilie
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid)
$deljoin
WHERE forumid IN('107') AND thread.visible = 1 AND thread.open != 10 $notdeleted
GROUP BY post.postid
ORDER BY postdateline DESC
$newslimit");
while ($news = $DB_site->fetch_array($getnews))
{
$counter++;
if ($counter <= 15)
{
$newsContent = $newsContent."<tr><td valign='top'><B>· </B></td><td><strong><a href=$vboptions[bburl]/showthread.php?t=$news[threadid]>$news[title]</a></strong></td></tr>";
}
}
$DB_site->free_result($getnews);
It's all hardcoded and nasty, and I'm quite sure I stole at least the base of the code from elsewhere. :)
TrickyD
04-21-2005, 09:08 PM
thanks Fossen I, and I'm sure others too, deifnitely appreciate it.
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.