![]() |
Let PHP Live! (Allow PHP code in templates)
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'] |
Interesting, Ill wait untill someones got this working though
|
Thanks for sharing.
|
Quote:
|
hm.... intresting..... installed....
|
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! |
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?
|
Quote:
Do you ? If you do, make sure you back up. |
awesome, i only tested with a simple echo statement but it worked like a charm :yesway:
|
Quote:
|
All times are GMT. The time now is 12:08 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|