Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2006, 01:13 AM
mikelbeck's Avatar
mikelbeck mikelbeck is offline
 
Join Date: Jul 2005
Location: 4C6F6E672049736C616E642C2
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to make $vbulletin->wol_spiders available?

How do I make $vbulletin->wol_spiders available for a plug-in that uses the global_start hook?
Reply With Quote
  #2  
Old 01-28-2006, 04:26 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have to add "wol_spiders" to the list of special templates. AFAIK, This requires a fie edit.
Reply With Quote
  #3  
Old 01-28-2006, 04:36 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you can do a plugin, I'm not sure what hook, maybe "cache_templates"?

PHP Code:
$specialtemplates[] = 'wol_spiders'
Reply With Quote
  #4  
Old 01-28-2006, 05:00 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm pretty sure they are built before any hooks exist, you have to add that line to the bottom of config.php.
Reply With Quote
  #5  
Old 01-28-2006, 05:15 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found this in global.php

PHP Code:
($hook vBulletinHook::fetch_hook('cache_templates')) ? eval($hook) : false;

// now get all the templates we have specified
cache_templates($globaltemplates$style['templatelist']);
unset(
$globaltemplates$actiontemplates$_get_edit_templates$_templatedo); 
Would adding $specialtemplates to the list in the "cache_templates" or "unset" function help make my code work?
Reply With Quote
  #6  
Old 01-28-2006, 01:49 PM
mikelbeck's Avatar
mikelbeck mikelbeck is offline
 
Join Date: Jul 2005
Location: 4C6F6E672049736C616E642C2
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem is I have a plug-in that runs from global_start. I find that wol_spiders doesn't exist at that point... I found some code from online.php that builds wol_spiders if it's not there, but I don't think that running that on every page load would be a good idea.

Any ideas?
Reply With Quote
  #7  
Old 01-29-2006, 11:35 PM
mikelbeck's Avatar
mikelbeck mikelbeck is offline
 
Join Date: Jul 2005
Location: 4C6F6E672049736C616E642C2
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody?
Reply With Quote
  #8  
Old 01-29-2006, 11:41 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Datastore Items can't be loaded via Plugins, as Plugins themselves are loaded from the datastore.

You'll have to edit the file, or, alternatively to save you from having to apply the change on every update: edit config.php.
Reply With Quote
  #9  
Old 01-29-2006, 11:44 PM
mikelbeck's Avatar
mikelbeck mikelbeck is offline
 
Join Date: Jul 2005
Location: 4C6F6E672049736C616E642C2
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the quick response.

Quote:
Originally Posted by Andreas
Datastore Items can't be loaded via Plugins, as Plugins themselves are loaded from the datastore.
Ah. Bummer.

If I were to put my script in a file and then include that in the plug-in code, would that get around this limitation? I suppose not...

Quote:
You'll have to edit the file
Which file?

Quote:
, or, alternatively to save you from having to apply the change on every update: edit config.php.
Ah, I think I'd like to avoid doing that.
Reply With Quote
  #10  
Old 01-29-2006, 11:46 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mikelbeck
If I were to put my script in a file and then include that in the plug-in code, would that get around this limitation? I suppose not...
No. As said, Plugins are loaded from the datastore - which is only be queried once, so you can't load datastore items through plugins - no matter what.


Quote:
Which file
The file which contains the hooks you've placed plugins that require the datastore item.
For a hook in global.php it would be ... guess it ... global.php
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:26 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06663 seconds
  • Memory Usage 2,255KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete