The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Custom User Profile Fields acting weird
I've set up a custom profile music player, so members could put their favourite tracks as, well, their profile music. Then someone requested the ability to pick whether it should be autoplayed or not, so I made this (autoplay=1 OR 0):
http://prntscr.com/647wj http://prntscr.com/647u4 And this is where I encountered 2 problems. First, it didn't want to switch to 0, or rather, it didn't want to save it. Second, even after making 1 the default value, it wouldn't work until the settings were first saved. It works when I do it like that http://prntscr.com/647wa but it's still quite disheartening. |
#2
|
|||
|
|||
Yeah, for some reason I don't understand, if you add a custom profile field it won't have any value for existing users until they edit their profile, even if you specify a default. Seems kind of like a bug to me, but I guess it's always been that way so maybe there's a reason for it that I don't understand.
In any case, you could probably use if statements to check for no value (!= '') and insert the default. |
#3
|
||||
|
||||
Uhm, could you do it please? Ifs were always my weak side, and vB4 has those vbs everywhere compared to vB3.
Code:
<object type="application/x-shockwave-flash" data="audio-player/dewplayer.swf" width="200" height="20" id="dewplayer" name="dewplayer"> <param name="wmode" value="transparent" /><param name="movie" value="audio-player/dewplayer.swf" /> <param name="flashvars" value="mp3={vb:raw userinfo.field7}&autostart={vb:raw userinfo.field8}&showtime=1" /> </object> |
#4
|
|||
|
|||
Code:
<object type="application/x-shockwave-flash" data="audio-player/dewplayer.swf" width="200" height="20" id="dewplayer" name="dewplayer"> <param name="wmode" value="transparent" /><param name="movie" value="audio-player/dewplayer.swf" /> <param name="flashvars" value="mp3={vb:raw userinfo.field7}&autostart=<vb:if condition="$userinfo[field8] != ''">{vb:raw userinfo.field8}<vb:else />1</vb:if>&showtime=1" /></object> I'm not sure if you wanted the default (for users who haven't chosen) to be 0 or 1. If you want it to be 0, change the red 1 above to 0. |
#5
|
||||
|
||||
Rawr, someone just pointed out on the forum it doesn't work as intended. Silly me, I should have noticed myself. Anyway, that userinfo thingie takes music url from the member who's profile you're visiting, right? The same thing is happening in case of autoplay option. So if you set 1 so it would autoplay, it will autoplay for everyone who visit your profile despite their own settings. How to make it so field8 was using their own settings?
|
#6
|
|||
|
|||
So you want each user to control whether everyone's music will autoplay? Then use bbuserinfo.field8 (and $bbuserinfo[field8] in the condition).
|
#7
|
||||
|
||||
Rawr, thanks, others confirmed it works~
bbuserinfo is for options that should be taken locally, while userinfo to see what others have set up, right? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|