In this article, we will show you a few different ways to display the status of your shoutcast server on yoru website. This includes current song, listeners, listener peak and other useful information.
The first, would be to download and install the script that WHMSonic have already created or your use. It can be found at the following link: THE NEW SONICRADIO PLAYER SCRIPT ! v2.0.5 | Sonic Development.
You can then edit the HTML code from it and place what you want on your website.
The second, would be to use the included PHP Shoutcast Status script found in Softaculous.
Using the Shoutcast Status script found in Softaculous:
Step 1:
Navigate to the Softaculous icon in your cPanel.
Step 2:
Click on Classes at the top left.
Step 3:
Find the Audio section on the left hand side, then go to page 2 of that section.
Step 4:
Hover over PHP Shoutcast Info and Click Install. Follow the install wizard through.
After this, you will find 3 files in the location you specified in Step 4. They are as follows:
1. ShoutcastInfo.class.php > The file needed to connect and get the info
2. example1.php > This example shows how to collect the data in an array
3. example2.php > This example shows how to present the data in a table
Click to see example 1
Click to see example 2
To configure the script, you need to find the line in both example 1 and 2 as follows:
PHP Code:
$scs = &new ShoutcastInfo('yourdomain:yourport');
Where yourdomain is your domain name and yourport is your radio port number. It will not look like the above, it will have a pre-filled example. The end result should look similar to this:
PHP Code:
$scs = &new ShoutcastInfo('gendns6.com:9988');
The rest is simple HTML editing. You can then use these examples on your own pages to create your own look and feel to the display.