The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Var Plugin into template forumdisplay
I apologize for my bad English, we come to my problem
I created this plugin VB3 Hook: forum display_complete Code:
if ($_SERVER['PATH_TRANSLATED']) { $path = $_SERVER['PATH_TRANSLATED']; } else if ($_SERVER['SCRIPT_FILENAME']) { $path = $_SERVER['SCRIPT_FILENAME']; } else { } $path_head = substr($path, 0, (strlen($path) - 17)); $file = $path_head.'/head/'.$foruminfo[forumid].'.html'; if(file_exists($file)) { $head_forum = file_get_contents($file); } else { } Code:
<if condition='$head_forum'> <br /> $head_forum <br/> <else /> </if> <!-- / Asterix special header --> With vb4 I tried to change the code but not reported any results, the plug remained unchanged. Code:
<!-- Asterix Special header --> <vb:if condition="$head_forum"> {vb:raw head_forum } <vb:else />{vb:raw file} Pippo prova </vb:if> <!-- / Asterix Special header --> The $head_forum is no longer being charged and even the variable $ file. Why? Thanks |
#2
|
||||
|
||||
One of the big changes in vB4 is that you MUST register your variable for use in a template. It's basically like telling the system that you created a variable $head_forum that you want to use in template xxxxx. So, while rendering template xxxxx, you need to say "Oh, I've got a variable $head_forum that I want to use in here". You haven't done that. You are going to have to change your plugin to do this. See this tutorial along with several blog posts on vb.com about this subject - [HOW TO - vB4] Rendering templates and registering variables - a short guide. You will also have to register the variable file. Your template looks fine after you register the variables.
|
#3
|
||||
|
||||
thanks for the answer I try with the guide, but not create a new template as it uses forumdisplay
--------------- Added [DATE]1258574820[/DATE] at [TIME]1258574820[/TIME] --------------- Sorry for the double post, solved by adding the plugin Code:
vB_Template::preRegister('FORUMDISPLAY',array('head_forum' => $head_forum)); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|