Old 5th September 2006, 09:46   #1
oehjg
Junior Member
 
Join Date: Oct 2003
Posts: 9
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?
oehjg is offline   Reply With Quote
Old 5th September 2006, 13:12   #2
tuckerm
Forum Emo
 
tuckerm's Avatar
 
Join Date: Mar 2005
Posts: 8,364
Click SHOUTcast 101 below and scroll down to the goodie part.
tuckerm is offline   Reply With Quote
Old 5th September 2006, 17:10   #3
oehjg
Junior Member
 
Join Date: Oct 2003
Posts: 9
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
oehjg is offline   Reply With Quote
Old 5th September 2006, 18:59   #4
tuckerm
Forum Emo
 
tuckerm's Avatar
 
Join Date: Mar 2005
Posts: 8,364
You'll have to conntact them for the exact script because i've never seen it.
tuckerm is offline   Reply With Quote
Old 6th September 2006, 16:29   #5
Nick@ss
Moderator
 
Nick@ss's Avatar
 
Join Date: Nov 2004
Location: Streamsolutions Headquarters
Posts: 11,953
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
Nick@ss is offline   Reply With Quote
Old 6th September 2006, 16:56   #6
Clausel
Junior Member
 
Join Date: Oct 2005
Posts: 35
Send a message via ICQ to Clausel
lol, its funny to see our script stolen and now given as example
Clausel is offline   Reply With Quote
Old 8th September 2006, 07:31   #7
oehjg
Junior Member
 
Join Date: Oct 2003
Posts: 9
nick@ss not realy, there is no script for me. Or i`m blind

sry for my english
oehjg is offline   Reply With Quote
Old 8th September 2006, 07:50   #8
zee100
Senior Member
 
Join Date: Nov 2003
Location: Germany
Posts: 169
What sence does it make?
When I'm listening, I know this myself and don't need it to display on a webpage.
zee100 is offline   Reply With Quote
Old 8th September 2006, 22:51   #9
SCPanel.NET
Member
 
Join Date: Aug 2006
Posts: 59
Send a message via AIM to SCPanel.NET
Are you just looking to do a simple display of "1 user connected" or are you looking to publish more detailed live listener stats.
SCPanel.NET is offline   Reply With Quote
Old 10th September 2006, 09:13   #10
oehjg
Junior Member
 
Join Date: Oct 2003
Posts: 9
the user that listening
oehjg is offline   Reply With Quote
Old 10th September 2006, 09:37   #11
zee100
Senior Member
 
Join Date: Nov 2003
Location: Germany
Posts: 169
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.

Last edited by zee100; 10th September 2006 at 10:20.
zee100 is offline   Reply With Quote
Old 11th September 2006, 09:40   #12
oehjg
Junior Member
 
Join Date: Oct 2003
Posts: 9
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 is offline   Reply With Quote
Old 18th September 2006, 08:56   #13
oehjg
Junior Member
 
Join Date: Oct 2003
Posts: 9
thx
oehjg is offline   Reply With Quote
Old 7th October 2006, 20:54   #14
AlexIT
Junior Member
 
Join Date: Aug 2006
Location: Italy
Posts: 28
Send a message via ICQ to AlexIT
Fatal error: Call to undefined function: simplexml_load_string() in /home2/*****/*****/admin/list.php on line 67
AlexIT is offline   Reply With Quote
Old 7th October 2006, 20:59   #15
zee100
Senior Member
 
Join Date: Nov 2003
Location: Germany
Posts: 169
You need a server or webspace that support php 5!
Still problems?
Try the zip file.
http://www.magic104.longmusic.com/php.zip
zee100 is offline   Reply With Quote
Old 8th October 2006, 01:49   #16
hackerdork
Forum King
 
hackerdork's Avatar
 
Join Date: Feb 2006
Location: Earth Circa sometime.
Posts: 3,297
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

~ According to the ship's log we're down to our last 3000 vomit bags.It'll never be enough.
search the forums! don't PM me on how-to, or ask me to setup you system. you do it so you learn.
hackerdork is offline   Reply With Quote
Old 3rd January 2007, 12:50   #17
AlexIT
Junior Member
 
Join Date: Aug 2006
Location: Italy
Posts: 28
Send a message via ICQ to AlexIT
It`s OK now, on PHP5 no more errors.
Thanx.
AlexIT is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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