[BETA] Speedy Templates 0.1.6

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
comuter
Registered User
Posts: 158
Joined: Mon Jan 16, 2006 2:08 pm

Re: [BETA] Speedy Templates 0.1.4

Post by comuter »

I have XS installed should I install this over XS or remove XS First?
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by ckwalsh »

This will replace XS. Rename your current template.php (the XS one) to template.php.xs and then save this as a new template.php.

Note that if you are depending on some of XS's special features for your site, such as automatic language replacement, they will not work anymore.
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by drathbun »

I found a few template coding errors after switching to this template engine... apparently XS does some other things in addition to fixing missing language strings. Frankly, I like having them missing, as I would rather fix the code once than have a fix applied each and every time a page is viewed.

Brainy, I have not had time to upload 0.1.4 and test yet. It will probably be a week or so at least.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by ckwalsh »

I am absolutely and utterly confused. I noticed that my cached files were running a lot slower than they should so I peppered a compiled template with lines to write the times since the template first started executing and got these results:

2.00271606445E-5
5.81741333008E-5
6.41345977783E-5
7.91549682617E-5
9.01222229004E-5
0.00477409362793
0.00478506088257

WHOA! What part of the code is causing that jump?

Turns out there was only one line between those two echo statements: ' <br clear="all" /> '. That should not be causing a huge jump like that.

Anyone have any ideas as to why this is happening? I'd love to hear them.

[EDIT]Right after I posted I finally plugged the correct search into google (I had tried almost everything I could think of) and found this blog post. After using output buffering, it seems that it is running a lot faster.

This makes me wonder what speed changes there are when gzip is enabled. It's definitely something I am going to check next round of tests.[/EDIT]
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
Mr. Spoonman
Registered User
Posts: 15
Joined: Thu Jul 08, 2004 5:57 am

Re: [BETA] Speedy Templates 0.1.4

Post by Mr. Spoonman »

Hi :)

Just installed your template.php and I think I found a "bug":
It doesn't work with the Split Topic Type Mod (http://www.phpbbhacks.com/download/1205).

The "Topics List Box" ({TOPICS_LIST_BOX} called in viewforum_body.tpl) won't show up in viewforum.php....works fine with xs...

Would be great If you could fix that :)
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by drathbun »

I would suggest finding out what's wrong with the other MOD, to be honest. In my experiments I have found that XS lets you get away with bad code. That means every time it renders a page it has to "fix" the bad code. Again. and again. :) I have been using the template switch as an excuse to go back through my code and fix some errors, which in the long run is better anyway.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by drathbun »

Brainy wrote:[EDIT]Right after I posted I finally plugged the correct search into google (I had tried almost everything I could think of) and found this blog post. After using output buffering, it seems that it is running a lot faster.
[/EDIT]
Is there an update released with this new code yet? or am I reading something incorrectly here...
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by ckwalsh »

I'm working on one, but I still have a couple things to work out in it.

There will be one in the next day or two.

[EDIT] Well, if I'm going to say I'm changing stuff, I might as well say what. I'm adding a feature so that when a template is compiled, the language strings (Starting with L_) are actually replaced with the placeholder in the template so they do not need to be echoed by php. There are also some small performance improvements.[/EDIT]
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by drathbun »

Brainy wrote:I'm adding a feature so that when a template is compiled, the language strings (Starting with L_) are actually replaced with the placeholder in the template so they do not need to be echoed by php.
Hm. Just to clarify, you are storing the language value in the compiled template? So instead of L_FORUMS you are storing the word "Forums"? That would probably be a problem for boards that support more than one langauge at the same time, wouldn't it? You would have to maintain a tpl_header_en and tpl_header_es and so on.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by ckwalsh »

drathbun wrote:
Brainy wrote:I'm adding a feature so that when a template is compiled, the language strings (Starting with L_) are actually replaced with the placeholder in the template so they do not need to be echoed by php.
Hm. Just to clarify, you are storing the language value in the compiled template? So instead of L_FORUMS you are storing the word "Forums"? That would probably be a problem for boards that support more than one langauge at the same time, wouldn't it? You would have to maintain a tpl_header_en and tpl_header_es and so on.
Yes and yes. There is a template for each language.

It also can be turned off by commenting out a line, so if people don't want it they can disable it.
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by drathbun »

So that would also mean that in addition to checking the tpl file for updates you'll have to check the language file for updates as well, and rebuild the cached template if the language file has updated, right?

I'm all for saving every nanosecond that can be saved, so this sounds like a good idea. :)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Mr. Spoonman
Registered User
Posts: 15
Joined: Thu Jul 08, 2004 5:57 am

Re: [BETA] Speedy Templates 0.1.4

Post by Mr. Spoonman »

drathbun wrote:I would suggest finding out what's wrong with the other MOD, to be honest. In my experiments I have found that XS lets you get away with bad code. That means every time it renders a page it has to "fix" the bad code. Again. and again. :) I have been using the template switch as an excuse to go back through my code and fix some errors, which in the long run is better anyway.
Thank you! I got it!
In functions_topic_list.php there is the following code:

Code: Select all

   $template->assign_var_from_handle('_box', $tpl);
	$res = $template->_tpldata['.'][0]['_box'];

	// restore template saved state
	$template->_tpldata = $sav_tpl;

	// assign value to the main template
	$template->assign_vars(array($box => $res));
_tpldata is part of the regular template.php and the xs-version of the template but it doesn't seems to be a part of the Speedy Template...but there IS a _data...
I renamed _tpldata to _data and changed the following code:

Code: Select all

$res = $template->_tpldata['.'][0]['_box'];
to

Code: Select all

$res = $template->_data['_box'];
...and now it works! :D
User avatar
Dog Cow
Registered User
Posts: 2499
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [BETA] Speedy Templates 0.1.4

Post by Dog Cow »

Hello Brainy, I haven't given you any feedback in awhile because I had stopped testing your template, but I downloaded 0.1.4 last night and tried it on my main site and it worked perfectly! No messed up pages or any errors.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: [BETA] Speedy Templates 0.1.5

Post by ckwalsh »

Great! How about version 0.1.5 that I just released?
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Re: [BETA] Speedy Templates 0.1.5

Post by drathbun »

Downloading... :)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Post Reply

Return to “[2.0.x] MODs in Development”