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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2007, 01:50 AM
d1150488 d1150488 is offline
 
Join Date: Feb 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vbphrase for header plugin...or not

Hi all, i've tried to research and not ask too many stupid questions, but i've really struggled to get to the point of developing a hack/plugin, although i've managed a basic plugin, now i'm lost.

I've got a plugin which hooks into global_start and outputs to a var ($x), $x is called in the header section of the board. It contains a login form/information, however the $vbphrase for the message totals ect are not displaying, so i assume these are populated later than global_start.

Is there a more appropriate hook for me to use, or do you have any other advice to get arround the issue.

Really appreciate any help.

J.
Reply With Quote
  #2  
Old 09-12-2007, 06:52 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post up the code you are using?
Reply With Quote
  #3  
Old 09-12-2007, 11:18 AM
d1150488 d1150488 is offline
 
Join Date: Feb 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok for the purpose of the problem..

my plugin contains this type of code..

Code:
$info = $vbphrase[unread_x_nav_compiled];
in the header section i call....
Code:
$info
and the vbphrase will not show, presumably becuase it has not been created yet. All my other header stuff works great, so i would just like to know if there is another hook i could use other than global start?

Many Thanks

J.
Reply With Quote
  #4  
Old 09-12-2007, 12:30 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which hook location are you using?
Reply With Quote
  #5  
Old 09-12-2007, 01:55 PM
d1150488 d1150488 is offline
 
Join Date: Feb 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

global_start
Reply With Quote
  #6  
Old 09-12-2007, 05:41 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

global_start is called before the header is built, so the whatever you are trying to assign to $info must not exist. Please post the actual code, not similar examples.
Reply With Quote
  #7  
Old 09-12-2007, 10:48 PM
d1150488 d1150488 is offline
 
Join Date: Feb 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, that is an exact example, i want to assign $vbphrase[unread_x_nav_compiled] at global_start and it doesn't work I've got load of irrelevant code which works fine, Its the $vbphrase which doesn't work, hence the question.
Reply With Quote
  #8  
Old 09-14-2007, 11:08 AM
d1150488 d1150488 is offline
 
Join Date: Feb 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok i've changed my plugin, so it excludes everything else and i can post the exact code. As you will appreciate its the same, but i realize its easier to help if you see the full code. It hooks at global_start and just contains:

Code:
 
$TestVar = "Test Output = ";
$TestVar .= $vbphrase[unread_x_nav_compiled];
It is then called in the header section with:

Code:
 $TestVar
So i get only "Test Output =" as an output. The $vbphrase[unread_x_nav_compiled] is not displaying because i presume its populated later on than global_start? either that or i'm just being a complete idiot (which wouldn't be the first or last time )

If anyone can help, it would be greatly appreciated. J.
Reply With Quote
  #9  
Old 09-14-2007, 01:09 PM
FullyTested FullyTested is offline
 
Join Date: Aug 2007
Posts: 163
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try using the construct_phrase function...

$TestVar = construct_phrase('unread_x_nav_compiled');
Reply With Quote
  #10  
Old 09-14-2007, 04:22 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its probably because you need to set a value for X thats why it won't work. Try setting it to zero or something and seeing what happens. Something like this:
PHP Code:
$num '0';
$testvar construct_phrase('unread_x_nav_compiled'$num); 
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 03:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07325 seconds
  • Memory Usage 2,252KB
  • 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
  • (4)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete