Welcome to the CasterClub Forums.
Header

CasterClub Forums » Broadcasting/Webcasting Software » Feature Requests » SCstatus

Feature Requests If theres a feature you would like to see in our software? Post it here.

Reply
Old 08-12-2006, 04:16 PM   #1
chas
 
Status: Caster Club Member
Join Date: Aug 2006
Posts: 13
chas is on a distinguished road
SCstatus

it adds a online/offline image nicely BUT only when the shoutcast IS running???

Can it Also add an OFFLINE image when the server is NOT ONLINE ??

Reasonable request??
chas is offline   Reply With Quote
Old 08-13-2006, 12:50 PM   #2
davestj
 
davestj's Avatar
 
Status: shutdown -h now
Join Date: Jan 2003
Location: PLANET EARTH
Posts: 3,420
davestj has disabled reputation
Yeah that would be easy to implment,
it already does 2 levels of offline/online checking,

1 is if the server is even up.
2 is if the dsp encoder is connected.



I should be able to get this added this week, its
a simple one.
davestj is offline   Reply With Quote
Old 08-13-2006, 05:02 PM   #3
chas
 
Status: Caster Club Member
Join Date: Aug 2006
Posts: 13
chas is on a distinguished road
it looks like you have the code for the image when the server is not online; so how come the image isnt displayed??
chas is offline   Reply With Quote
Old 08-14-2006, 03:37 AM   #4
davestj
 
davestj's Avatar
 
Status: shutdown -h now
Join Date: Jan 2003
Location: PLANET EARTH
Posts: 3,420
davestj has disabled reputation
which sc status version are you referring to?
davestj is offline   Reply With Quote
Old 08-14-2006, 05:22 PM   #5
chas
 
Status: Caster Club Member
Join Date: Aug 2006
Posts: 13
chas is on a distinguished road
the one you got for download with all the img errors

Quote:
<?php
////////////////////////////////////////////////////////////////////////////////
// script name: sc status
// date: 8/30/2004
// author: dstjohn@mediacast1.com
// cause: checks status of a shoutcast server and display's online or offline status
// version: 1.0 final
// platform independant
// file name: sc_status.php
////////////////////////////////////////////////////////////////////////////////
//do not get cute and monkey with anything below, unless you know what u are doing.
include ('./config.php');
// override ini settings for script execution time, we dont need a minute to decide
// if a server is up or not, 10 seconds should be sufficient.
ini_set("max_execution_time", "10");

//check config settings
if($useimage == 'yes' && $usetext == 'yes'){
echo 'You must choose text display or image display but not both<br>
please edit your config.php file<br>[ERROR: 1]';
exit();
}
//lets initiate a tcp socket connection to determine whether or not the server
//is actualy up.
$scp = @fsockopen($sc_ip, $sc_port, &$errno, &$errstr, 30);
//let me know where or not its up
if(!$scp){
$sock_init = 'FALSE';
}

//show them whether or not the server is actualy up or not
if($sock_init == 'FALSE'){
if($useimage == 'yes'){
echo '<center>'.$station_name.' <br /><img src='.$offline_imgurl.'></center>';
}else if ($usetext == 'yes'){
echo ''.$station_name.' - '.$offline_text.'';
}
}
//check 7.html to see if dsp is connected
if($sock_init != 'FALSE'){
chas is offline   Reply With Quote
Old 08-17-2006, 04:30 PM   #6
chas
 
Status: Caster Club Member
Join Date: Aug 2006
Posts: 13
chas is on a distinguished road
doesnt that show that the code is there??
chas is offline   Reply With Quote
Old 08-17-2006, 06:52 PM   #7
davestj
 
davestj's Avatar
 
Status: shutdown -h now
Join Date: Jan 2003
Location: PLANET EARTH
Posts: 3,420
davestj has disabled reputation
im currently hospitalized, and due to the crapy wireless network
i am unable to do any coding currently.

At this point if the script is not working, check yout config settings,
as the script does work, obviously you cant use image and text
at the same time, if it still wont work, im betting the firewall you
are behind is blocking it.
davestj is offline   Reply With Quote
Old 08-17-2006, 09:36 PM   #8
chas
 
Status: Caster Club Member
Join Date: Aug 2006
Posts: 13
chas is on a distinguished road
oh so get well soon then

its working but only when SC is up and running; the images are only when the dsp is either connected or not connected....

it looks like there is code for when the SC server is not up which it shhows the offline image as well but i dont i see it !!
chas is offline   Reply With Quote
Old 08-18-2006, 12:25 AM   #9
davestj
 
davestj's Avatar
 
Status: shutdown -h now
Join Date: Jan 2003
Location: PLANET EARTH
Posts: 3,420
davestj has disabled reputation
10/13/2005 update

You are using an outdated version,
use the code below or get the source
here
http://www.casterclub.com/downloads/sc_status/dist/

PHP Code:
 <?php 
//////////////////////////////////////////////////////////////////////////////// 
// script name: sc status 
// date: 10/13/2005 
// author: davestj@casterclub.com 
// cause: checks status of a shoutcast server and display's online or offline status 
// version: 0.2b 
// platform independant 
// file name: sc_status.php 
//////////////////////////////////////////////////////////////////////////////// 
//do not get cute and monkey with anything below, unless you know what u are doing. 
include ('./config.php'); 
// override ini settings for script execution time, we dont need a minute to decide 
// if a server is up or not, 10 seconds should be sufficient. 
ini_set("max_execution_time""10"); 

//check config settings 
if($useimage == 'yes' && $usetext == 'yes'){ 
    echo 
'You must choose text display or image display but not both<br> 
         please edit your config.php file<br>[ERROR: 1]'

    exit(); 

//lets initiate a tcp socket connection to determine whether or not the server 
//is actualy up. 
$scp = @fsockopen($sc_ip$sc_port, &$errno, &$errstr30); 
//let me know where or not its up 
    
if(!$scp){ 
        
$sock_init 'FALSE'
    } 

//show them whether or not the server is actualy up or not 
    
if($sock_init == 'FALSE'){ 
        if(
$useimage == 'yes'){ 
            echo 
''.$station_name.' <img srv='.$offline_imgurl.'>'
        }else if (
$usetext == 'yes'){ 
            echo 
''.$station_name.' - '.$offline_text.''
        } 
    } 
//check 7.html to see if dsp is connected 
    
if($sock_init != 'FALSE'){ 
         
fputs($scp,"GET /7.html HTTP/1.0\r\nUser-Agent: SC Status (Mozilla Compatible)\r\n\r\n"); 
         while(!
feof($scp)) { 
              
$sc7 .= fgets($scp1024); 
             } 
//close it up 
@fclose($scp); 
//while we got the page open into memory lets bomb n parse baby. 
$sc7 ereg_replace(".*<body>"""$sc7); 
$sc7 ereg_replace("</body>.*"","$sc7); 
$sc_contents explode(",",$sc7); 
$dummy $sc_contents[0]; 
$dsp_connected $sc_contents[1]; 


//check dsp connection and display the status of the shoutcast server in question 
//do images first 
     
if($sock_init != 'FALSE'){ 
         if(
$dsp_connected == '1' && $useimage == 'yes'){ 
          echo 
''.$station_name.' <img srv='.$online_imgurl.'>'
     }else if (
$dsp_connected != '1' && $useimage == 'yes'){ 
        echo 
''.$station_name.' <img srv='.$offline_imgurl.'>offline image'
     } 

 
//do text if set 
if($sock_init != 'FALSE'){ 
    if (
$dsp_connected == '1' && $usetext == 'yes'){ 
        echo 
''.$station_name.' - '.$online_text.''
     }else if(
$dsp_connected != '1' && $usetext == 'yes'){ 
         echo 
''.$station_name.' - '.$offline_text.''
     } 


}
//end 7.html 
     
//EOF 
?>
davestj is offline   Reply With Quote
Old 08-18-2006, 12:32 AM   #10
Oasis
 
Oasis's Avatar
 
Status: Caster Club Member
Join Date: Aug 2006
Posts: 24
Oasis is on a distinguished road
Quote:
Originally Posted by davestj
You are using an outdated version,
use the code below or get the source
here
http://www.casterclub.com/downloads/sc_status/dist/

PHP Code:
 <?php 
//////////////////////////////////////////////////////////////////////////////// 
// script name: sc status 
// date: 10/13/2005 
// author: davestj@casterclub.com 
// cause: checks status of a shoutcast server and display's online or offline status 
// version: 0.2b 
// platform independant 
// file name: sc_status.php 
//////////////////////////////////////////////////////////////////////////////// 
//do not get cute and monkey with anything below, unless you know what u are doing. 
include ('./config.php'); 
// override ini settings for script execution time, we dont need a minute to decide 
// if a server is up or not, 10 seconds should be sufficient. 
ini_set("max_execution_time""10"); 

//check config settings 
if($useimage == 'yes' && $usetext == 'yes'){ 
    echo 
'You must choose text display or image display but not both<br> 
         please edit your config.php file<br>[ERROR: 1]'

    exit(); 

//lets initiate a tcp socket connection to determine whether or not the server 
//is actualy up. 
$scp = @fsockopen($sc_ip$sc_port, &$errno, &$errstr30); 
//let me know where or not its up 
    
if(!$scp){ 
        
$sock_init 'FALSE'
    } 

//show them whether or not the server is actualy up or not 
    
if($sock_init == 'FALSE'){ 
        if(
$useimage == 'yes'){ 
            echo 
''.$station_name.' <img srv='.$offline_imgurl.'>'
        }else if (
$usetext == 'yes'){ 
            echo 
''.$station_name.' - '.$offline_text.''
        } 
    } 
//check 7.html to see if dsp is connected 
    
if($sock_init != 'FALSE'){ 
         
fputs($scp,"GET /7.html HTTP/1.0\r\nUser-Agent: SC Status (Mozilla Compatible)\r\n\r\n"); 
         while(!
feof($scp)) { 
              
$sc7 .= fgets($scp1024); 
             } 
//close it up 
@fclose($scp); 
//while we got the page open into memory lets bomb n parse baby. 
$sc7 ereg_replace(".*<body>"""$sc7); 
$sc7 ereg_replace("</body>.*"","$sc7); 
$sc_contents explode(",",$sc7); 
$dummy $sc_contents[0]; 
$dsp_connected $sc_contents[1]; 


//check dsp connection and display the status of the shoutcast server in question 
//do images first 
     
if($sock_init != 'FALSE'){ 
         if(
$dsp_connected == '1' && $useimage == 'yes'){ 
          echo 
''.$station_name.' <img srv='.$online_imgurl.'>'
     }else if (
$dsp_connected != '1' && $useimage == 'yes'){ 
        echo 
''.$station_name.' <img srv='.$offline_imgurl.'>offline image'
     } 

 
//do text if set 
if($sock_init != 'FALSE'){ 
    if (
$dsp_connected == '1' && $usetext == 'yes'){ 
        echo 
''.$station_name.' - '.$online_text.''
     }else if(
$dsp_connected != '1' && $usetext == 'yes'){ 
         echo 
''.$station_name.' - '.$offline_text.''
     } 


}
//end 7.html 
     
//EOF 
?>
Hey Dave, is it suppose to be php or phps to save it or does it really matter if you save it phps?
__________________
~ ~ Oasis ~ ~
Oasis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:25 PM.