trouble with the status.xml, please enlighten me :)

Steamcast is a stand alone server that combines the features of SHOUTcast and Icecast2 and more to make one mega awesome server.
Post Reply
SHRIKEE
Posts: 14
Joined: Wed Jul 13, 2005 7:48 am
Location: Netherlands
Contact:

trouble with the status.xml, please enlighten me :)

Post by SHRIKEE »

Hey there, i just installed steamcast and it rocks :) simoultaniously (did i spell that right?) a video and sound stream. YAY!

BUT! now im working on a mod for my website using your status.xml
im wondering: how do i add a tunein button to it. I could just hardcode the url. but then if the stream isnt online it still shows the button, and if i have 2 streams online the 2nd wouldnt be right :S (you know what i mean)

ive been trying to get it from the xml but am not sure how to do this i tried

$val[\'MOUNT\'] and such but to no avail...

so whats the key word :P

[edit]
also im trying to figure out which variable is set to be to true or false or something if a stream exists or not.
Im trying to make it so that the mod is not showing if no stream is active

like

Code: Select all

if($this == true) {
    //show mod
}
[end edit]

Thanks in advance!

PS. (if rava reads this) why is it everywhere i go and shoutcast or streaming stuff is involved i see your name coming up, lol :arrow:
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

you want to use the status item in the sheet. It gives you a status of 1 if there is a source connection. 0 means no source, 2 means disabled.
- Jay
SHRIKEE
Posts: 14
Joined: Wed Jul 13, 2005 7:48 am
Location: Netherlands
Contact:

Post by SHRIKEE »

how do i use that in php?

im not to good with arrays :S

Code: Select all

include "mods/steamcast.php";
if($val['STATUS']==1) {
    print "<tr><td class='headline'><b>Audio/video</b></td></tr>\n";
    while(list($key, $val) = each($sources)){
        print "<tr><td class='leftrow' align='center'>
        <b><a href='".$val['URL']."' target='_blank'>".$val['NAME']."</a></b>
        <br>Uptime: ".floor(((($st - $val['CONNECT_TIME'])/60)/60)/24)."d ".
        (((($st - $val['CONNECT_TIME'])/60)/60)%24)."h ".
        ((($st - $val['CONNECT_TIME'])/60)%60)."m ".
        (($st - $val['CONNECT_TIME'])%60)."s
        <br>Listeners: ".$val['NODES']."/".$val['MAX_NODES']."<br></td></tr>";
    }
}
Post Reply