vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Get $specialtemplates via plugins? (https://vborg.vbsupport.ru/showthread.php?t=107441)

Milad 02-08-2006 04:36 AM

Get $specialtemplates via plugins?
 
Hi I'm coding a hack that appears in everypage and using datastore table.

I cann't get the serialized data via plugins.

it doesn't seem to be any chance to merge two $specialtemplates arrays

what do you know about that?

have you any idea?

I have one that to modify global.php and add:

PHP Code:

$specialtemplates  array_merge($specialtemplates, array('milad')); 

but I want to do this via plugin
???????????????

Rich 02-08-2006 10:54 AM

Hello,

I am fairly new to this, so I may be wrong, but wouldn't that be:

Code:

$specialtemplates = array(
        'milad',
);

You can add as many entries as you like by adding a new line below the first template listed in the array. It would look like this:

Code:

$specialtemplates = array(
        'milad',
        'another',
        'another1',
);


Andreas 02-08-2006 11:20 AM

You can't load datastore items through Plugins, as the Plugin-System is initialized after datastore items are loaded.

Paul M 02-08-2006 01:16 PM

Why can't you just use $vbulletin->datastore->fetch() then ?

Milad 02-09-2006 02:35 AM

I had been forced to use a single query, but really I'm not happy with this.

Thank you All

Dear Andreas
I'll ask in vb.com to get Plugin-System initialized before datastore items are loaded.

merk 02-09-2006 02:45 AM

Quote:

Originally Posted by Paul M
Why can't you just use $vbulletin->datastore->fetch() then ?

You can seriously break your forum if you use that function.

http://www.vbulletin.com/forum/bugs3...iew&bugid=1390

Milad 02-09-2006 02:47 AM

Yes I read it, so I avoid it and use a single query.

Paul M 02-09-2006 03:06 AM

Quote:

Originally Posted by merk
You can seriously break your forum if you use that function.

http://www.vbulletin.com/forum/bugs3...iew&bugid=1390

Surely that depends on where you call it. It you put the fetch in init_start or global_start than no datastore items should have been altered.

merk 02-09-2006 03:13 AM

I tried using it in global_start, it failed miserably.

Might work in init_start, but be aware the fetch() function will re-fetch certain items no matter what happens.

Milad 02-09-2006 04:53 AM

I can merge the new item with the old ones and re-fetch, I think it won't do any harm.

what do you think?

merk 02-09-2006 05:03 AM

I had far too many problems when using fetch() - its easier to write your own function to get datastore items until Jelsoft come up with a solution.


All times are GMT. The time now is 12:15 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.02304 seconds
  • Memory Usage 1,733KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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