vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Any ideas why this simple plug-in doesn't work in 3.8? (https://vborg.vbsupport.ru/showthread.php?t=229886)

Razasharp 12-10-2009 12:02 AM

Any ideas why this simple plug-in doesn't work in 3.8?
 
It gets the latest threads from certain forums, works fine in 3.7 but not 3.8.

hook location - forumhome_start

Quote:

$threads = $vbulletin->db->query_read("
SELECT threadid, title
FROM " . TABLE_PREFIX . "thread
WHERE sticky=0 AND visible=1 AND (forumid = '45' OR forumid = '135' OR forumid = '136')
ORDER BY dateline DESC
LIMIT 5
");

$latestthreads = "<ul>\n";

while ($thread = $vbulletin->db->fetch_array($threads))
{
$latestthreads .= ' <li><a href="showthread.php?' . $session['sessionurl'] . 't=' . $thread['threadid'] . '">' . $thread['title'] . '</a></li>
';
}

$latestthreads .= '</ul>';

$vbulletin->db->free_result($threads);
unset($thread);
And then just use $latestthreads in the template to get it.

Any ideas why it doesn't work in 3.8?

kh99 12-10-2009 12:58 AM

I'm not familiar with 3.7, but I tried it in 3.8 and it works for me. Where are you putting the variable?

Razasharp 12-10-2009 12:59 AM

In the header template :-/

kh99 12-10-2009 01:01 AM

Yeah, that's why - header is parsed in global.php before that hook is called.

Razasharp 12-10-2009 01:03 AM

Any ideas how I can get it to work? I don't mind editing the files if I have to..

kh99 12-10-2009 01:06 AM

You could try using a hook that comes before that - global_start maybe.

ETA: but if you do that you probably want to check THIS_SCRIPT and only do it if it's 'index' (as it is set in forum.php).

Razasharp 12-10-2009 01:09 AM

Thanks!!!!!!!!!! that works! :D


All times are GMT. The time now is 06:55 PM.

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.01864 seconds
  • Memory Usage 1,717KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete