vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Plugin System Design Hole (https://vborg.vbsupport.ru/showthread.php?t=109399)

Trigunflame 03-03-2006 10:49 PM

Plugin System Design Hole
 
Am I the only one thats noticed you cant use a plugin to modify the $specialtemplates via plugin prior to their first call through init.php

This means regardless, I have to use atleast 1 query if I have anything extra that I need for the hack ie. a datastore item; that could have otherwise been fetched on the initial run.

Gotta love plugins.

ps. Yes I know plugin code is stored in the datstore itself which would present the flawed logic of

"Cannot modify specialtemplates prior to init due to the fact the plugin code for the specified hook has to be fetched before it can be evald into modifying anything."

Thus the answer would seem that plugins need to be stored somewhere other than the datastore; so it can be used prior to init.php

Xenon 03-03-2006 11:51 PM

check through Andreas' hacks, you are not the only one ;)

Marco van Herwaarden 03-05-2006 10:54 AM

See for discussion: CODERS PLEASE DISCUSS!!! Pre-Datastore modifications with XML-files (UPDATE 28-7)

PS A finished implementation is now not released by Andreas anymore, Brad has taken over this one: [developers] Custom datastore support for products

Paul M 03-05-2006 11:48 AM

There are many ways to get round it - the easiest being to add a line at the bottom of config.php.

Personally I think you could just use the XML system that bitfields, cpnav etc use - it just looks for xml files of the form datastore_xxxx.xml

Inside those XML files is

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<datastore product="xxxxxxx">
        <script>
                <load>spiders_wol</load>
                <load>other_item1</load>
        </script>
        <script name="zzzzzzz">
                <load>other_item2</load>
                <load>other_item3</load>
        </script>
</datastore>

The product is identified in the datastore tag.

The script tag 'name=' is checked against "THIS_SCRIPT" and if matched, all the datastore items specified in load tags are loaded. If the script tag has no name parameter then it is always processed. You no longer need a $specialtemplates array at all then, since vbulletin would have a default database_vbulletin.xml

Just an idea, allthough I've actually thought of doing this for myself to test it, but not got round to it yet.


All times are GMT. The time now is 01:59 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.01022 seconds
  • Memory Usage 1,719KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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