The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
if conditions inside of an else statement
EDIT I FIXED IT FORGOT MY END " (FIXED IN RED)
But now for users not logged in it's showing 2 avatars =/ so ill leave this see if anyone can help me fix it =) EDIT 2 this is solved request closed =) im trying to use this code to show a different default avatar depending on if the user is registered/ male or female. i set it up to be if user has an avatar display that users avatar, if user doesnt but is registered (i have a required userfield at reg, to get the male/female) display male or female default accordingly, but if user is not registered it will just display a ? avatar. Code:
<if condition="$navbaravatarurl"> <img src="$navbaravatarurl" /> <else /> <if condition="$bbuserinfo['field5'] == 'Male'"> <img src="images/misc/nom.png" /> <else /> <img src="images/misc/no.png" /> </if> <if condition="$bbuserinfo['field5'] == 'Female'"> <img src="images/misc/nof.png" /> <else /> <img src="images/misc/no.png" /> </if> </if> When i use the code like this it works fine... but kind of kills the way i want to set it up. Code:
<if condition="$navbaravatarurl"> <img src="$navbaravatarurl" /> <else /> <img src="images/misc/no.png" /> </if> |
#2
|
||||
|
||||
I don't think those conditions will work how you want it to anyway. You will end up with two images. Also, is this in the postbit template? $bbuserinfo is the user *viewing* the site, not the poster.
I think you need to do... if field isn't Male or Female - no.png else - if field is Male - - nom.png - else - - nof.png - end if end if |
#3
|
||||
|
||||
i actually been playing with it the whole time not just sitting waiting for some one to spoon me lol, i was just coming back to say i got it =)
but to answer your question, no it's not for the postbit but i might do something similar with the postbit(s) =) this is a sidebar addon im working on you can check out here (toggles on the right side) i had to take a plugin already made (navbar avatar or something) and ive re-wrote it a little, not quite to where i want it yet plus id rather be able to change the images and things in the CP if i do publicly release it, but its coming along =) FINAL CODE I ENDED UP USING: Code:
<if condition="$navbaravatarurl"> <img class="sbav" src="$navbaravatarurl" /> <else /> <if condition="$bbuserinfo['field5'] == 'Male'"> <img class="sbav" width="100px" src="images/misc/nom.png" /> </if> <if condition="$bbuserinfo['field5'] == 'Female'"> <img class="sbav" width="100px" src="images/misc/nof.png" /> </if> <if condition="$bbuserinfo['field5'] != 'Female' AND $bbuserinfo['field5'] != 'Male'"> <img class="sbav" width="100px" src="images/misc/no.png" /> </if> </if> |
#4
|
||||
|
||||
I'm glad you got it.
|
Благодарность от: | ||
Dr.CustUmz |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|