|
PHP in Templates and Template Conditionals
|
|
05-27-2008, 11:34 AM
(This post was last modified: 04-28-2010 10:01 AM by Yumi.)
Post: #1
|
|||
|
|||
|
PHP in Templates and Template Conditionals
This is a relatively small plugin, but seems that a number of people wanted such a thing, so... here it is.
This plugin will allow you to use:
Here's an example of some of the functions that this can be used for - for example, you may use this code in your postbit: Code: {$post['user_details']}More info & Download (it's easier to keep one location up to date )
|
|||
|
05-27-2008, 11:38 AM
(This post was last modified: 05-27-2008 11:46 AM by mybbromania.)
Post: #2
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Huh... this is very useful.
// We can insert javascript code in templates... so, why not some php code ? Thank you so much. ![]() //Later: I think this should be included in the 1.4 version. "First they ignore you. Then they laugh at you. Then they fight you. Then you win." - Mahatma Gandhi
|
|||
|
05-27-2008, 01:45 PM
Post: #3
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
amazing Release
![]() Thanks Zinga []s, Claudio Tutorial: Jquery (by google API) with mybb (Prototype) Distinction between Paid/Free Plugins Threads |
|||
|
05-27-2008, 03:22 PM
Post: #4
|
|||
|
|||
RE: PHP in Templates and Template Conditionals This user has been denied support.
So this works without any hooks?
New MyBB plugin is "IPLH (IP Log History) v1.0". ![]() Vote for MyBB to add a Security section. |
|||
|
05-28-2008, 01:42 AM
Post: #5
|
|||
|
|||
RE: PHP in Templates and Template Conditionals
labrocca Wrote:So this works without any hooks?Explicitly, no. Gaining control of objects is a way to implicitly get "hooks". |
|||
|
05-28-2008, 02:00 AM
Post: #6
|
|||
|
|||
RE: PHP in Templates and Template Conditionals This user has been denied support.
I suck at objects..I just spent the day working on them though and learned a few things. I hope to be gain better OOP knowledge this upcoming year. It's the future of php of course.
Thanks for response Zinga. New MyBB plugin is "IPLH (IP Log History) v1.0". ![]() Vote for MyBB to add a Security section. |
|||
|
05-31-2008, 07:14 PM
Post: #7
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
thx zinga, you're beating one of the biggest weaknesses in mybb with this...
![]()
|
|||
|
08-15-2008, 12:44 AM
Post: #8
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Great Plugin! I have found it every useful.
www.maroonlife.com
|
|||
|
08-17-2008, 12:47 PM
Post: #9
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
Just a word about this...
This is a great plugin that halp a lot (I've even implemented something similar in one of my boards), but I don't think this will ever should be part of the normal releases. MyBB separate PHP coding from templates & themes designing in a great way, so you can enable someone (probably your designer) to edit the templates with no worry that he can hurt your board in an unrecoverable way (because he just can't). Unalike if you'll use a plugin such as this, anyone can edit your templates, probably will be able to edit any other file in your site with some code injections, so you have to be more careful with who you trust and you don't. Moreover, to implement such thing you'll probably have to run some regexes on each template, and this will get your board a bit slower (or much slower depending on the implementation, but I'm trust ZB). BTW, ZB (zinga burga), Why the PHP run slower? does the eval function run slower than normal code? (assuming you've used the eval function) Creativity is a drug I cannot live without.
|
|||
|
08-17-2008, 10:56 PM
Post: #10
|
|||
|
|||
|
RE: PHP in Templates and Template Conditionals
eval does run slower, primarily due to the fact that it can't precompile/cache the PHP code, but since all of this is eval'd anyway, it's not too much of a difference. eval does cause some overhead when you put an extra layer on it though. Also, ob_* functions are used, which isn't the most efficient either.
This plugin is mainly for convenience purposes. As stated, if someone does manage to gain access to the AdminCP (or modify the templates table), they've got the ability to execute arbitrary code. Plus it's recommended to stick PHP in the .php files rather than templates (for speed and security). |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help



)





This user has been denied support.
![[Image: 468x60_SF.gif]](http://supportforums.net/images/banners/468x60_SF.gif)
![[Image: 350x19.jpg]](http://mania-creative.com/src/banner/350x19.jpg)
![[Image: tstargermany.png]](http://www.mybbwebhost.com/u/tstargermany.png)
![[Image: igG319dTu71gT.png]](http://i.minus.com/igG319dTu71gT.png)