MINIPROFILE MP3S, tutorial
POST CREATED Dec 9, 2014 21:57:56 GMT -8
redox-kun, WILLOW, and 1 more like this
Post by beekeeper on Dec 9, 2014 21:57:56 GMT -8
This is a tutorial on how to put MP3s in your miniprofiles! It's actually super easy to do. You don't even need to do much coding, honestly, here's a step by step so literally anyone can do it.
STEP ONE: First thing you need is the miniprofile field. Go to Admin > Members > Custom Profile Fields and add a new field. You can call it anything - mp3, music, whatever. This part is pretty self-explanatory, here's what mine looks like.
That's it. Now onto the actual code stuff.
So I whipped up a super simple miniprofile on my tester to use as an example. The codes don't really matter, since you just add this one to whatever is already there, but here's what I have to start.
STEP 2: Next, you'll want to get the mp3 player's code from here. It's small, simple and easily customizable.
Hit Generator, change Category to Colours, and match them to your skin. You can also do this directly in the html, but I prefer to do it here since it's easier and you can actually preview it. Edit the colours to your liking and then copy the code.
STEP 3: Go to Admin > Themes > Layout Templates > Miniprofile. Paste the player code wherever you want it to go. Mine is going at the bottom.
STEP 4: Now you just add the custom miniprofile field code in there. The {foreach} and {if} tags go around the <object tags>, like so. Make sure to replace "Music" with whatever you named your field.
{foreach $[user.mini_custom_field]}
{if $[user.mini_custom_field.name] == Music}
THE MP3 CODE GOES HERE
{/if}
{/foreach}
STEP 4: The default mp3 in the player is flash-mp3-player.net/medias/another_world.mp3.
Replace this with $[user.mini_custom_field.value]. Make sure to only replace that part or you'll fuck it up.
STEP 5: That's it! Now just stick an mp3 into the custom field. Make sure it's a direct link ending in .mp3, like the one I'm using is dl.dropboxusercontent.com/u/101811149/08%20a%20song%20dedicated%20to%20the%20memory%20of.mp3
I host mine in my dropbox public folder, but you can also upload songs to kiwi6.
THAT'S IT FOLKS. Enjoy. Here's the finished product on the miniprofile, it's nothing fancy but take my word that it works.
***Also: protip, I wouldn't suggest doing any resizing in the actual html, it'll just scale everything super tiny. If you want to have just the play button without the bar, stick in into a div, set the width and overflow:hidden.