The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Autostarting Music
Hi there,
I currently have a music player on user's profiles, this being the music code. PHP Code:
However, I made a User Profile Field, named "Autostart on Profile" It's Radio Buttons and the choices are Yes or No. I'm trying to, so that if a user goes into that option and puts "No" it won't start automatically playing on a user's profile. But if they set it to "Yes", it will start automatically playing music. I got help similar on this for ranks, just wondering if the same code can apply to this feature I currently have. |
#2
|
|||
|
|||
I think you should just have to find out what field number your custom field is, then surround the AUTOSTART=TRUE with an if, like
Code:
<if condition="$bbuserinfo['fieldX'] == 'Yes'"> AUTOSTART=TRUE </if> (replace the X with the field number of course). |
#3
|
||||
|
||||
Hmm, here is my code so far with your added if condition
PHP Code:
I went back to "Edit Options" clicked "Yes", went to a user's profile, the music autostarted. I went back to Edit Options, this time selecting "No" went back to the user's profile, and it still autostarted. Did I code it wrong? |
#4
|
|||
|
|||
No, it looks right. Maybe autostarting is the default? OK, try this instead:
Code:
AUTOSTART=<if condition="$bbuserinfo['field43'] == 'Yes'">TRUE<else />FALSE</if> |
#5
|
||||
|
||||
Yes, it worked.
Thank you so much. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|