phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

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.1/Ascreaus followed by 3.2/Arsia.

New template variables

Postby Arty » Thu Sep 08, 2011 6:30 pm

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.
Formerly known as CyberAlien.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 802
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

Re: New template variables

Postby ecwpa » Fri Sep 09, 2011 5:10 pm

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.
Sorry for my bad english, still improving.
ecwpa
Registered User
 
Posts: 169
Joined: Mon Jan 24, 2005 2:10 am

Re: New template variables

Postby Arty » Fri Sep 09, 2011 5:30 pm

Good idea, added to list.
Formerly known as CyberAlien.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 802
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

Re: New template variables

Postby ToonArmy » Sun Sep 25, 2011 12:14 pm

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
ToonArmy
Registered User
 
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK

Re: New template variables

Postby Arty » Sun Sep 25, 2011 7:43 pm

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.
Formerly known as CyberAlien.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 802
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

Re: New template variables

Postby callumacrae » Sun Sep 25, 2011 9:14 pm

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.
"In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders"
—Douglas Crockford

View my MOD, phpBB Mobile
User avatar
callumacrae
Website Team
Website Team
 
Posts: 883
Joined: Tue Apr 27, 2010 9:37 am
Location: England

Re: New template variables

Postby Arty » Mon Sep 26, 2011 4:12 pm

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
Formerly known as CyberAlien.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 802
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

Re: New template variables

Postby nickvergessen » Mon Sep 26, 2011 11:43 pm

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
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 357
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: New template variables

Postby nextgen » Tue Sep 27, 2011 1:47 am

@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. :)
phpBB®: Become a Junior Styles Validator
I prefer to ask and not stay with the doubt...
User avatar
nextgen
Registered User
 
Posts: 90
Joined: Sat Jul 24, 2010 4:59 am
Location: Guatemala

Re: New template variables

Postby leviatan21 » Tue Sep 27, 2011 4:50 am

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
leviatan21
Registered User
 
Posts: 18
Joined: Tue May 05, 2009 5:51 pm

Next

Return to [3.x] Discussion

Who is online

Users browsing this forum: abpphpbb3, Exabot [Bot] and 17 guests