Quick Sign In:  

Forum: Dutch Forum

Topic: shoutcast scripts voor op mijn site

This topic is old and might contain outdated or incorrect information.

ik heb een vraag ik heb een aantal scripts gevonde voor op mijn site
ik heb een script gevonden voor mijn site.
ik wil ze omgezet hebben van php naar html

heir is script nr. 1 =

<?php
/***************************************************************************
* stats.php
* -------------------
* begin : Sunday, Aug 21, 2006
* owner : AtomicOxide.co.uk - Dave
* email : dave@atomicoxide.co.uk
*
*
***************************************************************************/

/***************************************************************************
*
* This program is a free script; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/////////////////////////////////////////////////////////////////////////////
# DO NOT EDIT BELOW THIS LIME. #
/////////////////////////////////////////////////////////////////////////////
include ("includes/config.php");
$timeout='6';
$listenlink='http://'.$radiohost.':'.$radioport.'/listen.pls';
$radio=fsockopen("$radiohost", $radioport, &$errno, &$errstr, $timeout);
if(!$radio){
$success='2';
echo $radioofflinemsg; // Radio is offline, so display message
die();
}
//Connect to the server
if($success!='2'){ //If Connection
fputs($radio,"Get /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //Get 7.HTML
while(!feof($radio)){
$page.=fgets($radio, 1000);
}

$page=ereg_replace(".*<body>", "", $page);
$page=ereg_replace("</body>.*", ",", $page);
$numbers=explode(",",$page);
$currentlisteners=$numbers[0];
$connected=$numbers[1];
//Open Connection
$fp=fsockopen("$radiohost", $radioport, &$errno, &$errstr, 3);
if(!$fp){ //If Connection
$success2='2';
echo "The Radio Server Is Currently Offline";
}
if($success2!='2'){ //If Connected
fputs($fp,"Get /admin.cgi?pass=$radiopassword&mode=viewxml HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)){
$page.= fgets($fp, 1000);
}
$security=explode(",",$page);
$security=explode("401",$security[7]);
$u='0';
while($security[$u]!=""){
if($security[1]!=''){
die("Incorrect Server Password");
}
$u++;
}
//Array
$loop=array("AVERAGETIME", "SERVERGENRE", "SERVERURL", "SERVERTITLE", "SONGTITLE", "SONGURL", "IRC", "ICQ", "AIM", "WEBHITS", "STREAMHITS", "INDEX", "LISTEN", "PALM7",
"LOGIN", "LOGINFAIL", "PLAYED", "COOKIE", "ADMIN", "UPDINFO", "KICKSRC", "KICKDST", "UNBANDST", "BANDST", "VIEWBAN", "UNRIPDST", "VIEWRIP", "VIEWXML",
"VIEWLOG", "INVALID"); //Define All The Variables To Get (Delete Any Ones You Don't Want)
$y='0';
while($loop[$y]!=''){
$pageed=ereg_replace(".*<$loop[$y]>", "", $page); //Extract Data
$phpname=strtolower($loop[$y]);
$$phpname=ereg_replace("</$loop[$y]>.*", "", $pageed); //Finish Extracting Data
if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE)
$$phpname=urldecode($$phpname);
$phpname = $phpname;
$y++;
}
}
if($connected=='1')
$wordconnected="yes";
else
$wordconnected="no";
$peaklisteners=$numbers[2];
$maxlisteners=$numbers[3];
$reportedlisteners=$numbers[4];
$song=$numbers[6];
$bitrate=$numbers[5];
$site=explode(" ", $servertitle);
$title=explode("DJ",$servertitle);
if($wordconnected=="no" && $connected=="0")
{
echo $radioofflinemsg;
}else{
echo"<div align=\"center\">
<table align=\"center\">
<tr>
<td align=\"center\">
<a href=\"http://$serverurl\">$servertitle</a>
</td>
</tr>
<tr>
<td align=\"center\">
<center>$reportedlisteners/$maxlisteners Listeners<br />Bitrate: ".$bitrate."Kbps<p>
Current Song: <br />$numbers[6]</p>
</td>
</tr>
<tr>
<td align=\"center\">
<a href=$listenlink></a>
</td>
</tr>
<tr>
<td align=\"center\"><br />
<object id=\"MediaPlayer\" type=\"application/x-oleobject\" height=\"40\" standby=\"Please wait while we start the radio!\" width=\"170\" classid=\"CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6\">
<param NAME=\"URL\" ref value=\"http://$radiohost:$radioport\">
<param NAME=\"rate\" value=\"1\">
<param NAME=\"balance\" value=\"0\">
<param NAME=\"currentPosition\" value=\"0\">
<param NAME=\"defaultFrame\" value>
<param NAME=\"playCount\" value=\"1\">
<param NAME=\"autoStart\" value=\"0\">
<param NAME=\"currentMarker\" value=\"0\">
<param NAME=\"invokeURLs\" value=\"-1\">
<param NAME=\"baseURL\" value>
<param NAME=\"volume\" value=\"100\">
<param NAME=\"mute\" value=\"0\">
<param NAME=\"uiMode\" value=\"mini\">
<param NAME=\"stretchToFit\" value=\"1\">
<param NAME=\"windowlessVideo\" value=\"0\">
<param NAME=\"enabled\" value=\"-1\">
<param NAME=\"enableContextMenu\" value=\"-1\">
<param NAME=\"fullScreen\" value=\"0\">
<param NAME=\"SAMIStyle\" value>
<param NAME=\"SAMILang\" value>
<param NAME=\"SAMIFilename\" value>
<param NAME=\"captioningID\" value>
<param NAME=\"enableErrorDialogs\" value=\"0\">
<param NAME=\"_cx\" value=\"4763\">
<param NAME=\"_cy\" value=\"1058\">
</object>
</td></tr>
</table>
</div>
";
//Close Connection
fclose($radio);
}
}
/////////////////////////////////////////////////////////////////////////////
# Atomic Network Productions #
/////////////////////////////////////////////////////////////////////////////
?>





nummer 2 =
<?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// ©2004-2005 Daniel Brown http://www.gmtt.co.uk
// Please refer to the readme file for use.


// Add-On MAXLISTNERS insead of the / 10 MAXLISTENERS which was set, and the BITRATE add-on.
// Online and Offline graphics, and add-on code.
// Better HTML Script.

// Do Not Try To Edit This Only Unless You Know What You're Doing!!!!!!!

include('config_radio.php');

$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' is Offline';
}
if($scsuccs!=1){
fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while(!feof($scfp)) {
$page .= fgets($scfp, 1000);
}
######################################################################################################################
/////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//define xml elements
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE");
$y=0;
while($loop[$y]!=''){
$pageed = ereg_replace(".*<$loop[$y]>", "", $page);
$scphp = strtolower($loop[$y]);
$$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE)
$$scphp = urldecode($$scphp);

// uncomment the next line to see all variables
//echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
######################################################################################################################
######################################################################################################################
/////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//get song info and history
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$r=1;
while($songatime[$r]!=""){
$t=$r-1;
$playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);
$playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);
$song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);
$song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);
$song[$t] = urldecode($song[$t]);
$dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
//end song info
fclose($scfp);
}

//display stats
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel=stylesheet href="" type="text/css">
<title>'.$scdef.'</title>
</head>

<body text="" bgcolor="">


<p align="center"><center>
<img src="online.jpg"><br>
<b>Stream Title:</b> '.$servertitle.'<br>
<b>Listeners:</b> '.$currentlisteners.' / '.$maxlisteners.'<br>
<b>Bitrate:</b> '.$bitrate.'kbps<br>
<b>Current Song:</b> '.$song[0].'</p><b>
</p>
</body>

</html>';
}
if($streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel=stylesheet href="" type="text/css">
<title>Radio Server Is Offline</title>
</head>

<body text="" bgcolor="">
<center>
<img src="offline.jpg">
</body>

</html>';
}
?>

please convert ze
 

Posted Thu 23 Dec 10 @ 3:47 pm
Sorry, maar dit heeft absoluut niets met VDJ te maken. Ik stel voor dat je een forum zoekt waar je vrij over scripts kan posten en je hier aan onderwerpen over VDJ houdt.
 

Posted Fri 24 Dec 10 @ 3:26 am


(Old topics and forums are automatically closed)