The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Can I Output A PHP Widget In a HTML Widget or Allign PHP Output
Hi guys, I've got an existing PHP Direct Exec widget using the following code :-
PHP Code:
How would I display the output of that same radio_stats_martin.php in a Static HTML widget ? Thanks B16MCC. |
#2
|
|||
|
|||
I don't think you can. You can't run php as part of a static html widget. If the output never changes you could copy the output and paste it in an html widget. But if it's working the way it is, why would you want to change the widget type?
|
#3
|
|||
|
|||
OK Thanks. The reason was to do with formatting the output. I'll expand on what I'm trying to do and perhaps approach it from a different angle.
I have this code in a PHP widget. PHP Code:
The output is shown below. The php files are checking the status of 2 different shoutcast servers and outputting to my widget based on wether the server is broadcasting or not, so this output is dynamic. Basically I want to arrange the 2 outputs side by side rather than one below the other. The reason I asked about a HTML widget is because I could put the outputs into tables, or so I thought. As you've now confirmed I can't do that. Any help is greatly appreciated. Thanks for reading. B |
#4
|
|||
|
|||
Oh, OK. You can do that in a php widget. You can just do something like:
PHP Code:
If you wanted you could use a template, maybe like this: PHP Code:
Then create a radio_stats template with whatever html you want and put {vb:raw stats.martin} or {vb:raw stats.alex} wherever you want them. BTW, I don't know why I used $martin and $alex in the first one but a $stats array in the second one - you could do it either way in either example). |
#5
|
|||
|
|||
Thanks a lot. Those options are really useful.. I'll work something out from your example.
--------------- Added [DATE]1330099902[/DATE] at [TIME]1330099902[/TIME] --------------- Sorry to be a pain, I've looked at the template method but I'm a little confused. Could you give a little more detail on how I create this please ? I'm confused about wether the code goes in a php file or in the template ? --------------- Added [DATE]1330102316[/DATE] at [TIME]1330102316[/TIME] --------------- Nah, struggling coming up with the template method. I'm just posting again in hope that the thread will be highlighted again. Thanks. |
#6
|
|||
|
|||
Well eventually I got it looking how I want it. I've attached my code and a screen shot for anyone else it may help.
PHP Code:
Don't worry about the 'Current Song' text, that's actually a moving marquee. So that's why it looks a little odd on a screen grab. Thanks so much for your help. I'm learning a lot here, Cheers. |
#7
|
|||
|
|||
Thanks for posting your result.
Yeah, unfortunately I usually miss it when the auto-merge kicks in so I missed your previous questions. But to answer, the template method should have worked by putting all the code I posted in a php widget and creating the template using the Style Manager. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|