![]() |
|
|
Mod Options |
Embed PHP in Templates Details »»
|
|||||||||||||||
|
Embed PHP in Templates
Developer Last Online: May 2007
This modification is in the archives.
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:
Just make sure that the variable to the left of the = and the variable right after the ?> match. Note that the entire <? and ?> tag itself will be stripped from the final 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. Download Now Only licensed members can download files, Click Here for more information. Show Your Support
No members have liked this post.
|
|||||||||||||||
Similar Mod
|
||||
| Mod | Developer | Type | Replies | Last Post |
| Advanced Templates: Dynamic Templates Changing according to different conditions | Logician | vBulletin 2.x Full Releases | 312 | 24 Apr 2005 19:20 |
| Comments |
|
#2
|
|||
|
|||
|
Admin CP:
No members have liked this post.
|
|
#3
|
|||
|
|||
|
The result:
No members have liked this post.
|
|
#4
|
||||
|
||||
|
I'm definately going to use this when I get back
Thanks for the hack filburt!No members have liked this post.
|
|
#5
|
||||
|
||||
|
Wow, this leaves all the template conditional hacks in the dust. I might even install this one!
Great job, filburt!
__________________
Along with Zachery, I make releases as GeekyDesigns. Please do not PM or IM me for support. No members have liked this post.
|
|
#6
|
|||
|
|||
|
Very nice filby! Is this efficient?
__________________
[Signature Goes Here] No members have liked this post.
|
|
#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...
No members have liked this post.
|
|
#8
|
||||
|
||||
|
What are the limitations on the use of PHP ?
- miSt
__________________
Dean Clatworthy - Web Developer/Designer No members have liked this post.
|
|
#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.
__________________
[Signature Goes Here] No members have liked this post.
|
|
#10
|
||||
|
||||
|
Thank you very much... i try to use this script
No members have liked this post.
|
|
#11
|
||||
|
||||
|
N9ne - its called a ternary operator i believe
![]() I'm very interested to see how this develops as IMO i think we'll see a lot of PHP errors popping up now on vBulletin.org due to poor PHP coding in the templates ![]() - miSt
__________________
Dean Clatworthy - Web Developer/Designer No members have liked this post.
|
|
#12
|
|||
|
|||
No members have liked this post.
|
|
#13
|
||||
|
||||
|
awesome! will install! i've been wanting this for awhile now!
No members have liked this post.
|
|
#14
|
||||
|
||||
|
nice work
All-the-vb click install No members have liked this post.
|
|
#15
|
|||
|
|||
|
Pseudo-code of what it does:
1. Find every occurance of <? and ?> (and what's inbetween them) 2. For each occurance, make every variable within in the global scope, and then eval what's in the occurance 3. Remove the original occurances from the template. No members have liked this post.
|
![]() |
«
Previous Mod
|
Next Mod
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Mod Options | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 14:24.




Thanks for the hack filburt!

