vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Conditional Profile Field Status and Notices (https://vborg.vbsupport.ru/showthread.php?t=294836)

richardevans123 02-06-2013 07:10 PM

Conditional Profile Field Status and Notices
 
Hey Guys,

I have got a Custom Profile Field and it acts like a status. Similar to Online and Offline, but Active or Non-Active.

What I'd like to do is when a User Selects the "Non-Active" option, a Notice appears saying that the status is "Non-Active" please change to Active.

What coding do I need to do this?

Thanks

LifesGreatestGift 02-07-2013 03:25 PM

depends what template you want to put it in. But I would imagine something like this

OPTIONS FOR DROPDOWN
Non-Active [has an id of 0]
Active [has an id of 1]

Code:

<vb:if condition="$bbuserinfo['field#'] == 0">
    <p style="margin:15px 0;padding:8px;background:#ff0000;color:#333;">Please change to active!</p>
</vb:if>

Where # is your field id, and 0 is the id of the non-active selection.

richardevans123 02-07-2013 03:53 PM

Okay, the coding is right, but changing the "0" and "1" isn't actually changing anything. I'm working on 4.2.0 PL3 if that helps

LifesGreatestGift 02-07-2013 04:01 PM

i see no custom dropdown profile field on your site.

--------------- Added [DATE]1360256533[/DATE] at [TIME]1360256533[/TIME] ---------------

try == '1' instead of == 1

--------------- Added [DATE]1360257340[/DATE] at [TIME]1360257340[/TIME] ---------------

Code:

<vb:if condition="$bbuserinfo['field11'] == 'Off Active Duty'">
    <p style="margin:15px 0;padding:8px;background:#ff0000;color:#333;">Please change to active!</p>
</vb:if>

Try that.

--------------- Added [DATE]1360257519[/DATE] at [TIME]1360257519[/TIME] ---------------

If that doesnt work then try

"Second Option Selected"
Code:

<vb:if condition="$bbuserinfo[field11] & 2"><p>STUFF</p></vb:if>
dont remember exactly but it could be either [field11] or ['field11'] try both. :)

richardevans123 02-07-2013 04:23 PM

It's done via radio buttons. And neither of those codes work. :/

LifesGreatestGift 02-07-2013 04:27 PM

What template are you posting these in? header/navbar?

richardevans123 02-07-2013 04:31 PM

I'm doing it via a notice

LifesGreatestGift 02-07-2013 04:43 PM

May be a bug as

Code:

<vb:if condition="$bbuserinfo['field11'] == 'Off Active Duty'">STUFF</vb:if>
should work.

richardevans123 02-07-2013 04:47 PM

Got it to work! :D

LifesGreatestGift 02-07-2013 04:48 PM

try using a dropdown single-selection and these conditionals. may just be with radio button.

--------------- Added [DATE]1360259313[/DATE] at [TIME]1360259313[/TIME] ---------------

What was the code that worked? I am curious.


All times are GMT. The time now is 08:03 AM.

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.01254 seconds
  • Memory Usage 1,724KB
  • 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
  • (4)bbcode_code_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