Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2011, 09:07 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Vbcms global_start

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
PHP Code:
$template_hook['headinclude_javascript'] .= 'test'
Reply With Quote
  #2  
Old 09-14-2011, 10:43 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not 100% certain, but try global_bootstrap_init_start.
Reply With Quote
  #3  
Old 09-14-2011, 11:02 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've already tried all global hook
Reply With Quote
  #4  
Old 09-14-2011, 11:18 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It turns out global_bootstrap_init_start was too early, but it seems to work for me using global_bootstrap_init_complete.
Reply With Quote
  #5  
Old 09-14-2011, 11:20 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will re-try but are sure that you try this?
PHP Code:
$template_hook 
Reply With Quote
  #6  
Old 09-14-2011, 11:33 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I tried your code:

PHP Code:
$template_hook['headinclude_javascript'] .= 'test'

and then in the html I got this:
Code:
	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.
Reply With Quote
  #7  
Old 09-14-2011, 11:38 AM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're rigth man this code work very well
PHP Code:
$template_hook['headinclude_javascript'] .= 'test'
but if put my code (longer) with some conditionals added doesn't work maybe is the conditionals?

--------------- Added [DATE]1316007000[/DATE] at [TIME]1316007000[/TIME] ---------------

Yes confirm that the conditionals doesn't work
here there is my code
PHP 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
Reply With Quote
  #8  
Old 09-14-2011, 12:31 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 09-14-2011, 12:32 PM
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Posts: 829
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

FOUND! if ($show['guest']) doesn't work in cms i will try "is membe of"

--------------- Added [DATE]1316007455[/DATE] at [TIME]1316007455[/TIME] ---------------

"is member of 1" is the only solution i hope that this can help other people with this problem
THANKS FOR THE HELP
Reply With Quote
Reply


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 11:03 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.04165 seconds
  • Memory Usage 2,245KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_code
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete