The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Loading Template Contents into Plugin
I am in the process of trying to upgrade a plugin of mine for vb4 and I'm trying to reproduce the effect of the following code:
PHP Code:
I have tried two different things: PHP Code:
and: PHP Code:
The latter just shows the commas and the former shows something resembling the below: Code:
# Hello $final_rendered = ' ' . vB_Template_Runtime::fetchStylevar("dirmark") . ' ' . $loggedin['musername'] . '' . $loggedin['invisiblemark'] . '' . $loggedin['buddymark'] . ' # ';Hello $final_rendered = ' ' . vB_Template_Runtime::fetchStylevar("dirmark") . ' ' . $loggedin['musername'] . '' . $loggedin['invisiblemark'] . '' . $loggedin['buddymark'] . ' '; I'm probably just missing something really obvious but sometimes you get to the point where you just can't see the answer lol. It's not an issue with registering variables because it does output (another plugin uses this array to replace the one that is outputted). |
#2
|
||||
|
||||
Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide
|
#3
|
|||
|
|||
I've read that thread a few times (before posting this) but I'm not sure it actually helps my situation.
I've just tried registering the variable as a seperate variable (which isn't what I want to do - I want to replace the one that's already getting displayed - hence no template edits) and that still didn't work. It seems that the output of: PHP Code:
As I said I do register the variables (in another plugin i.e. once the variable has finished being set). Though in the final thing I just want to replace the existing $activeusers variable without having to make a template change. |
#4
|
||||
|
||||
Well, if you look at the template forumhome_loggedinuser, it needs the variable $loggedin. You have done nothing to register that variable for use in the template.
PHP Code:
|
#5
|
|||
|
|||
Ah, I think that's the breakthrough I needed. It seems to have worked from the quick test I did.
I had made the assumption I didn't need to register any existing variables because I thought they would already be registered (otherwise they wouldn't work in the first place). Now I know that I'll need to re-register them in that sort of situation. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|