You said that you don't need an ELSEIF and that you can just do ELSE if you want, but is it possible to do ELSEIF, but not ELSE, like PHP does?
{ Posted as a new topic because posting to Stickies are not currently allowed }
Re: Templating ... a simple guide
- GPHemsley
- Registered User
- Posts: 1617
- Joined: Fri Apr 18, 2003 4:01 am
- Location: Long Beach, NY
- Contact:
Re: Templating ... a simple guide
Gordon P. Hemsley
The GP Factory
EasyMOD Support Rant
My MODs: Topic Type MOD | View Topic Title While Posting MOD
The GP Factory
EasyMOD Support Rant
My MODs: Topic Type MOD | View Topic Title While Posting MOD
Re: Templating ... a simple guide
How efficient is this new system? Because it seems like phpBB would have to convert the template if statements into PHP, then run them adding in an extra step. Though I guess that's one of the things which is cached?
Images in sigs! please.
- dhn
- Registered User
- Posts: 1518
- Joined: Wed Jul 04, 2001 8:10 am
- Location: Around the corner
- Contact:
Re: Templating ... a simple guide
The templates are cached in full php ready mode. The rough templates will only get touched and "recompiled" once when you change something in them.haravikk wrote:How efficient is this new system? Because it seems like phpBB would have to convert the template if statements into PHP, then run them adding in an extra step. Though I guess that's one of the things which is cached?
-
- Registered User
- Posts: 1546
- Joined: Wed Apr 09, 2003 8:44 pm
- Location: London, United Kingdom
Re: Templating ... a simple guide
Excuse me, Brief Overview!? How long is the full overview??
Anyway, looks great ( ), let me be the eight-hundred-and-ninety-second person to congratulate you on your amazing work ( ). I really can't wait to get started, but I'm gonna wait for a feature frozen release first.
Anyway, looks great ( ), let me be the eight-hundred-and-ninety-second person to congratulate you on your amazing work ( ). I really can't wait to get started, but I'm gonna wait for a feature frozen release first.
Rob
Re: Templating ... a simple guide
I think it's probably "safe" to start work on some templates. Obviously some vars may change here and there ... but it will give you some experience of working with 2.2.x and possibility give myself some feedback on issues which may arise.
-
- Registered User
- Posts: 40
- Joined: Thu Jan 24, 2002 7:14 pm
- Location: Leyland, Lancashire
Re: Templating ... a simple guide
So, what about included files? phpBB must keep a record of what templates are included in what other templates, otherwise, when you change a template that had been included in another template, the other template wouldn't change.
The viewforum template, for example, must include overall_header, overall_footer and the forum jump box, and could feasibly include any number of other templates. when you modify one of these templates, this template must have to be checked on every page view of viewforum (although I suppose if this process was too intense you could make it happen only, say, once every four or five seconds at the most), and this would require a record somewhere of every template that is stored within viewforum, which either means it's in the database (in which case there's an extra query on the page) or you've been really sneaky and put the info in the compiled template. That or you've just not done it, which would be a bit p00p :/
So, how've you done it? Tell us!
The viewforum template, for example, must include overall_header, overall_footer and the forum jump box, and could feasibly include any number of other templates. when you modify one of these templates, this template must have to be checked on every page view of viewforum (although I suppose if this process was too intense you could make it happen only, say, once every four or five seconds at the most), and this would require a record somewhere of every template that is stored within viewforum, which either means it's in the database (in which case there's an extra query on the page) or you've been really sneaky and put the info in the compiled template. That or you've just not done it, which would be a bit p00p :/
So, how've you done it? Tell us!
Then again...
Re: Templating ... a simple guide
The include tag actually calls a method in the template class. This method checks to see if the template to include has been compiled, if not it does so.
The present CVS requires the admin to manually set forced recompilation (on every page view). I've just added (back) an (optional ... defined in the Load ACP page) recompile when newer template is discovered on filesystem.
There are some complications to this such as updated template files existing on the OS when the DB is being used to store them. I need to (at some point soon) recheck where I was wrt handling this situation.
The present CVS requires the admin to manually set forced recompilation (on every page view). I've just added (back) an (optional ... defined in the Load ACP page) recompile when newer template is discovered on filesystem.
There are some complications to this such as updated template files existing on the OS when the DB is being used to store them. I need to (at some point soon) recheck where I was wrt handling this situation.
-
- Registered User
- Posts: 1546
- Joined: Wed Apr 09, 2003 8:44 pm
- Location: London, United Kingdom
Re: Templating ... a simple guide
Does the method detect for recurisve templates, eg where template A includes tempalte B which inlcudes Template A?
Rob
Re: Templating ... a simple guide
As far as i can see from current template.php it doesn't.Roberdin wrote:Does the method detect for recurisve templates, eg where template A includes tempalte B which inlcudes Template A?
Very efficient. I think this is THE most efficient system i've seen. Code in compiled templates is as optimized as it can be (unlike 2.0 where it was very unoptimized). And there is no useless overhead unlike in one other popular almost-free forum system that i'd better not mention.haravikk wrote:How efficient is this new system?
Formerly known as CyberAlien.
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts
Free phpBB styles | Premium responsive XenForo styles | Iconify - modern open source replacement for glyph fonts