View Single Post
  #7  
Old 14th September 2008, 16:57
Slatkis Slatkis is offline
Senior Member
 
Join Date: Aug 2008
Posts: 20
Default
I dont have Listeners becuse I use tbdev and I must change this usergroup but how can you help me thank you

PHP Code:
<?php

?>
<html lang="ro">
<head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title><?= $title ?></title>
<META HTTP-EQUIV="refresh" content="50;URL=http://www.podkrovlje.org/radio/radio.php/">
</head><body bgcolor=#ECE9D8>
<?php
include ( "shoutcast.class.php" ) ;
error_reporting) ;
function 
converteste$seconds )
{


    
$tmpseconds substr"00" $seconds 60, -) ;


    if ( 
$seconds 59 )
    {


        if ( 
$seconds 3599 )
        {


            
$tmphours substr"0" intval($seconds 3600), -) ;


            
$tmpminutes substr"0" intval($seconds 60 - (60 $tmphours)), -) ;


            return ( 
$tmphours ":" $tmpminutes ":" $tmpseconds ) ;


        }
        else
        {


            return ( 
"00:" substr("0" intval($seconds 60), -2) . ":" $tmpseconds ) ;


        }


    }
    else
    {


        return ( 
"00:00:" $tmpseconds ) ;


    }


}
$asc = array();

function 
get_username$ip )
{
global 
$asc,$CURUSER;

    
$query sql_query('SELECT u.id, u.username, u.usergroup, g.namestyle FROM users u LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE ip = \''.$ip.'\' ORDER BY u.last_access DESC LIMIT 1');


    while ( 
$q mysql_fetch_array($query) )
    {
        if(!
in_array($q['username'],$asc)):
        echo 
get_user_color($q['username'],$q['namestyle']);
        endif;
        
$asc[] = $q['username'];

    }


}


$shoutcast = new tcShoutCast() ;


$shoutcast->host "" ;


$shoutcast->port =  ;


$shoutcast->passwd "" ;


echo 
'<table width=100% border=0><tr><td align=left width=50%>' ;


if ( 
$shoutcast->openstats() )
{


    
// We got the XML, gogogo!..


    
if ( $shoutcast->GetStreamStatus() )
    {


        echo 
"<img src=/radio/imagini/dj.gif alt=DJ TC> " $shoutcast->
            
GetServerTitle() . " (" $shoutcast->GetCurrentListenersCount() . "/" $shoutcast->
            
GetMaxListenersCount() . ", peak: " $shoutcast->GetPeakListenersCount() .
            
")<p>\n" ;


        echo 
"\n" ;


        echo 
"<b>Current Song: </b> <img src=/radio/imagini/song1.png> " $shoutcast->
            
GetCurrentSongTitle() . "<BR><b>BitRate: </b>" $shoutcast->GetBitRate() .
            
" <br>" ;


        echo 
"<b>Listeners:</b>\n" ;

        
$listeners $shoutcast->GetListeners() ;

        if ( 
is_array($listeners) )
        {

            for ( 
$i 0$i sizeof($listeners); $i++ )
            {

                echo 
get_username$listeners[$i]["hostname"]) .
                    
"      " ;
              

            }
            

            echo 
" + non-members" ;
            
        }

        else
        {

            echo 
"Noone listens right now.." ;

        }


        echo 
'</td><td align=left valign=middle>' ;


        echo 
"<b>Song history(last 4):</b><br><br>\n" ;


        
$history $shoutcast->istoria() ;


        if ( 
is_array($history) )
        {


            for ( 
$i 0$i <= 3$i++ )
            {


                echo 
" <img src=/radio/imagini/song.png> " $history[$i]["title"] . "<br>\n" ;


            }


        }
        else
        {


            echo 
"<div align=middle>No song history available..</div>" ;


        }
echo 
"</tr><tr><td colspan=2 align=center>";
            if(!
in_array($CURUSER['username'],$asc)) {
                global 
$asc;
            
$q mysql_fetch_assoc(mysql_query("SELECT namestyle FROM usergroups WHERE gid = '$CURUSER[usergroup]' LIMIT 1"));
            
$name get_user_color($CURUSER['username'],$q['namestyle']) ;
            echo 
"<center>Hei, $name, listen to the Radio!!!</center>";
            }
          
#  echo "<center>These stats are IP based.</center>";


    
}
    else
    {


        echo 
"<div align=middle>There is no DJ online!</div>" ;


    }


}
else
{


    
// Ohhh, damnit..


    
echo $shoutcast->geterror() ;


}


echo 
'</td></tr></table>' ;



?>



</body>



</html>
Reply With Quote