vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vbphrase for header plugin...or not (https://vborg.vbsupport.ru/showthread.php?t=157617)

d1150488 09-12-2007 01:50 AM

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.

Dismounted 09-12-2007 06:52 AM

Can you post up the code you are using?

d1150488 09-12-2007 11:18 AM

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.

Dismounted 09-12-2007 12:30 PM

Which hook location are you using?

d1150488 09-12-2007 01:55 PM

global_start

Paul M 09-12-2007 05:41 PM

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.

d1150488 09-12-2007 10:48 PM

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.

d1150488 09-14-2007 11:08 AM

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.

FullyTested 09-14-2007 01:09 PM

Try using the construct_phrase function...

$TestVar = construct_phrase('unread_x_nav_compiled');

Opserty 09-14-2007 04:22 PM

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); 



All times are GMT. The time now is 10:51 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.01066 seconds
  • Memory Usage 1,735KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete