mp3 preview buttons ....
mp3 audio preview files may be incorporated into PHP-IPNMonitor. You may select either a Javascript pop up player, or using a built in Flash mp3 preview button.
PHP-IPNMonitor comes with a number of mp3 button layouts which are shown below. These are provided as part of the application and includes the Flash fla files.
It is also possible to use third party mp3 preview buttons, although some are easier to incorporate than others.
Incorporating the swf button into the template
The following buttons are provided with the application and you do not have to modify any code to make them display. All you have to do is tick a tick box in the admin Global Set up page.
The code that is used to create the swf file is located in the file content.php in the folder /functionscart/ and about line 283 and looks similar to the following :
Show / Hide code//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //START //Code for mp3 preview button $button = ""; $button .= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='25' height='25' id='mp3button" . $d_row["recid"] . "' align='middle' >"; $button .= "<param name='allowScriptAccess' value='sameDomain' />"; $button .= "<param name='movie' value='" .$INSTALL_FOLDER . "mp3previewer/mp3button.swf' />"; $button .= "<param name=\"quality\" value=\"high\" />"; $button .= "<param name='FlashVars' value='theFile=" . urlencode($d_row["filename_small_mp3"]) . "' />"; $button .= "<param name='bgcolor' value='#ffffff' />"; $button .= "<param name='wmode' value='transparent' />"; $button .= "<embed src='" .$INSTALL_FOLDER . "mp3previewer/mp3button.swf' FlashVars='theFile=" . urlencode($d_row["filename_small_mp3"]) . "' quality='high' bgcolor='#ffffff' width='25' height='25' name='mp3button" . $d_row["recid"] . "' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent' /></object>"; $content[$x]["FILENAME_SMALL_MP3"] = $button; //END //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Note that to make the scripting of the button easier, we have replaced double quote marks ( " ) with single quote marks ( ' ).
This programmically creates the swf object, loading the required mp3 file defined in the database.
The above looks complicated, but it is just the same code that you would use to create an ordiary flash object but with some extra code to add in the correct file name of the mp3 preview clip and its location.
The important part is how the swf file reads the url of the mp3 file. In the above, this is done by a parameter value called 'theFile' which occurs twice in the above text.
To use a 3rd party swf file, you have to know how that swf file uses this parameter, so instead of using 'theFile' as the parameter, it might be called 'soundFile', in which case you will have to edit the content.php text to match that.
WordPress mp3 player (free to download)
The WordPress mp3 plug in player can be downloaded from :
http://www.1pixelout.net/code/audio-player-wordpress-plugin/
but can be used on other web pages as described
at :
http://www.macloo.com/examples/audio_player/
and incorporated into PHP-IPNMonitor as described below.
In /functionscart/content.php file, you need to change the code to the following :
Show / Hide code//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //START //Code for Wordpress mp3 preview button $button = ""; $button .= "<object type='application/x-shockwave-flash' data='" .$INSTALL_FOLDER. "mp3previewer/player.swf' id='audioplayer" .$d_row["recid"]. "' height='24' width='290'>"; $button .= "<param name='movie' value='" .$INSTALL_FOLDER. "mp3previewer/player.swf'>"; $button .= "<param name='FlashVars' value='playerID=1&soundFile=" . urlencode($d_row["filename_small_mp3"]) . "'>"; $button .= "<param name='quality' value='high'>"; $button .= "<param name='menu' value='false'>"; $button .= "<param name='wmode' value='transparent'>"; $button .= "</object>"; $content[$x]["FILENAME_SMALL_MP3"] = $button; //END //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Notice that 'theFile' has changed to 'playerID=1&soundFile=' which occurs twice and the name of the swf file is player.swf.
Wimpy button (commercial)
The Wimpy button is a commercial application and is available from here : wimpyplayer
The buttons are available in a number of styles and colours and are easy to configure. The wimpyplayer web site has many other mp3 players which you may find useful.
Incorporating the Wimpy button player into IPNMonitor templates.
Incorporating it into the template system is quite straight forward by copying the code in to /functionscart/content.php file. You also have to add the registration code in two places to remvoe the Demo icon.
Show / Hide code//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //START //Code for mp3 Wimpy button $button = ""; $button .= "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' "; $button .= "align='' width='35' height='35' id='wimpybutton152" .$d_row["recid"]. "' >"; $button .= "<param name='movie' value='" . "" .$INSTALL_FOLDER. "mp3previewer/wimpy_button.swf' />"; $button .= "<param name='loop' value='false' />"; $button .= "<param name='menu' value='false' />"; $button .= "<param name='quality' value='high' />"; $butotn .= "<param name='bgcolor' value='#FFFFFF' />"; $button .= "<param name='flashvars' value='theFile=" . urlencode($d_row["filename_small_mp3"]) . "&wimpyReg=REGISTRATION_CODE&myid=wimpybutton152" .$d_row["recid"]. "' />"; $button .= "<embed src='" . "" .$INSTALL_FOLDER. "mp3previewer/wimpy_button.swf' flashvars='theFile=" . urlencode($d_row["filename_small_mp3"]) . "&wimpyReg=REGISTRATION_CODE&myid=wimpybutton152" .$d_row["recid"]. "' "; $button .= "width='35' height='35' bgcolor='#FFFFFF' loop='false' "; $button .= "menu='false' quality='high' name='wimpybutton152" .$d_row["recid"]. "' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' "; $button .= "pluginspage='http://www.macromedia.com/go/getflashplayer' />"; $button .= "</object>"; $content[$x]["FILENAME_SMALL_MP3"] = $button; //END //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dewplayer - mp3 flash player (free to download)
The Dewplayer is an mp3 flash player which can be downloaded from
http://www.alsacreations.fr/dewplayer-en
Mini
Classic
Multi
To incorporate the Dewplayer mp3 player is a little more complicated so the easiest way is to copy the code into the file /functionscart/content.php
Mini
Show / Hide code
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //START //Code for Dewplayer mp3 button $button = ""; $button .= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' "; $button .= "width='160' height='20' id='dewplayer" .$d_row["recid"]. "' align='middle'>"; $button .= "<param name='wmode' value='transparent' />"; $button .= "<param name='allowScriptAccess' value='sameDomain' />"; $button .= "<param name='movie' value='" .$INSTALL_FOLDER. "mp3previewer/dewplayer-mini.swf?mp3=" . urlencode($d_row["filename_small_mp3"]) . "' />"; $button .= "<param name='quality' value='high' />"; $button .= "<param name='bgcolor' value='FFFFFF' />"; $button .= "<embed src='" .$INSTALL_FOLDER. "mp3previewer/dewplayer-mini.swf?mp3=" . urlencode($d_row["filename_small_mp3"]) . "' "; $button .= "quality='high' bgcolor='FFFFFF' width='160' height='20' name='dewplayer" .$d_row["recid"]. "' wmode='transparent' align='middle' "; $button .= "allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>"; $button .= "</embed>"; $button .= "</object>"; $content[$x]["FILENAME_SMALL_MP3"] = $button; //END //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Classic
Show / Hide code
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //START //Code for Dewplayer mp3 button $button = ""; $button .= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' "; $button .= "width='200' height='20' id='dewplayer" .$d_row["recid"]. "' align='middle'>"; $button .= "<param name='wmode' value='transparent' />"; $button .= "<param name='allowScriptAccess' value='sameDomain' />"; $button .= "<param name='movie' value='" .$INSTALL_FOLDER. "mp3previewer/dewplayer.swf?mp3=" . urlencode($d_row["filename_small_mp3"]) . "' />"; $button .= "<param name='quality' value='high' />"; $button .= "<param name='bgcolor' value='FFFFFF' />"; $button .= "<embed src='" .$INSTALL_FOLDER. "mp3previewer/dewplayer.swf?mp3=" . urlencode($d_row["filename_small_mp3"]) . "' "; $button .= "quality='high' bgcolor='FFFFFF' width='200' height='20' name='dewplayer" .$d_row["recid"]. "' wmode='transparent' align='middle' "; $button .= "allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>"; $button .= "</embed>"; $button .= "</object>"; $content[$x]["FILENAME_SMALL_MP3"] = $button; //END //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Multi
Show / Hide code
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //START //Code for Dewplayer mp3 button $button = ""; $button .= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' "; $button .= "width='240' height='20' id='dewplayer" .$d_row["recid"]. "' align='middle'>"; $button .= "<param name='wmode' value='transparent' />"; $button .= "<param name='allowScriptAccess' value='sameDomain' />"; $button .= "<param name='movie' value='" .$INSTALL_FOLDER. "mp3previewer/dewplayer-multi.swf?mp3=" . urlencode($d_row["filename_small_mp3"]) . "' />"; $button .= "<param name='quality' value='high' />"; $button .= "<param name='bgcolor' value='FFFFFF' />"; $button .= "<embed src='" .$INSTALL_FOLDER. "mp3previewer/dewplayer-multi.swf?mp3=" . urlencode($d_row["filename_small_mp3"]) . "' "; $button .= "quality='high' bgcolor='FFFFFF' width='240' height='20' name='dewplayer" .$d_row["recid"]. "' wmode='transparent' align='middle' "; $button .= "allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>"; $button .= "</embed>"; $button .= "</object>"; $content[$x]["FILENAME_SMALL_MP3"] = $button; //END //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

