The Arcive of vBulletin Modifications Site. |
|
Let PHP Live! (Allow PHP code in templates) Details »»
|
|||||||||||||||||||||||||||
|
Let PHP Live! (Allow PHP code in templates)
Developer Last Online: Jul 2011
I got frustrated that the vBulletin template system limited me in this way so... I wrote a hack around it.
Just use <? <?php <?= as you would normally in the templates. I'd like to see PHP based templates in the future, vBulletin! <if> is useless if I can just type <? if ?> ! Things to Remember You cannot break up PHP blocks. <? if (0): ?> Hello!!! <? endif ?> will not work, and you'll get a nice error message about how it didn't. If it's really a concern for anyone, I can try to get it working. In my opinion, that's not a big deal. I think PHP support sans breaking up blocks in 10 lines of hack code is pretty nice, myself. That's a limitation of eval anyway ![]() Variables aren't always the same in PHP mode! While you can use $vboptions[bbtitle] in your main code and get it working, vBulletin is doing behind the scenes voodoo on stuff. To access $vboptions[x]: $GLOBALS['vbulletin']->options['x'] Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Interesting, Ill wait untill someones got this working though
|
|
#3
|
|||
|
|||
|
Thanks for sharing.
|
|
#4
|
|||
|
|||
|
Quote:
|
|
#5
|
|||
|
|||
|
hm.... intresting..... installed....
|
|
#6
|
|||
|
|||
|
Damn, could have used this when I was struggling to get some PHP scripts to work with 3.6 in the beginning, lol.
I'll still take this for a spin for when I next need to do some PHP stuff. Thanks! |
|
#7
|
||||
|
||||
|
I think, as probably do the vB Coding Team, that the ability to use PHP in Templates is a Security Risk. What if you've got an Administrator on your board who gets bored and decides to execute some harmful code?
|
|
#8
|
||||
|
||||
|
Quote:
Do you ? If you do, make sure you back up. |
|
#9
|
|||
|
|||
|
awesome, i only tested with a simple echo statement but it worked like a charm :yesway:
|
|
#10
|
||||
|
||||
|
Quote:
|
![]() |
|
|