Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   Shoutcast Discussions (http://forums.winamp.com/forumdisplay.php?f=9)
-   -   show currently listening (http://forums.winamp.com/showthread.php?t=254853)

oehjg 5th September 2006 09:46

show currently listening
 
pls i need help for my page.

i will show the listener on the page he is currently listening my stream or not

can anywone help me?

tuckerm 5th September 2006 13:12

Click SHOUTcast 101 below and scroll down to the goodie part.

oehjg 5th September 2006 17:10

sry but i dont find my answer.

i will it have so:

http://techno4ever.info/t4e/news.html

you can see it on the top of this page
the page show you, becorse you are listening or not

tuckerm 5th September 2006 18:59

You'll have to conntact them for the exact script because i've never seen it.

Nick@ss 6th September 2006 16:29

many scripts can be found here.
http://www.streamsolutions.co.uk/index.php?page=scripts

how you work them and make them look is up to you,

i hope this helps

Clausel 6th September 2006 16:56

lol, its funny to see our script stolen and now given as example :)

oehjg 8th September 2006 07:31

nick@ss not realy, there is no script for me. Or i`m blind

sry for my english

zee100 8th September 2006 07:50

What sence does it make?
When I'm listening, I know this myself and don't need it to display on a webpage.

SCPanel.NET 8th September 2006 22:51

Are you just looking to do a simple display of "1 user connected" or are you looking to publish more detailed live listener stats.

oehjg 10th September 2006 09:13

the user that listening

zee100 10th September 2006 09:37

Quote:

Originally posted by oehjg
the user that listening
Well, should this display the name of the user or just the IP, useragent, listening time.....
Please tell us more.

Perhaps this will help?

PHP Code:

<html>
<body bgcolor="#333333" text="orange">

<meta http-equiv="Refresh" content="30" />
<div align="center">
<?php
function sec2hms ($sec$padHours false
  {

    
// holds formatted string
    
$hms "";
    
    
// there are 3600 seconds in an hour, so if we
    // divide total seconds by 3600 and throw away
    // the remainder, we've got the number of hours
    
$hours intval(intval($sec) / 3600); 

    
// add to $hms, with a leading 0 if asked for
    
$hms .= ($padHours
          ? 
str_pad($hours2"0"STR_PAD_LEFT). ':'
          
$hours':';
     
    
// dividing the total seconds by 60 will give us
    // the number of minutes, but we're interested in 
    // minutes past the hour: to get that, we need to 
    // divide by 60 again and keep the remainder
    
$minutes intval(($sec 60) % 60); 

    
// then add to $hms (with a leading 0 if needed)
    
$hms .= str_pad($minutes2"0"STR_PAD_LEFT). ':';

    
// seconds are simple - just divide the total
    // seconds by 60 and keep the remainder
    
$seconds intval($sec 60); 

    
// add to $hms, again with a leading 0 if needed
    
$hms .= str_pad($seconds2"0"STR_PAD_LEFT);

    
// done!
    
return $hms;
    
  }

?>
<?php
$host 
"209.9.226.67";
$port "9660";
$pass "xxxxxxxxx";

$sp = @fsockopen($host$port, &$errno, &$errstr10);
$sp_data "";

if (!
$sp)
    die(
'Error while connecting to Server.');
else{
    
stream_set_blocking($spfalse);
    
fputs($sp"GET /admin.cgi?pass=" $pass "&mode=viewxml HTTP/1.1\nUser-Agent: Mozilla\n\n");
    for(
$i 0$i 30$i++) {
        if(
feof($sp))
            break;
        
$sp_data .= fread($sp31337);
        
usleep(500000);
    }
}

$sp_data ereg_replace("^.*<SHOUTCASTSERVER""<SHOUTCASTSERVER"$sp_data);
$xml simplexml_load_string($sp_data);

if(isset(
$xml->LISTENERS->LISTENER)){
    foreach(
$xml->LISTENERS->LISTENER as $listener){
        echo
"<font color=#ffffff font face=verdana size=1><b> Host - IP: " $listener->HOSTNAME "</b></font><br />\n";
        echo 
"<font color=#FFcc00 font face=verdana size=1><b> Media Player: " $listener->USERAGENT "</b></font><br> \n";
echo 
"<font color=#ffffff font face=verdana size=1><b>Listening time: " sec2hms($listener->CONNECTTIME) . "</b></font><hr> \n";
    }
}
else
    echo 
"no listeners";
?> 
</div> 
</body>
</html>

Needs php5

Example here.

oehjg 11th September 2006 09:40

Yes but the Script not work i have this Prob:

Fatal error: Call to undefined function: simplexml_load_string() in /home/t/*********/public_html/radiostatus/status5.php on line 67

The Server has php5!

Zee100 Du bist Deutscher?

Das Script ist super nur was ich jetzt brauche das das Script die IP vom Homepage besucher jetzt mit den IPs der Zuhöhrer vergleicht und dann ausgibt ob er Zuhört oder nicht. Irgendwie blick ich das nicht ganz, gut das Prob ist ehh das ich ne Fehlermeldung bekomm wenn ich Dein ScruÃ_pt laufen hab

oehjg 18th September 2006 08:56

thx

AlexIT 7th October 2006 20:54

Fatal error: Call to undefined function: simplexml_load_string() in /home2/*****/*****/admin/list.php on line 67

zee100 7th October 2006 20:59

You need a server or webspace that support php 5!
Still problems?
Try the zip file.
http://www.magic104.longmusic.com/php.zip

hackerdork 8th October 2006 01:49

crap anohter install of PHP that doesnt have xml support. If you are the admin, well you need to add the xml parser (php extention) if someone else is the server admin ask them to get it installed.

I installed php4 or php5 on all my servers with the correct extentions and every script written in php related to shoutcast has always worked.

Cheers

~ D

AlexIT 3rd January 2007 12:50

It`s OK now, on PHP5 no more errors.
Thanx. :up:


All times are GMT. The time now is 14:34.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.