How it works
The plugin consists of 4 files :
- mp3-in.php is a template for Winamp, used to generate the playlist.
- mp3-in-sam.php is a template for SAM Broadcaster, used to generate the playlist.
- mp3-out.php is the generated playlist with ID3-tags. This file will be uploaded on your server every time a song plays.
- song_displayer.php is the WordPress plugin to be placed into your /wp-contents/plugins/ directory.
The plugin reads the generated playlist and extracts the information to display the data contained in the ID3v1 tags. If the tags are incomplete or missing, the plugin displays the name of the files. By default, the artist name and song title is displayed, along with the album title if available.
If the playlist hasn't been regenerated in the laps of time you define, the plugin assumes your webradio is off and displays a 'Radio is off' message. Otherwise, it displays the song info on your blog and you can link it to your Shoutcast or Icecast stream.
Install guide for Winamp
First, you need the DoSomething plugin for Winamp.
Once installed, go to Winamp > Préférences > Plugins > General Purpose > DoSomething and select Configure. Activate the plugin by unticking the Disable Plugin box.
In the drop-down menu, select Generate HTML Playlist. In Template In, enter the path of MP3-in.php that resides on your hard-drive. Do the same for Template Out with MP3-out.php. Click Update to save the changes.
Upload the playlist on your server via FTP
Once the playlist generated, you nedd to upload it on your server. Select the FTP service in the drop-down menu and fill in the fields with your FTP account info :
That's it. Now on to the plugin configuration.
Install guide for SAM Broadcaster
Setting up the playlist generation in SAM is pretty straight-forward :
- place mp3-in-sam.php and mp3-out.php in your
- go to File > Config > HTML Output and add a new rule for playlist generation, using
mp3-in-sam.phpas input file and
mp3-out.phpas output file.
- tick Auto-upload generated file via FTP and configure your FTP access.
- done !
Here is a screenshot of the configuration on SAM :
Upload the plugin
You now need to upload song_displayer.php in your /wp-contents/plugins/ directory. Chmod it 666 with your FTP client (right-click on the file > Chmod/permissions > 666) to be able to edit it via WordPress plugin editor.
The plugin has got 3 options : the URL of the playlist (mp3-out.php) from the index page of your blog, the delay in seconds before assuming Winamp is turned off (7 minutes by default, edit this value according to the average length of your songs) and the URL of your webradio stream if you have one.
Data integration on your blog
This is the last step : add the following code to your sidebar.php template where you want the information to appear :
- First parameter : number of lines to display. Default is 1 : current song.
- Second parameter : separator between artist and song names.
- Third parameter : separator used for multiple lines. Default is blank, otherwise put a linebreak.
That's it ! You should now be set and have what's playing in Winamp or SAM Broadcaster displayed on your blog.
Vous souhaitez réaliser un nouveau projet WordPress ou WooCommerce, ou ajouter de nouvelles fonctionnalités? Ou améliorer les performances de votre site?