jonnythirkill
Nov 9th 2008, 3:01 pm
Hey,
I am trying to allow the users of my website to embed youtube videos by only providing the link. I need it so that if no link is provided that the rest of the embed code is not displayed. I have limited PHP knowledge and im seeking help. The site runs on wordpress.
This is what ive got so far:
<?php $embed = $value = get_post_meta($post->ID, "embed", true); if ($embed == NULL) { echo ''; } else { echo '<object width="425" height="344"><param name="movie" value="$embed&hl=en&fs=1&color1=0xe1600f&color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="$embed=en&fs=1&color1=0xe1600f&color2=0xfebd01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>'; } ?>
I do not understand how to add the $embed inside the code. If anyone could help me it would be greatly appreciated.
Thanks,
Jonny
I am trying to allow the users of my website to embed youtube videos by only providing the link. I need it so that if no link is provided that the rest of the embed code is not displayed. I have limited PHP knowledge and im seeking help. The site runs on wordpress.
This is what ive got so far:
<?php $embed = $value = get_post_meta($post->ID, "embed", true); if ($embed == NULL) { echo ''; } else { echo '<object width="425" height="344"><param name="movie" value="$embed&hl=en&fs=1&color1=0xe1600f&color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="$embed=en&fs=1&color1=0xe1600f&color2=0xfebd01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>'; } ?>
I do not understand how to add the $embed inside the code. If anyone could help me it would be greatly appreciated.
Thanks,
Jonny