phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC] Global template variable for user avatar

Publish your own request for comments or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.1/Ascraeus and 3.2/Arsia.

Re: [RFC] Global template variable for user avatar

Postby ecwpa » Sun Jul 22, 2012 3:33 am

{USER[AVATAR]} for me then, what are the other user variables that will be available?
Sorry for my bad english, still improving.
ecwpa
Registered User
 
Posts: 169
Joined: Mon Jan 24, 2005 2:10 am

Re: [RFC] Global template variable for user avatar

Postby psoTFX » Sun Jul 22, 2012 2:02 pm

Not so sure I like the uppercasing of everything - least if the intention is to just "dump" the relevant array to a variable - since that array will be full of lowercase elements. It seems like an unnecessary step and/or complication. Of course if the data assigned to the array is specifically selected uppercasing the element names is a non-issue.
User avatar
psoTFX
Registered User
 
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm

Re: [RFC] Global template variable for user avatar

Postby naderman » Sun Jul 22, 2012 2:30 pm

indeed, I'd prefer if they were lowercase strings even. I'd say {USER[avatar]} would work fine.
www.naderman.de
Move your forum to Forumatic - we'll take care of maintenance & spam
User avatar
naderman
Development Team Leader
Development Team Leader
 
Posts: 1650
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany

Re: [RFC] Global template variable for user avatar

Postby brunoais » Sun Jul 22, 2012 6:03 pm

I'll go for [].
Makes a little more sense having in account how it works with other programing langauges. Chosing between both in not much different, though.
brunoais
Registered User
 
Posts: 627
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Global template variable for user avatar

Postby psoTFX » Sun Jul 22, 2012 6:13 pm

Currently the PR is running with [] lowercase element names.
User avatar
psoTFX
Registered User
 
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm

Re: [RFC] Global template variable for user avatar

Postby callumacrae » Mon Jul 23, 2012 6:56 am

Why not use a dot? {USER.avatar}
"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: [RFC] Global template variable for user avatar

Postby MichaelC » Mon Jul 23, 2012 10:07 am

callumacrae wrote:Why not use a dot? {USER.avatar}


+1
Unknown Bliss
psoTFX wrote:I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"

No unsolicited PMs please except for quotes.
User avatar
MichaelC
Website Team
Website Team
 
Posts: 798
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Global template variable for user avatar

Postby Senky » Mon Jul 23, 2012 10:20 am

callumacrae wrote:Why not use a dot? {USER.avatar}

+1
Senky
Registered User
 
Posts: 222
Joined: Thu Jul 16, 2009 4:41 pm

Re: [RFC] Global template variable for user avatar

Postby imkingdavid » Mon Jul 23, 2012 12:46 pm

I think the variable[element] syntax is better because that is what we use for arrays in PHP, so that is was I would be used to. Of course, the object->property syntax is not foreign, so it would work as well, but I think the array syntax would be easier to use.

I know this isn't the topic about storing arrays in the template, but are multidimensional arrays supported as well? (i.e. variable[element][sub-element])

EDIT: Somehow I missed the entire 3rd page. I disagree with having a dot. We use dots for blocks, so using them also for arrays would be more confusing. So, I vote no dots.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.
User avatar
imkingdavid
Development Team
Development Team
 
Posts: 906
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Global template variable for user avatar

Postby psoTFX » Mon Jul 23, 2012 1:18 pm

Yeah, this is why I favoured something other than a dot since it's not a block, you can't iterate over the content of the array, only access specific elements. Yeah, it handles multidimensional arrays.
User avatar
psoTFX
Registered User
 
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm

Previous Next

Return to [3.x] RFCs

Who is online

Users browsing this forum: No registered users and 18 guests