Templating ... a simple guide

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
User avatar
Ptirhiik_
Registered User
Posts: 526
Joined: Tue Nov 18, 2003 8:35 am

Re: Templating ... a simple guide

Post by Ptirhiik_ » Thu Feb 05, 2004 6:59 pm

Using Editplus is a matter of ... opening it, that's all, and it is reliable : no modifications done by itself without asking anything and introducing errors in files, well though products and handy design, and so much more. Just the exact opposit of dreamweaver :). But anyway, use dreamweaver if you want, that's your choice ;).

DK
Registered User
Posts: 80
Joined: Fri Aug 31, 2001 1:46 pm
Location: Champaign, IL
Contact:

Re: Templating ... a simple guide

Post by DK » Fri Feb 06, 2004 12:15 am

Ptirhiik_ wrote:Using Editplus is a matter of ... opening it, that's all, and it is reliable : no modifications done by itself without asking anything and introducing errors in files, well though products and handy design, and so much more. Just the exact opposit of dreamweaver :). But anyway, use dreamweaver if you want, that's your choice ;).
Dreamweaver has never modified anything on me before. Maybe you're using an older copy or a um 'special' one ? :mrgreen:

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: Templating ... a simple guide

Post by Arty » Fri Feb 06, 2004 11:26 am

Please stop going offtopic. This thread is supposed to be for discussion of template system, not dreamweaver vs editplus thread.

Skeleton
Registered User
Posts: 47
Joined: Wed Feb 25, 2004 5:25 pm
Location: Dunno
Contact:

Re: Templating ... a simple guide

Post by Skeleton » Sun Apr 04, 2004 9:47 am

i would like to see a simple style put out which is highly commented teaching someone how to make a systle

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: Templating ... a simple guide

Post by Arty » Sun Apr 04, 2004 1:51 pm

There isn't any final style yet, so it can't be done. When phpBB 2.2 will be in beta then it is possible.

yonis
Registered User
Posts: 3
Joined: Mon Apr 12, 2004 5:33 pm

Re: Templating ... a simple guide

Post by yonis » Thu Apr 15, 2004 8:49 pm

Now, if I were to code something incorrectly in a template, is phpBB supposed to output any code at all or give me an error of some kind?

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: Templating ... a simple guide

Post by Arty » Fri Apr 16, 2004 9:48 am

That depends on error. If you have some <!-- BEGIN something --> without <!-- END something --> or <!-- IF --> without <!-- ENDIF --> then it will show error, but if you have a typo like <!-- INCLUDES somefile.tpl --> then it will just ignore it because INCLUDES is not a known tag.

MaXxX
Registered User
Posts: 3
Joined: Sun Mar 14, 2004 3:51 pm

Re: Templating ... a simple guide

Post by MaXxX » Sun Apr 25, 2004 8:49 am

Another question to the new templating scheme:
I see it now employs a way to include PHP code. Is it, however, safeguarded so that I can:
<!-- PHP -->
echo ('{loop.VARIABLE}');
<!-- ENDPHP -->
without worrying about quotes, backslashes, etc.?

In my hacking of 2.0.7, I added an "S|" modifier, to use {S|loop.VARIABLE} to force phpBB to run the variable through addslashes() before outputting it to the template.

Is something like this in 2.2 ?

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: Templating ... a simple guide

Post by Arty » Sun Apr 25, 2004 12:06 pm

For such code i suggest you use $this->_tpldata['loop'][$this->_loop_i]['VARIABLE']

MaXxX
Registered User
Posts: 3
Joined: Sun Mar 14, 2004 3:51 pm

Re: Templating ... a simple guide

Post by MaXxX » Sun Apr 25, 2004 12:41 pm

CyberAlien wrote:For such code i suggest you use $this->_tpldata['loop'][$this->_loop_i]['VARIABLE']
Well, that's a workaround. One that'll, sadly, fail, should I decide to use JavaScript and not PHP in my template:
<SCRIPT LANGUAGE="JavaScript1.2">
alert ('Hello {USERNAME}');
</SCRIPT>
... and the user happens to have an apostrophe in his nick. My {S|USERNAME} used to work in those cases quite nicely.

Seeing as there doesn't seem to be a ready and nice solution for this kind of situation in phpBB2.2, should I send it to the Requests box? Or am I too hasty? :)

Hmm, now that I think of it, I'd probably go for adding a couple more | modifiers. Like, H| for not-htmlspecialchars()-garbling and thus enabling pure HTML in variables that are usually given the safety treatment.

Post Reply