vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Latest Threads on all pages? (https://vborg.vbsupport.ru/showthread.php?t=122120)

Blindchild02 07-25-2006 08:07 PM

Latest Threads on all pages?
 
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:
PHP Code:

$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:

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

Quote:

Originally Posted by Blindchild02


Thank you! great job

brandondrury 09-13-2006 07:08 PM

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


All times are GMT. The time now is 07:13 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01708 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete