vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Using custom profile field contents in condition (https://vborg.vbsupport.ru/showthread.php?t=257167)

Cadellin 01-15-2011 11:02 AM

Using custom profile field contents in condition
 
I want to create a custom permission for my members to allow them to hide their instant messaging information if they select a radiobutton.

So my question is if I have two radio buttons (Yes/No) called field9 how can I use that in a condition to hide or show content?

I understand about vB conditionals but I always know I can't use vb:raw in a conditional - so how can I do it?

Thanks in advance

Lynne 01-15-2011 04:20 PM

Depends on what template you are using it in. If the variable is called $variable, then you would do something like:
HTML Code:

<vb:if condition="$variable['field9'] == 'Yes'">whatever if it is Yes</vb:if>

Cadellin 01-15-2011 04:34 PM

Thanks Lynne, you are once again very helpful as you have in the past :)

How could I find out the name of the variable required though? It would be put into the memberinfo, postbit and member list templates.

Lynne 01-15-2011 05:18 PM

You'd look in the template. For instance, in the postbit template, the variable is called $post.

Cadellin 01-15-2011 06:17 PM

Thanks Lynne for your help. Hopefully I'm sorted now :)

EDIT:

Probably a daft question but is there a variable I can use to determine whether the user viewing the profile is the profile owner? I have searched but I'm not quite sure what I should be searching for if you see what I mean.

Lynne 01-15-2011 06:30 PM

if $variable['userid'] == $bbuserinfo['userid']

$bbuserinfo['userid'] is you, the viewer, and then compare it to the variable userid.

Cadellin 01-15-2011 08:26 PM

Thanks Lynne - Now I know for the future!

Honestly your a saint :)


All times are GMT. The time now is 02:26 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.01592 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete