The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
PHP Help with widgets
Hey all,
im trying to code something that will echo text and vars into a widgts, while using echo it works but it outputs at the begining of the page instead of inside th wigit it self, could you try and assit me in altering the code so it would work? PHP Code:
|
#2
|
||||
|
||||
You cannot use echo in the widget. You need to assign all your output to the variable $output.
|
#3
|
|||
|
|||
so how do i assign those to a var and still keep the things i want to disaply inside dynamic?
|
#4
|
||||
|
||||
Not sure what you mean - like this?
PHP Code:
|
#5
|
||||
|
||||
well i would if i was you 2 ways i see this done
1) create all the var's in the widget as php then register them into a array and instead of using the default template, i would create my own then use that to display the var's. 2) create all the output as lynne said, and you add each line one at a time then in the end you assign it all to output then it displays in the default template but it takes ALOT of repetetive codeing. Personally i do both, but i made the WoW recruitment widget i used option 2, i created it all in php in the widget then at the end i turned it over to $output then it will get rendered on default template, but it requires all formatting to be done in php before $output. ----- Maybe you should download some widgets first and see how they are buildt.. There are several doing what your trying to achive there, just using other data than wow online players.. |
#6
|
|||
|
|||
Thanks!
i was able to use $output and it worked perfect! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|