PDA

View Full Version : Is my <if> and < else /> conditional correct?


salata
09-14-2007, 02:19 PM
<if condition=$show[profilepic]">

<img src="$userinfo[profilepicurl]" height="150" width="150" />

<else />

<img src="http://xxxx.com/images/default.gif">

</if>

My <if> Conditional is incorrect, what i am trying to do is show a default pic if the user has not uploaded a pic. Can someone please correct me on what is wrong?
I am certain it is my <if> conditional because if i take it out the profile pic shows as suppose to, but the current code shows both the pic and default pic.

EnIgMa1234
09-14-2007, 02:40 PM
Change the top line to

<if condition="$show[profilepic]">

Your missing the extra "

salata
09-14-2007, 02:54 PM
thanks, i overlooked that. But For some reason it still won't work

could it be that my <if condition="$show[profilepic]"> is incorrect?

EnIgMa1234
09-14-2007, 03:27 PM
change the variable to $userinfo[profilepicurl]

That way it checks if you have a url. If not it'll post your code

salata
09-14-2007, 06:22 PM
nothing changes. All that i get is the box with the litte red X

WhaLberg
09-14-2007, 06:52 PM
the correct one is: $userinfo['profilepicurl'] ;)

salata
09-14-2007, 07:45 PM
thanks for all the help fellas, works like a charm now. :)

EnIgMa1234
09-14-2007, 08:09 PM
the correct one is: $userinfo['profilepicurl'] ;)Not in templates ;)

'' in plugins not templates.

salata
09-14-2007, 09:35 PM
Not in templates ;)

'' in plugins not templates.

it was actually ' . Does it matter? I added ' and it worked anyways.

Kirk Y
09-14-2007, 09:39 PM
Not in templates ;)

'' in plugins not templates.
Not always... ;)

EnIgMa1234
09-14-2007, 11:57 PM
Ahh kk

Adrian Schneider
09-15-2007, 12:14 AM
In conditions use the quotes around array keys, but not in the template body... unless you want to wrap it in curly braces.

salata
09-17-2007, 12:35 AM
i tried using this code in my showgroups template at an attempt to replace avatar pics with profile pics without no luck. Does $userinfo[profilepicurl] not work?

FCS-Webmaster
01-20-2008, 06:38 PM
I tried this in memberinfo without any results. Whats wrong?!