Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2016, 11:27 AM
phalanxents phalanxents is offline
 
Join Date: Feb 2016
Location: UK
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 08-03-2016, 12:07 PM
Gio~Logist's Avatar
Gio~Logist Gio~Logist is offline
 
Join Date: Jun 2004
Location: San Francisco
Posts: 2,575
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What template are you trying to show this in? Try $prepared[fieldx]
Reply With Quote
  #3  
Old 08-03-2016, 12:08 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use "$prepared['field27']" or "$userinfo['field27']" in your conditionals instead.
Reply With Quote
  #4  
Old 08-03-2016, 03:29 PM
phalanxents phalanxents is offline
 
Join Date: Feb 2016
Location: UK
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #5  
Old 08-03-2016, 03:53 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which template have you put that in?
Reply With Quote
  #6  
Old 08-03-2016, 04:00 PM
phalanxents phalanxents is offline
 
Join Date: Feb 2016
Location: UK
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry,
Memberinfo


I'm worried about Quotation marks etc - never been any good at that lol
Reply With Quote
  #7  
Old 08-03-2016, 04:17 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 08-03-2016, 04:19 PM
phalanxents phalanxents is offline
 
Join Date: Feb 2016
Location: UK
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #9  
Old 08-03-2016, 04:29 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try adding this at the very top:

HTML Code:
{vb:raw userinfo.field27}
So you can see what value is in that profile field...
Reply With Quote
  #10  
Old 08-03-2016, 04:35 PM
phalanxents phalanxents is offline
 
Join Date: Feb 2016
Location: UK
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Attached

I really do thank you for trying to help
Attached Images
File Type: jpg vbissue.jpg (18.2 KB, 0 views)
Reply With Quote
Благодарность от:
MarkFL
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05368 seconds
  • Memory Usage 2,275KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete