![]() |
Custom profile field conditionals for check boxes
Hello. I'm trying to get some conditionals working for a Multiple Selection Checkbox profile field I've set.
I tried the following conditional, but it doesn't work with checbox values: Code:
<vb:if condition="$bbuserinfo[fieldX] == 'Show Me'"> Any ideas why it doesn't work with checkboxes?:confused: |
First option
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Thanks, that works nice. The next thing I'm trying to do is that when User A views User B's profile, User A will see the effects as User B has set them. And vice versa.
The checkboxes they can pick create special effects to make their profile page look nicer. Similar to how $post['fieldX'] will display information in the user's postbit, is there a condition statement or variable that will do this for user profiles? Sorry if this request sounds confusing. |
I'm not sure if i understand you, are you trying to do this
|
Just re-worded the post. Sorry, I did word that pretty badly.
I'm trying to give my users bit more freedom with how their profiles look. So I've given them a few checkbox choices they can pick to give them some effects with Javascript. Is there a statement, or variable, that will show the customizations the user chose when others see their profile, similar to the way that $post['fieldX'] will display customized information in the postbit? But in this case, on the member.php page. |
Yes that's exactly what i figure out about an hour go :D Do you want this conditional to work in a plugin or in a template
|
Oh nice. :) Well I was planning to put all of the statements and scripts in the headinclude templates. Could it all be done there, or do you think a plugin would be best?
Edit I found that the method you displayed in the 2nd post is not working for me. It appears to work fine for the first 2 check boxes, but if I pick any further choices it will run the incorrect script, or multiple scripts, as if it's ignoring the condition. Even if I only choose 1 check box. It's weird because it only behaves in that way for box #3 and onwards. :( |
Can you show me your code? And i think it's better to do this in a plugin since i understand you just want to add js files to the page, am i right?
|
Yes, but the obstacle I'm at is getting conditionals that check if a certain checkbox or checkboxes are selected.
For a quick concept test I put the following in my headinclude template: Code:
<vb:if condition="$bbuserinfo[field16] & 1"> |
You must redouble the number each time...
e.g. (1,2,4,8,16,32,64 etc..) |
All times are GMT. The time now is 10:02 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|