[RFC] Global template variable for user avatar

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Re: [RFC] Global template variable for user avatar

Post by ecwpa »

{USER[AVATAR]} for me then, what are the other user variables that will be available?
Slightly better English than it was in 2005, still improving :D
User avatar
psoTFX
Registered User
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm
Contact:

Re: [RFC] Global template variable for user avatar

Post by psoTFX »

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
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: [RFC] Global template variable for user avatar

Post by naderman »

indeed, I'd prefer if they were lowercase strings even. I'd say {USER[avatar]} would work fine.
User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Global template variable for user avatar

Post by brunoais »

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.
User avatar
psoTFX
Registered User
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm
Contact:

Re: [RFC] Global template variable for user avatar

Post by psoTFX »

Currently the PR is running with [] lowercase element names.
User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Global template variable for user avatar

Post by callumacrae »

Why not use a dot? {USER.avatar}
Made by developers, for developers!
My blog
User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: [RFC] Global template variable for user avatar

Post by MichaelC »

callumacrae wrote:Why not use a dot? {USER.avatar}
+1
Formerly known as 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.
Senky
Extension Customisations
Extension Customisations
Posts: 315
Joined: Thu Jul 16, 2009 4:41 pm

Re: [RFC] Global template variable for user avatar

Post by Senky »

callumacrae wrote:Why not use a dot? {USER.avatar}
+1
User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Global template variable for user avatar

Post by imkingdavid »

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
psoTFX
Registered User
Posts: 1984
Joined: Tue Jul 03, 2001 8:50 pm
Contact:

Re: [RFC] Global template variable for user avatar

Post by psoTFX »

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.
Post Reply