vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Profile Fields (https://vborg.vbsupport.ru/showthread.php?t=323168)

phalanxents 08-03-2016 11:27 AM

Profile Fields
 
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:
Code:

<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?

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:

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:

HTML Code:

{vb:raw userinfo.field27}
So you can see what value is in that profile field...

phalanxents 08-03-2016 04:35 PM

1 Attachment(s)
Attached :)

I really do thank you for trying to help :)


All times are GMT. The time now is 07:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01169 seconds
  • Memory Usage 1,735KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete