PDA

View Full Version : Latest Threads on all pages?


Blindchild02
07-25-2006, 08:07 PM
I REALLY need to find a way to get the top 5 - 10 latest replies on all pages

It's going on my sidebar which is on the right side, so it's in the footer, so i need to find a way to get the top 5-10 latest replies in the footer, so it shows up on all pages

tnguy3n
07-26-2006, 03:17 AM
Create a plugin for it at global_start or global_complete would do.

Blindchild02
07-26-2006, 06:13 AM
heh, any help on that?
I have no clue what to add in the plugin

tnguy3n
07-26-2006, 10:02 PM
Here goes the most basic one, without having forum mask or forums viewing permissions:
$lastposts = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "post WHERE visible = 1 ORDER BY dateline LIMIT 0,5");
while ($lastpost = $db->fetch_array($lastposts))
{
$lastpost['dateline'] = vbdate($vbulletin->options['dateformat'], $lastpost['dateline']);
$showlastposts .= "<a href=\"showthread.php?" . $vbulletin->session->vars['sessionurl'] . "p=$lastpost[postid]\" title=\"posted on $lastpost[dateline]\" />$lastpost[title]</a>";
}

put $showlastposts wherever you want to show the result.

Blindchild02
07-27-2006, 05:36 AM
didnt work :(

Electronic Punk
07-28-2006, 11:13 AM
I am after something simple like this aswell, but couldn't get the code to work, had a good play with it though but just ended up with a whitepage (ie an error somewhere) when i tried to load it.

Electronic Punk
07-31-2006, 08:42 AM
Here is my current code:

$latestforum = $db->query_first('SELECT title,threadid FROM ' . TABLE_PREFIX . 'thread ORDER BY dateline DESC LIMIT 0,5');

$latestforumposts .= "<a href=\"showthread.php?t=".$latestforum['threadid']."\">".$latestforum['title']."</a>";

But when I try to make it an array as you have above, it doesn't return any values :(

Anyone got any ideas?

If I use $db->query_first it is ok, if I use $db->query_read it goes nuts and will only show a white page :o

Blindchild02
07-31-2006, 11:18 PM
I just did this:
http://www.vbulletin.com/forum/showthread.php?t=158895

acarli
08-20-2006, 07:02 AM
I just did this:
http://www.vbulletin.com/forum/showthread.php?t=158895


Thank you! great job

brandondrury
09-13-2006, 07:08 PM
http://www.vbulletin.com/forum/showthread.php?t=158895

I just tried it. It wasn't updating. I'm not sure why, but I had well over 10 new threads that weren't being show with this script. These threads were spaced over the past 12 hours or so.

Ideally, there would be something that would instantly display the latest 10 or so replies.

Brandon

KW802
09-13-2006, 07:34 PM
Could just cheat... do some javascript to parse the output from external.php instead of a plugin.