Old 27th December 2003, 05:21   #1
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Online checker for website / signature

Okay, I have been working on this for about a week. The only thread close is "Festerhead's Signature" but i dont understand that. Can somebody please help me. I want to put a small window on my website to show if I am broadcasting, what I am broadcasting, or if im not broadcasting. Nothing more, nothing less. Please do not give me a link to another thread beacause i have checked them all and they do not seem to help me at all. This is important to me because I am not broadcasting at all times. Please help.


Playin' the best classic rock trax
www.ruffdawgradio.com
ruffdawg is offline   Reply With Quote
Old 27th December 2003, 05:36   #2
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
have you searched the formus? I know I've posted an example PHP somewhere. All thats needed is to add the meat to the bones.

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 27th December 2003, 05:37   #3
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Ive tried some php stuff and it just comes in as plain text... is there any way you can give me some meat for the bones?
ruffdawg is offline   Reply With Quote
Old 27th December 2003, 05:48   #4
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
do you have a PHP enabled webserver?

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 27th December 2003, 15:07   #5
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
yes i do
ruffdawg is offline   Reply With Quote
Old 28th December 2003, 00:38   #6
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Okay what I have done is I have used asp coding and i seem to have a problem. When I am not broadcasting, It comes up a page cannot be displayed method. I am not running it on the same server as my station... my asp server is running 24/7. My asp code is:

code:

<%
' ANOTHER SHOUTCAST STATUS PAGE

' By Philip 'daPhil' Johannessen, May 2003
' www.daphil.com
' me@daphil.com

'FEEL FREE TO EDIT LAYOUT TO SUIT YOUR SITE, THATS THE IDEA


'USER DEFINED VARIABLES (CHANGE THESE)
ServerDomain = "**.**.***.**" 'DOMAIN
ServerPass = "******" 'PASSWORD
ServerPort = "8000" 'PORT

'MAKE SERVERURL
ServerURL = "http://"& ServerDomain &":"& ServerPort &"/admin.cgi?pass="& ServerPass &"&mode=viewxml"

'INITIATE XMLDOM ENGINE
Set objXMLDOM = Server.Createobject("Microsoft.XMLDOM")
objXMLDOM.async = false
objXMLDOM.setProperty "ServerHTTPRequest", true
objXMLDOM.Load ServerURL

'CREATE COLLECTIONS AND STUFF
ServerStatus = objXMLDOM.SelectSingleNode("//STREAMSTATUS").text
StationName = objXMLDOM.SelectSingleNode("//SERVERTITLE").text
BitRate = objXMLDOM.SelectSingleNode("//BITRATE").text
ServerVersion = objXMLDOM.SelectSingleNode("//VERSION").text
MediaType = objXMLDOM.SelectSingleNode("//CONTENT").text
CurrentSong = objXMLDOM.SelectSingleNode("//SONGTITLE").text
Set UserList = objXMLDOM.SelectNodes("//LISTENER")
%>

<html>
<head>
<title><%=StationName%></title>
<style>
body, td {
font-family: Trebuchet MS, Tahoma, Verdana;
font-size: 10px;
color: #000000;
}

.bigheader {
font-size: 19px;
}

.songtitle {
font-size: 13px;
}

.tables {
border-width: 1px;
border-style: solid;
border-color: #000000;
background: #EEEEEE;
}
</style>
</head>
<body>
<table align="center" width="700" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" colspan="2">
<font class="bigheader"><%=StationName%></font><br>
<% If ServerStatus = 0 Then %>
Server is currently down
</td>
<% Else %>
Shoutcast v<%=ServerVersion%> streaming <%=MediaType%> at <%=BitRate%> kbps
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2" align="center">
Current song
<table width="65%" class="tables">
<tr>
<td align="center">
<font class="songtitle"><%=CurrentSong%></font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr> </table>
</td>
<td width="50%" align="center" valign="top">
<table cellpadding="2" cellspacing="0" border="0" class="tables" width="98%" align="right">
<% For Each User In UserList %>
<tr>

</tr>
<% Next %>
</table>
</td>
<% End If %>
</tr>
</table>
</body>
</html>
<%
'CLEAN UP
Set objXMLDOM = NOTHING
Set UserList = NOTHING
%>



is there some kind of code error. The link for my asp is: http://aa.1asphost.com/ruffdawg/RDR.asp

it is being used on my web site www.ruffdawgradio.tk

Please help, thanks in advance.
ruffdawg is offline   Reply With Quote
Old 28th December 2003, 00:49   #7
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
I don't know ASP so couldn't exactly tell you your problem...

However an example in PHP would be this
PHP Code:
<?PHP
if (@fsock_open($ip$port$error1$error21))
  {} 
// run on if true
else { die("Station Offline"); }
?>
simple as that. Sorry for not totally using proper coding protocol.

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 28th December 2003, 00:55   #8
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Thanks for the quick response. I've tried php and its just to hard. I used php codes/progs and it always comes up as text. Asp is just easier for me. in my coding it says:

<% If ServerStatus = 0 Then %>
Server is currently down

Its something with that part of the code that isnt working. Im getting a "Page cannot be displayed", i should at least get a plain text message, id be happy with that. Is there any html code i can use so if a page does not come up it can be automatically redirected to another. That way i can create a new page with just text. I am using a frame to display my .asp message. is there any coding you can help me with? Thanx
ruffdawg is offline   Reply With Quote
Old 28th December 2003, 00:56   #9
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
for some reason you must not have PHP enabled on the web service. Actually I find PHP quite eazy to learn lol. It was the first language I learned!

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 28th December 2003, 01:01   #10
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
actually, i went to this web site: www.clickherefree.com and found a php enabled server there. ... i even checked out some software in the winamp thing and it didnt work. I dunno, i just want something basic. Have you done anything similar that im trying to do? if so what did you do? lol ill take any info i can get
ruffdawg is offline   Reply With Quote
Old 28th December 2003, 01:12   #11
DJHotIce
Forum Loser
(Forum King)
 
DJHotIce's Avatar
 
Join Date: Jan 2003
Location: That place I can't remember the name.
Posts: 4,617
Send a message via AIM to DJHotIce Send a message via Yahoo to DJHotIce
actually no. I used to have a station and the network I was with required 24/7 station you may wish to try www.krradio.com which uses the fsock_open() feature to show the current status of his streams, additionally for more fundamental reasons, try using www.festerhead.com from the famous moderator himself

-DJHotIce
Bounce Multimedia - Professional Web Design
DJHotIce is offline   Reply With Quote
Old 28th December 2003, 19:18   #12
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
Here's my code:
code:

<?

$check1 = fsockopen("IP", "PORT");

if ($check1) {
echo ("<image border='0' src='images/thumbsup.gif' title='Stream is up!'>");
$close = fclose($check1);
}
else
echo ("<image border='0' src='images/thumbsdown.gif' title='Stream is down!'>");

?>


FesterHead is offline   Reply With Quote
Old 4th January 2004, 00:15   #13
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Thx guys for all your help, I finally got it to work using Ramage's Script. (Thnx DJRampage) But one question still remains, where can I change the font size? My code is listed at http://www.lunchbreak.net/rampageradio/black.txt Thanx in advance.


Playin' the best classic rock trax
www.ruffdawgradio.com
ruffdawg is offline   Reply With Quote
Old 4th January 2004, 02:32   #14
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
Check out the PHP definitions for imagestring and imagettftext.

FesterHead is offline   Reply With Quote
Old 4th January 2004, 02:35   #15
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Hi, I know its something in here:

code:

$px = (imagesx($im)-5*strlen($string1))/2;
ImageString($im,1,$px,5,$string1,$text_color1);
// (image,font (from 1 to 5),starting x position, y position,line of text,color)
$px = (imagesx($im)-5*strlen($string2))/2;
ImageString($im,1,$px,20,$string2,$text_color2);
$px = (imagesx($im)-5*strlen($string3))/2;
ImageString($im,1,$px,30,$string3,$text_color2);
$px = (imagesx($im)-5*strlen($string4))/2;
ImageString($im,1,$px,45,$string4,$text_color1);



im just note sure what and where to type in. Thnx in Advance.


Playin' the best classic rock trax
www.ruffdawgradio.com
ruffdawg is offline   Reply With Quote
Old 4th January 2004, 02:36   #16
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
Quote:
Check out the PHP definitions for imagestring and imagettftext.
The function definition for imagestring will tell you.

FesterHead is offline   Reply With Quote
Old 4th January 2004, 02:50   #17
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
Oh lol sorry, i thought it meant font type (arial, comic sans MS, Etc.) Next time I won't waste your time with something so obviously stupid. Thnx again!


Playin' the best classic rock trax
www.ruffdawgradio.com
ruffdawg is offline   Reply With Quote
Old 5th January 2004, 07:21   #18
teddyfrost
Junior Member
 
Join Date: Jan 2004
Posts: 4
I too am interested in adding a simple php script to display not only if the station is online, but hopefully the dj, and track too.

Is there an easy way to do this? I know php fairly well but ihave never used fsock, so If anyone can post a well commented example (showing which variables should contrain which data it would be VERY much appreciated
teddyfrost is offline   Reply With Quote
Old 5th January 2004, 11:40   #19
ruffdawg
Major Dude
 
ruffdawg's Avatar
 
Join Date: Feb 2003
Location: Mississauga, Ontario, Canada (Sauga Represent!)
Posts: 565
I had trouble before, and now I found a proper PHP Code. You can find it Here At least it works for me. It tells you exactly what to fill in. Hope this helps.


Playin' the best classic rock trax
www.ruffdawgradio.com
ruffdawg is offline   Reply With Quote
Old 5th January 2004, 14:57   #20
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,108
Yeah.

A reply here and a new thread (locked).

FesterHead is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

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