View Full Version : Vbcms global_start
Scanu
09-13-2011, 09:07 PM
Hi i need to load a plugin everywhere in the forum and in the CMS
Right now i used global_start as hook but don't work in the cms
What's the right hook?
This is the code that would be work
$template_hook['headinclude_javascript'] .= 'test';
I'm not 100% certain, but try global_bootstrap_init_start.
Scanu
09-14-2011, 11:02 AM
I've already tried all global hook
It turns out global_bootstrap_init_start was too early, but it seems to work for me using global_bootstrap_init_complete.
Scanu
09-14-2011, 11:20 AM
I will re-try but are sure that you try this?
$template_hook
Yes, I tried your code:
$template_hook['headinclude_javascript'] .= 'test';
and then in the html I got this:
var RELPATH = "";
var PATHS = {forum : ""}
// -->
</script>
<script type="text/javascript" src="http://10.0.0.4/forum4/clientscript/vbulletin-core.js?v=415"></script>
test
<link rel="alternate" type="application/rss+xml" title="Forums 4.1.5 RSS Feed" href="http://10.0.0.4/forum4/external.php?type=RSS2" />
But it did seem like the first time I did it it didn't work, so maybe there's some caching going on or something.
Scanu
09-14-2011, 11:38 AM
You're rigth man this code work very well
$template_hook['headinclude_javascript'] .= 'test';
but if put my code (longer) with some conditionals added doesn't work maybe is the conditionals?
--------------- Added 1316007000 at 1316007000 ---------------
Yes confirm that the conditionals doesn't work
here there is my code
if ($vbulletin->options['guest_warn_active'])
{
if ($show['guest'])
{
if ($vbulletin->options['guest_warn_cloasable_active']){if ($vbulletin->options['guest_warn_cookie_off']){
$template_hook['headinclude_javascript'] .= 'test3';
}
else {$template_hook['headinclude_javascript'] .= 'test2';
}
}
else
{
$template_hook['headinclude_javascript'] .= 'test4';
}}
}
All that is in the conditionals doesn't work in global_bootstrap_init_complete instad of global_start (the same code work perfectly), all is out of the conditionals work both. I will delete some code until i found the bad condition
Probably that's it. That hook if called from a function, so you need a global statement for any globals that you use (except the common ones like $vbulletin, $template_hook, $show, etc).
Edit: Sorry, I hadn't read your second post before I wrote that - it doesn't look like it needs any more global statements.
Scanu
09-14-2011, 12:32 PM
FOUND! if ($show['guest']) doesn't work in cms i will try "is membe of"
--------------- Added 1316007455 at 1316007455 ---------------
"is member of 1" is the only solution i hope that this can help other people with this problem
THANKS FOR THE HELP :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.