Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
<?php//eval ("\$boxlinks[]= \"".getTemplate("navigation/test3")."\";");
?>
<?php
//include('./global.php');
//include('./config5.php');
$host = "localhost"; //Hostname, or ip address of server. IE blah.com or xx.xx.xx.xx
$port = "1212"; //Port server is running on. IE 8000
$password = "party"; //Password of server, can be normal or admin. Doesn't matter.
//Configuration Finished
//Runs each time an XML element starts
function StartHandler(&$Parser, &$Elem, &$Attr) {
global $Data, $CData;
/* Start with empty CData array. */
$CData = array();
/* Put each attribute into the Data array. */
while ( list($Key, $Val) = each($Attr) ) {
$Data["$Elem:$Key"] = trim($Val);
// debug // echo "$Elem:$Key = " . $Data["$Elem:$Key"] . "\n";
}
}
//Runs each time XML character data is encountered
function CharacterHandler(&$Parser, &$Line) {
global $CData;
/*
* Place lines into an array because elements
* can contain more than one line of data.
*/
$CData[] = $Line;
}
//Runs each time an XML element ends
function EndHandler(&$Parser, &$Elem) {
global $Data, $CData, $listeners, $server, $song, $dj, $wee;
//Mush all of the CData lines into a string and put it into the $Data array.
$Data[$Elem] = trim( implode('', $CData) );
//echo "$Elem = " . $Data[$Elem] . "<br>\n";
switch ($Elem){
//for each case, we are putting some data into a variable.
case 'AIM':
$dj['AIM'] = $Data['AIM'];
break;
}
}
//open connection
$fp = fsockopen("$host", $port, &$errno, &$errstr, 30);
if (!$fp) {
echo "Connection to server could not be established! <BR>";
}
else {
//request xml
fputs($fp,"GET /admin.cgi?pass=".$password."&mode=viewxml&page=0 HTTP/1.0\nUser-Agent: Mozilla Compatible\n\n");
while(!feof($fp)) {
//put xml into $Data
$Contents .= fgets($fp, 1000);
}
}
//close connection
fclose($fp);
$Contents = str_replace('HTTP/1.0 200 OK','', $Contents);
$Contents = str_replace('Content-Type:text/xml','', $Contents);
$Contents = str_replace("\n",'', $Contents);
$Contents = str_replace("\r",'', $Contents);
$Contents = preg_replace('/(&|&)/i', '&', $Contents);
$Contents = preg_replace('/[^\x20-\x7E\x09\x0A\x0D]/', "\n", $Contents);
$Data = array();
// Initialize the parser.
$Parser = xml_parser_create('ISO-8859-1');
xml_set_element_handler($Parser, 'StartHandler', 'EndHandler');
xml_set_character_data_handler($Parser, 'CharacterHandler');
//Pass the content string to the parser.
if (!xml_parse($Parser, $Contents)) {
$Probs[] = "<img src=images/radio_offline.gif ";
}
if (isset($Probs)) {
echo implode("\n", $Probs);
}
//Output
$listeners['AVERAGETIME'] = $listeners[AVERAGETIME]/10;
$wee = $wee -1;
$search = 'balu';
$replace = '<IMG SRC="dj-bilder/balu.jpg" width="100" height="73" BORDER="0"></A><br>';
echo str_replace($search, $replace, "
<tr><td></td><td>{$dj[AIM]}</td></tr>\n
");
$search = 'playlist';
$replace = '<IMG SRC="dj-bilder/playlist.jpg" width="100" height="73" BORDER="0"></A><br>';
echo str_replace($search, $replace, "
<tr><td></td><td>{$dj[AIM]}</td></tr>\n
");
$search = 'alex_kola@hotmail.de';
$replace = '<IMG SRC="dj-bilder/kola.jpg" width="100" height="73" BORDER="0"></A><br>';
echo str_replace($search, $replace, "
<tr><td></td><td>{$dj[AIM]}</td></tr>\n
");
$search = 'NA';
$replace = '<IMG SRC="dj-bilder/off.jpg" width="100" height="73" BORDER="0"></A><br>';
echo str_replace($search, $replace, "
<tr><td></td><td>{$dj[AIM]}</td></tr>\n
");
?>;
<html>
<table border="0" width="18%">
<tr>
<td width="44">
<p align="center"><a href="http://party-radio.net:1212/listen.pls">
<img border="0" src="./winamp-Icon.gif" width="44" height="41"></a></td>
<td width="45">
<p align="center"><a href="http://party-radio.net/media2.m3u">
<img border="0" src="./mplayer.jpg" width="42" height="43"></a></td>
<td>
<p align="center"><a href="http://party-radio.net/live2.ram">
<img border="0" src="./icon_real.gif" width="44" height="44"></a></td>
</tr>
</table>
</html>
|
This post has been edited 1 times, last edit by "s-maisch" (Apr 20th 2008, 12:55pm)
|
|
HTML Code |
1 2 3 4 |
<tr><td></td><td><IMG SRC="dj-bilder/balu.jpg" width="100" height="73" BORDER="0"></A><br></td></tr> <tr><td></td><td>balu</td></tr> <tr><td></td><td>balu</td></tr> <tr><td></td><td>balu</td></tr> |
|
|
HTML Code |
1 |
<tr><td></td><td><IMG SRC="dj-bilder/balu.jpg" width="100" height="73" BORDER="0"></A><br></td></tr> |
|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
$search = 'balu'; $replace = '<IMG SRC="dj-bilder/balu.jpg" width="100" height="73" BORDER="0"></A><br>'; echo str_replace($search, $replace, " <tr><td></td><td>{$dj[AIM]}</td></tr>\n "); $search = 'playlist'; $replace = '<IMG SRC="dj-bilder/playlist.jpg" width="100" height="73" BORDER="0"></A><br>'; echo str_replace($search, $replace, " <tr><td></td><td>{$dj[AIM]}</td></tr>\n "); $search = 'alex_kola@hotmail.de'; $replace = '<IMG SRC="dj-bilder/kola.jpg" width="100" height="73" BORDER="0"></A><br>'; echo str_replace($search, $replace, " <tr><td></td><td>{$dj[AIM]}</td></tr>\n "); $search = 'NA'; $replace = '<IMG SRC="dj-bilder/off.jpg" width="100" height="73" BORDER="0"></A><br>'; echo str_replace($search, $replace, " <tr><td></td><td>{$dj[AIM]}</td></tr>\n "); |
|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$search = 'balu'; $replace = '<IMG SRC="dj-bilder/balu.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = '<tr><td></td><td>{$dj[AIM]}</td></tr>\n' $output = str_replace($search, $replace, $output); $search = 'playlist'; $replace = '<IMG SRC="dj-bilder/playlist.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = str_replace($search, $replace, $output); $search = 'alex_kola@hotmail.de'; $replace = '<IMG SRC="dj-bilder/kola.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = str_replace($search, $replace, $output); $search = 'NA'; $replace = '<IMG SRC="dj-bilder/off.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = str_replace($search, $replace, $output); echo $output; |
|
|
Source code |
1 |
UPDATE d0nut: Quellcode entfernt da Copyright behaftet |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 |
$search = 'DJ Balu Baer'; $replace = '<IMG SRC="dj-bilder/balu.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = str_replace($search, $replace, $output); $search = 'playlist'; $replace = '<IMG SRC="dj-bilder/playlist.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = str_replace($search, $replace, $output); $search = 'alex_kola@hotmail.de'; $replace = '<IMG SRC="dj-bilder/kola.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = str_replace($search, $replace, $output); $search = 'NA'; $replace = '<IMG SRC="dj-bilder/off.jpg" width="100" height="73" BORDER="0"></A><br>'; $output = str_replace($search, $replace, $output); |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
if($streamstatus == "1"){
echo $output;
$boxlinks[]='
<em class="important">» DSL Streams:</em><br/>
<table border="0" cellspacing="1" cellpadding="1">
<tr><td align="center"><a target="_blank" href="'.$scwinamp.'"><img border="0" src="images/winamp.gif"></a>
<a target="_blank" href="'.$scmedia.'"><img border="0" src="images/wmplayer.gif"></a>
<a target="_blank" href="'.$screal.'"><img border="0" src="images/realplayer.gif"></a></td></tr>
<tr><td>
<br>
<em class="important">» Jetzt läuft:</em><br>
<h1 style="font-size:83%">'.$song[0].'</font>
<br/><br>
</td></tr>
<tr><td align="left">
</table>';
}
else
|