vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   if condition in the header template (https://vborg.vbsupport.ru/showthread.php?t=284224)

ohadpartuck 06-09-2012 04:48 PM

if condition in the header template
 
hi there,
I'm trying to display(or not display a button in my site).
I have located the button in the header template

PHP Code:

<vb:if condition="$display_sos"><button id="button_grdient">S.O.S</button></vb:if> 

when I do this
PHP Code:

<vb:if condition="1"><button id="button_grdient">S.O.S</button></vb:if> 

it gets displayed so the condition is ok .

the plugin who's responsible to deliver the variable is (under global_start):
PHP Code:

$display_sos 1;
vB_Template::preRegister('header',array('display_sos' => $display_sos)); 

i also tried this
PHP Code:

<vb:if condition="{vb:raw $display_sos}"><button id="button_grdient">S.O.S</button></vb:if> 

but got an error.

any ideas??
:D

kh99 06-09-2012 05:26 PM

Try your original code (that last example isn't right), but try using hook parse_templates for your plugin.

ohadpartuck 06-09-2012 07:56 PM

kh99 , you're the man!


All times are GMT. The time now is 05:09 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.00939 seconds
  • Memory Usage 1,724KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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