vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   plugin cannot set a variable for use with footer ... (https://vborg.vbsupport.ru/showthread.php?t=247464)

shri 07-28-2010 11:22 AM

plugin cannot set a variable for use with footer ...
 
I have this piece of code. The header works ok, the footer does not.

For some reason the $RightWidth variable does not seem to get set in the footer template.

Code:

if (stristr($_SERVER['REQUEST_URI'], 'calendar') === FALSE) {
                $MainWidth = '73%';
                $RightWidth = '23%';
  } else {
                $MainWidth = '100%';
                $RightWidth = '0%';
  }

vB_Template::preRegister('header',array('MainWidth' => $MainWidth));
vB_Template::preRegister('footer',array('RightWidth' => $RightWidth));

Any ideas?

Lynne 07-28-2010 02:55 PM

Could be you are using a hook that is evaled after the footer is evaled and thus the footer can't get the variable.

shri 07-28-2010 03:00 PM

Have turned debug on and used start_init and global_start ...

I've worked around this for now with a conditional that checks for the calendar script. Not idea... but for now, I'll have to live with this.

Some of the posts indicate that the footer might be unmodifable.

Lynne 07-28-2010 03:02 PM

You know, you could probably just use THIS_SCRIPT:
PHP Code:

if (THIS_SCRIPT == 'calendar')
.... 


shri 08-02-2010 03:59 PM

That is fine.. but it is a pain when you want variable width columns depending on the scripts.

Does anyone have ideas why variables might not be working? Turning of data store caches (xcache and filestore) to not seem to change the problem.


All times are GMT. The time now is 06:44 AM.

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.01134 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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