vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to make $vbulletin->wol_spiders available? (https://vborg.vbsupport.ru/showthread.php?t=106515)

mikelbeck 01-28-2006 01:13 AM

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?

Paul M 01-28-2006 04:26 AM

You have to add "wol_spiders" to the list of special templates. AFAIK, This requires a fie edit.

harmor19 01-28-2006 04:36 AM

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

PHP Code:

$specialtemplates[] = 'wol_spiders'


Paul M 01-28-2006 05:00 AM

I'm pretty sure they are built before any hooks exist, you have to add that line to the bottom of config.php.

harmor19 01-28-2006 05:15 AM

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?

mikelbeck 01-28-2006 01:49 PM

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?

mikelbeck 01-29-2006 11:35 PM

Anybody?

Andreas 01-29-2006 11:41 PM

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.

mikelbeck 01-29-2006 11:44 PM

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.

Andreas 01-29-2006 11:46 PM

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


All times are GMT. The time now is 10:40 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.01187 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_php_printable
  • (5)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