The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Problem with inserting a variable into a template
hello i have this code and works great but i have to add "{vb:raw login_panel}" to the header template
PHP Code:
PHP Code:
someone that could help me? Or has another way to do it? |
#2
|
|||
|
|||
I think the problem is that the template cache contains php code, and you're tacking on html and css, which doesn't run as php code of course. Try this:
PHP Code:
|
#3
|
||||
|
||||
It works great but now i'm trying to add it to the begin of the template
I tred this but doesn't work PHP Code:
|
#4
|
|||
|
|||
You can look at the compiled template in the database: the problem is that it starts like this:
Code:
$final_rendered = '<div class="above_body"> So that wipes out anything you add to the $final_rendered variable before that. So try this instead: Code:
$replace = '$final_rendered = \'' . addcslashes($login_panel.$login_panel_css.$login_panel_javascript, "'\\") . '\' . '; $vbulletin->templatecache['header'] = substr_replace($vbulletin->templatecache['header'], $replace, 0, 17); |
#5
|
||||
|
||||
works great thanks
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|