New template variables

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.2.x. If you need support for phpBB 3.2.x please visit the 3.2.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

New template variables

Post by Arty »

I have several suggestions for new template variables. All of then would allow style authors use non standard layouts.

1. Shorter text for all buttons that are available in localized imageset: Quote, Edit, Post Reply, etc..
Currently text for those buttons is too long, like "Reply with quote", making it impossible to use CSS background + language variable instead of putting translation to image. Adding those few text variables would make it possible to create styles that don't use translation at all, using text from language pack instead of image for buttons.

Here is full list of strings that are missing in language packs:
  • Forward
  • New PM
  • Send Reply
  • Locked
  • New Topic
  • Post Reply
  • PM
  • Edit
  • Quote
  • Report

2. Numeric values for dates/time. Currently post time is available only in text format selected by user, it would be great to make it available in raw numeric format too. It could be used in conjunction with javascript to create post layouts like this:
Image

Concerns:
  • Time zone. There are two sets of functions in Date class: ones that use local time and UTC, so its not an issue. Javascript will automatically get time zone from computer settings.
  • Localization. Its a tricky one. Text is already in language pack, but its in sub-array lang['datetime']['Jan'], so it can't be accessed by template. I'll think of a solution for it.


Note: I'm not asking to add them to subsilver/prosilver. These changes won't affect current styles, so there won't be any code changes, only few code additions. These changes are meant to allow style authors to create different styles, rather than being forced to use text images.

ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Re: New template variables

Post by ecwpa »

I would suggest a new variable in order to know if a post is the first post. I use a mod for that, but if its build in, theme designers would have a lot of fredom styling the first post, wich is usually important.
Slightly better English than it was in 2005, still improving :D

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

Re: New template variables

Post by Arty »

Good idea, added to list.

ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: New template variables

Post by ToonArmy »

http://tracker.phpbb.com/browse/PHPBB3-10387

Seems there is actually an ON_PAGE variable which maybe set.
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

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

Re: New template variables

Post by Arty »

Thanks! Removed from list.

Question about other requests: would it help if I made a new git branch, so you could see what exactly is required for these changes? I think it might help you decide if this is worth implementing.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: New template variables

Post by callumacrae »

Arty wrote:Question about other requests: would it help if I made a new git branch, so you could see what exactly is required for these changes? I think it might help you decide if this is worth implementing.
I think it's the kind of thing where if it was done, it would definitely be merged - there are advantages and no disadvantages that I can think of.
Made by developers, for developers!
My blog

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

Re: New template variables

Post by Arty »

First part (language variables for buttons): https://github.com/cyberalien/phpbb3/co ... 5fc5ebdbe4

Never mind second part, I've tried implementing it and its way too much code changes. I have an idea for 4.0 though: store all times in template rows as numbers, then in template engine use {TIME_VAR_NAME} instead of {VAR_NAME} and template will convert time to string, similar to how {L_ prefix works. It will reduce number of useless conversions and will allow style authors select which way they prefer to use time stamp. It should also affect loop level variables, like {postrow.TIME_POST_TIME} = {postrow.POST_TIME} converted to string

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: New template variables

Post by nickvergessen »

Mungo and I are working on language free button-images atm.

When we try to keep the design close to the buttons now, the text would be New<strong>topic</strong> Or we just "renew" it and use a normal string with two words and a space ;) Or we just have two variables for both, one with current prosilver format and one without html markup. (But the lang vars should be prefixed with something like "BUTTON_")

branch can be found here: https://github.com/nickvergessen/phpbb3 ... ee-buttons
Member of the Development-TeamNo Support via PM

User avatar
nextgen
Registered User
Posts: 128
Joined: Sat Jul 24, 2010 4:59 am
Location: Guatemala
Contact:

Re: New template variables

Post by nextgen »

@nickvergessen

to see if I understand you're saying do something like this? I mean just putting a text instead of managing each image.

look this: http://www.phpbb.com/styles/demo/3.0/in ... le_id=1078

http://www.phpbb.com/customise/db/style/subsilver3/

correct me if I'm wrong. :)
*Imagine a signature super spectacular.*

leviatan21
Registered User
Posts: 18
Joined: Tue May 05, 2009 5:51 pm

Re: New template variables

Post by leviatan21 »

nickvergessen wrote:Mungo and I are working on language free button-images atm.
Great ++
QA Team Member - I don't support by PM,
Customize forums, install Skins/Mods ! Sendme a PM | Don't forget to visit my other mods
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

Post Reply