We want to create a short-code. The final output of the source code should be similar to the code mentioned below.
<script type="text/javascript" src="http://hosted.musesradioplayer.com/mrp.js"></script>
<script type="text/javascript">
MRP.insert({
'url':'http://streams.museter.com:8002/;',
'codec':'mp3',
'volume':65,
'autoplay':true,
'buffering':5,
'title':'Radio%20Vermont',
'welcome':'WELCOME TO...',
'bgcolor':'#FFFFFF',
'skin':'mcclean',
'width':180,
'height':60
});
</script>
the above mentioned code, when ever we insert shortcode, url and codec variable will change...
we try with the following shortcode but its wrong... kindly help me...
<?
function playermp3($atts) {
extract(shortcode_atts(array(
"value" => 'http://',
"width" => '180',
"height" => '60',
"codec"=> 'mp3',
"volume" => '65',
"autoplay"=>'true',
"buffering"=> '5',
"title"=> 'Radio%20Vermont',
"welcome" => 'WELCOME TO...',
"bgcolor"=>'#FFFFFF',
"skin"=> 'mcclean',
), $atts));
return '<script type="text/javascript" src="http://hosted.musesradioplayer.com/mrp.js"></script>
<script type="text/javascript">
MRP.insert({
'url':'.$value.',
'codec':'.$codec.',
'volume':'.$volume.',
'autoplay':'.$autoplay.',
'buffering':'.$buffering.',
'title':'.$title.',
'welcome':'.$welcome.',
'bgcolor':'.$bgcolor.',
'skin':'.$skin.',
'width':'.$height.',
'height':'.$width.'
});
</script>';
}
add_shortcode("playermp3", "playermp3");
?>