![]() |
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. |
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). |
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? |
No, it looks right. Maybe autostarting is the default? OK, try this instead:
Code:
AUTOSTART=<if condition="$bbuserinfo['field43'] == 'Yes'">TRUE<else />FALSE</if> |
Yes, it worked.
Thank you so much. ;) |
All times are GMT. The time now is 01:14 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|