The Arcive of vBulletin Modifications Site. |
|
Embed PHP in Templates Details »»
|
|||||||||||||||||||||||||
This hack lets you embed PHP code in templates. Simply add your code between a <? (not a <?php) and ?> tag and it will be eval'ed. All variables will be referenced in the global scope.
If you're using my Usergroup Tags in Templates hack then you're going to have an extraordinarily difficult time installing this hack. However the clever hacker can tell what has changed in this version. You can somewhat use this to do conditionals in templates. Theoretically, this will work: Code:
template... <? $myvar = ($condition ? $truevalue : $falsevalue); ?>$myvar ...more template... This hack also enhances the comments delimiting templates (if that option is turned on) to include the character count and PHP block count of the specified template. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Admin CP:
|
|
#3
|
|||
|
|||
|
The result:
|
|
#4
|
||||
|
||||
|
I'm definately going to use this when I get back
Thanks for the hack filburt!
|
|
#5
|
||||
|
||||
|
Wow, this leaves all the template conditional hacks in the dust. I might even install this one!
Great job, filburt! |
|
#6
|
|||
|
|||
|
Very nice filby! Is this efficient?
|
|
#7
|
||||
|
||||
|
I dont think effecient is the way to put it, its only as effecient as the code u put between the tags....if u just put <? ?> or <? // ?> its not gonna slow anything down a bit...
|
|
#8
|
||||
|
||||
|
What are the limitations on the use of PHP ?
- miSt |
|
#9
|
|||
|
|||
|
Mist, as far as I know, I don't think there are any, as the example that Filburt gives with the if condition statement looks like proper PHP so by the looks of that, a lot can be done.
|
|
#10
|
||||
|
||||
|
Thank you very much... i try to use this script
|
![]() |
|
|