The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
What was the point in making us register variables?
What was the point in making us register variables?
To me it is nothing but a pain in the rear end. When you want to register a variable to pull in your template you have to register it in every template that is around yours. For instance I am trying to use Code:
{vb:raw modcpdir} Why should it be that stupid. That is tons of extra code we shouldn't have to type. I remember when you could just use Code:
$modcpdir Code:
{vb:raw modcpdir} Code:
$templater->register('modcpdir', $modcpdir); Code:
vB_Template::preRegister('showthread',array('modcpdir' => $modcpdir)); vB_Template::preRegister('postbit_legacy',array('modcpdir' => $modcpdir)); Just to return $modcpdir is totally insane. |
#2
|
|||
|
|||
I think the reasons for it is security.
|
#3
|
|||
|
|||
Nah as far as I know you don't have to register it for the outer templates. You just pre-register variables when you need to use the variable inside of that template. You don't need to go through it's hierarchy registering it for each parent template.
For example I had to pre-register my custom header template for the 'header' template. Then any custom variables I wanted to use inside my custom template I just registered directly for that. I didn't have to register them for the 'header' template too. The thing I did find though which seemed senseless to me is that if you register your variables for the same custom template in more than one place for example I registered the code for an avatar in one plugin and the rest of my variables in another plugin. Then I found that I needed to re-register those variables. i.e. I found that because I had called the create/render lines for my template again it had unregistered the variables I had already registered. Now that certainly confused me lol. |
#4
|
|||
|
|||
I preregister them in my global.php file
that way you wont have to add that line to a million files be warned though, some actions dont include the global.php |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|