MyBB Community Forums

Full Version: Show HTML if userfeild present
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello, i am trying to show an peice of html code if the custom user feild is present. I want the audio code to only be displayed on the profile if they have entered something into the feild box on the cp. Otherwise an mp3 player appears with no audio

here is the code:
 <audio controls autoplay>
  <source src="{$userfields['fid6']}" type="audio/mpeg">
  Your browser does not support the audio element.

I want this to disappear if {$userfields['fid6']} is empty.

I am an html css dev so no clue about the php or javascript for this