PDA

View Full Version : Profile Fields


phalanxents
08-03-2016, 11:27 AM
I'm not sure how to do this in vbulletin 4.

I have a custom field that says "Show Customer Outfits?" when if selected, I want it to show images that are in the profile. If they say no, it hides the images.

I've tried:
<vb:if condition="$profilefield[27] != 'Yes'">Show This</vb:if>
<vb:if condition="$profilefield[27] != 'No'">Show this instead</vb:if>


but that's not working.

Gio~Logist
08-03-2016, 12:07 PM
What template are you trying to show this in? Try $prepared[fieldx]

MarkFL
08-03-2016, 12:08 PM
Use "$prepared['field27']" or "$userinfo['field27']" in your conditionals instead. :)

phalanxents
08-03-2016, 03:29 PM
Hi Guys,
Thanks for your responses. I've tried both to no avail.
Could you please take a look at this code?


<vb:if condition="$prepared['field27'] != 'Yes'">Show this content</vb:if>
<vb:if condition="$prepared['field27'] != 'No'">Hide the content</vb:if>

MarkFL
08-03-2016, 03:53 PM
Which template have you put that in?

phalanxents
08-03-2016, 04:00 PM
Sorry,
Memberinfo :)


I'm worried about Quotation marks etc - never been any good at that lol

MarkFL
08-03-2016, 04:17 PM
You've used the quotes correctly...could it be that your added code is within a conditional itself that is preventing it from being rendered?

phalanxents
08-03-2016, 04:19 PM
Here's my full code:

<div class="member_tabs<vb:if condition="$stylevar['textdirection'] == 'ltr'"> contentright</vb:if>" id="userprof_content_container">

<div class="tabbackground" id="profile_tabs">


<br /><center><img src="http://www.secondskin.clothing/members/images/customeroutfits.png"></center><br />
<vb:if condition="$prepared['field27'] != 'Yes'">
<table style="width:100%" border="0">
<tr>
<td><center><vb:if condition="$userinfo['field15']"><img src="{vb:raw userinfo.field15}" width="200" height="250"></vb:if></center></td>
<td><center><vb:if condition="$userinfo['field17']"><img src="{vb:raw userinfo.field17}" width="200" height="250"></vb:if></center></td>
<td><center><vb:if condition="$userinfo['field19']"><img src="{vb:raw userinfo.field19}" width="200" height="250"></vb:if></center></td>
</tr>
<tr>
<td><br /></td>
<td><br /></td>
<td><br /></td>
</tr>
<tr>
<td><center><b><vb:if condition="$userinfo['field16']">{vb:raw userinfo.field16}</vb:if></b></center></td>
<td><center><b><vb:if condition="$userinfo['field18']">{vb:raw userinfo.field18}</vb:if></b></center></td>
<td><center><b><vb:if condition="$userinfo['field20']">{vb:raw userinfo.field20}</vb:if></b></center></td>
</tr>
<tr>
<td><br /></td>
<td><br /></td>
<td><br /></td>
</tr>
<tr>
<td><center><vb:if condition="$userinfo['field21']"><img src="{vb:raw userinfo.field21}" width="200" height="250"></vb:if></center></td>
<td><center><vb:if condition="$userinfo['field23']"><img src="{vb:raw userinfo.field23}" width="200" height="250"></vb:if></center></td>
<td><center><vb:if condition="$userinfo['field25']"><img src="{vb:raw userinfo.field25}" width="200" height="250"></vb:if></center></td>
</tr>
<tr>
<td><br /></td>
<td><br /></td>
<td><br /></td>
</tr>
<tr>
<td><center><b><vb:if condition="$userinfo['field22']">{vb:raw userinfo.field22}</vb:if></b></center></td>
<td><center><b><vb:if condition="$userinfo['field24']">{vb:raw userinfo.field24}</vb:if></b></center></td>
<td><center><b><vb:if condition="$userinfo['field26']">{vb:raw userinfo.field26}</vb:if></b></center></td>
</tr>
</table>
</vb:if>
<vb:if condition="$prepared['field27'] != 'No'">
Show This
</vb:if>

MarkFL
08-03-2016, 04:29 PM
Try adding this at the very top:

{vb:raw userinfo.field27}

So you can see what value is in that profile field...

phalanxents
08-03-2016, 04:35 PM
Attached :)

I really do thank you for trying to help :)

MarkFL
08-03-2016, 04:46 PM
I just noticed in your profile you give vB 3.7.4 as the version you are running...try changing the if constructs to the following format:

<if condition=""></if>

phalanxents
08-03-2016, 04:47 PM
I'm definitely running 4.2.3

MarkFL
08-03-2016, 04:55 PM
I'm definitely running 4.2.3

Okay...then leave the if constructs alone. :D

If you want, create a temporary admin account and send the login credentials to me by PM and I will be glad to come take a look. :)

phalanxents
08-03-2016, 05:24 PM
Thank you,
sent :)

MarkFL
08-03-2016, 06:13 PM
Thank you,
sent :)

A disruptive user issue at one of the sites I help with came up, but I will be there tonight (in about 6 hours) for sure to look into this. :)