View Full Version : Default Member Picture for Men and Women
shlomot
06-01-2008, 03:32 AM
A default picture can improve community atmosphere.
A different picture for each gender can be a killer:) One for the boys and one for the girls!
I guess that in order to do that, the developer will have to provide an option set in AdminCP that tells stores the field number being used as the gender field and the values it contains for each gender.
Thank you in advance.
GameWizard
06-01-2008, 03:36 AM
You should have a profile field that has Male and Female and you can place this where your avatar/profile picture code should appear:
<if condition="$userinfo[field12]==Male">
Male Picture
<else />
Female Picture
</if>
This assumes that everyone has selected either one or the other. If some members have no selected either field, you should use the the code below, otherwise you may have males that haven't selected a gender show up as a female:
<if condition="$userinfo[field12]==Male">
Male Picture
</if>
<if condition="$userinfo[field12]==Female">
Female Picture
</if>
shlomot
06-01-2008, 03:55 AM
Thanks for such a quick reply.
The gender field is now mandatory (upon registration), but it was wise of you to point out that not all members have filled out their gender yet:)
Can you please put all three options together, I.E. Male/Female/Otherwise?
I also wish that you can expend on it and show how to assemble it with this MOD (https://vborg.vbsupport.ru/showthread.php?t=165770) for the benefit of all of us PHP illiterates.
Many thanks.
You should have a profile field that has Male and Female and you can place this where your avatar/profile picture code should appear:
<if condition="$userinfo[field12]==Male">
Male Picture
<else />
Female Picture
</if>
This assumes that everyone has selected either one or the other. If some members have no selected either field, you should use the the code below, otherwise you may have males that haven't selected a gender show up as a female:
<if condition="$userinfo[field12]==Male">
Male Picture
</if>
<if condition="$userinfo[field12]==Female">
Female Picture
</if>
GameWizard
06-02-2008, 02:02 AM
No Php required here, just simple HTML coding and some mind power and logic. :)
<if condition="$prepared['profilepicurl']">
<td id="profilepic_cell" class="tborder alt2">
<img src="$prepared[profilepicurl]" $prepared[profilepicsize] alt="<phrase 1="$prepared[username]">$vbphrase[xs_picture]</phrase>" />
<else />
<if condition="$userinfo[field12]==Male">
<img src="http://www.your-domain.com/images/Default-Male-Pic.gif">
<else />
<img src="http://www.your-domain.com/images/no-gender-pic.gif">
</if>
<if condition="$userinfo[field12]==Female">
<img src="http://www.your-domain.com/images/Default-Female-Pic.gif">
<else />
<img src="http://www.your-domain.com/images/no-gender-pic.gif">
</if>
</td>
</if>
shlomot
06-02-2008, 02:31 AM
And that's exactly why we are fortunate to have you here:)
Many thanks, GameWizard, from the bottom of my heart.
No Php required here, just simple HTML coding and some mind power and logic. :)
GameWizard
06-02-2008, 08:11 AM
I might be mistaken, but the code i posted above may actually be showing 2 avatars for those who have no profile picture, and have not selected a gender. Assuming you haven't already forced your previously registered members to do select a field. In case you do notice this problem, the code below should correct that problem.
<if condition="$prepared['profilepicurl']">
<td id="profilepic_cell" class="tborder alt2">
<img src="$prepared[profilepicurl]" $prepared[profilepicsize] alt="<phrase 1="$prepared[username]">$vbphrase[xs_picture]</phrase>" />
<else />
<if condition="$userinfo[field12]==Male">
<img src="http://www.your-domain.com/images/Default-Male-Pic.gif">
<else />
<if condition="$userinfo[field12]==Female">
<img src="http://www.your-domain.com/images/Default-Female-Pic.gif">
<else />
<img src="http://www.your-domain.com/images/no-gender-pic.gif">
</if>
</if>
</td>
</if>
shlomot
06-02-2008, 08:56 AM
You are something else:) Thanks for your second-to-none support.
ReCom
11-22-2008, 12:41 PM
May I humbly suggest my mod Gender Bit (https://vborg.vbsupport.ru/showthread.php?t=196749) to show the default profile pictures for male/female?
The mod is mainly for showing a small symbol in postbit indicating the poster's gender but the new version (1.0.2) also takes care of default avatar.
Enjoy!
shlomot
11-22-2008, 03:07 PM
Thanks a lot for a great mod. Implemented successfully on vb3.8 beta 3 as well.
My comments, requests, voting, and nominations are placed here (https://vborg.vbsupport.ru/showpost.php?p=1670648&postcount=16).
May I humbly suggest my mod Gender Bit (https://vborg.vbsupport.ru/showthread.php?t=196749) to show the default profile pictures for male/female?
The mod is mainly for showing a small symbol in postbit indicating the poster's gender but the new version (1.0.2) also takes care of default avatar.
Enjoy!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.