Thread Info
Shoutcast anzeige im Header einabuen
|
|
DjKuschelteufel |
Geschrieben am 02.11.2009 00000011 16:59
|
Mitglied ![]() Beiträge: 128 Registriert am: 19.03.09 Fusioneer: 16 years 4 months 3 weeks 21 days 10 hours 10 minutes 40 seconds |
Hallo, undzwar möchte ich gern eine shoutcast anzeige in meine theme.php im headerbereich einfügen, allerdings weiss ich nicht was für ein code ich nutzen muss bzw wo er dann auch eingebaut werden kann??? Bitte um hilfe |
|
|
SC-Ad-Bot | Advertisement |
| |
Dat Tunes |
Geschrieben am 02.11.2009 00000011 17:59
|
![]() Moderator ![]() Beiträge: 477 Registriert am: 07.12.08 Fusioneer: 16 years 8 months 0 weeks 1 days 7 hours 40 minutes 19 seconds |
Huhu, schau dir mal den beitrag an , vielleicht hilft dir das weiter. http://www.phpfusion-supportclub.de/c...ad_id=1286 Gruss Mystik Leute ohne Macke, sind Kacke ![]() Oh Herr, schmeiss Grundwissen von Himmel ! |
|
|
DjKuschelteufel |
Geschrieben am 03.11.2009 00000011 12:57
|
Mitglied ![]() Beiträge: 128 Registriert am: 19.03.09 Fusioneer: 16 years 4 months 3 weeks 21 days 10 hours 10 minutes 40 seconds |
tut mir leid es geht leider nicht, wie ich schon sagte wär schön wenn mir jemand sagen könnte welchen code ich wo einfügen muss :-) |
|
|
Dat Tunes |
Geschrieben am 03.11.2009 00000011 13:01
|
![]() Moderator ![]() Beiträge: 477 Registriert am: 07.12.08 Fusioneer: 16 years 8 months 0 weeks 1 days 7 hours 40 minutes 19 seconds |
Bekommst du gar nix angezeigt ? Schau mal nach ob bei dir in der theme.php die funktion showbanner vorhanden ist. Wenn nicht such dir mal ein theme, wo die funktion dabei ist und bau es dann ein und versuche es dann noch mal. Hatte bei mir damals auch geklappt Leute ohne Macke, sind Kacke ![]() Oh Herr, schmeiss Grundwissen von Himmel ! |
|
|
DjKuschelteufel |
Geschrieben am 03.11.2009 00000011 13:53
|
Mitglied ![]() Beiträge: 128 Registriert am: 19.03.09 Fusioneer: 16 years 4 months 3 weeks 21 days 10 hours 10 minutes 41 seconds |
nein bekomme nix angezeigt |
|
|
Dat Tunes |
Geschrieben am 03.11.2009 00000011 17:25
|
![]() Moderator ![]() Beiträge: 477 Registriert am: 07.12.08 Fusioneer: 16 years 8 months 0 weeks 1 days 7 hours 40 minutes 20 seconds |
Hab hier noch nen Code für V6, kannst ja mal gucken ob du dir den evtl. anpassen kannst , ist auch mit bildanzeige. Hab den auch mal von jemanden bekommen , aber nie ausprobiert unter v7. Kannst ja dein Gluck mal versuchen. [geshi=php]$serverioIP = "IP Adresse"; $serverioPORT = "Port"; //Shoutcas serverio portas $naujienos = BASEDIR."news.php"; $komanda = BASEDIR."viewpage.php?page_id=1"; $forumas = BASEDIR."forum/index.php"; $pageidavimai = BASEDIR."infusions/suggestion_box/suggestion_box.php"; $galerija = BASEDIR."photogallery.php"; $top20 = BASEDIR."infusions/song_charts/charts.php"; $laidosz = BASEDIR."#"; $kontaktai = BASEDIR."contact.php"; $body_text = "#000000"; $body_bg = "#000000"; $theme_width = "900"; $theme_width_l = "170"; $theme_width_r = "170"; function render_header($header_content) { global $theme_width,$settings,$serverioIP,$serverioPORT,$naujienos,$komanda,$forumas,$pageidavimai,$galerija,$top20,$laidosz,$kontaktai; //////////////// //Radio info/// ////////////// error_reporting(1); class Radio { var $fields; var $very_first_str; var $domain, $port; var $errno, $errstr; var $trackLists = array(); function Radio($domain, $port) { $this->domain = $domain; $this->port = $port; $this->setOffset("Current Stream Information"); $this->setTableStart("<table border=0 cellpadding=2 cellspacing=2>"); $this->setTableEnd("</table>"); } function setFields($array=array()) { $this->fields = $array; } function setOffset($string) { $this->very_first_str = $string; } function setTableStart($string) { $this->tableStart = $string; } function setTableEnd($string) { $this->tableEnd = $string; } function getHTML($page) { $contents = ""; $domain = (substr($this->domain, 0, 7) == "http://") ? substr($this->domain, 7) : $this->domain; if ($fp = fsockopen($domain, $this->port, $this->errno, $this->errstr, 2)) { fputs($fp, "GET ".$page." HTTP/1.1\r\n". "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)\r\n". "Host: ".$domain."\r\n\r\n"); while (!feof($fp)) $contents .= fgets($fp, 256); fclose ($fp); return $contents; } else { return False; } } function getServerInfo($page="/", $display_array=null, $very_first_str=null) { if (!isset($display_array)) $display_array = $this->fields; if (!isset($very_first_str)) $very_first_str = $this->very_first_str; if ($html = $this->getHTML($page)) { // parsing the contents foreach ($display_array AS $key => $item) { $very_first_pos = stripos($html, $very_first_str); $first_pos = stripos($html, $item, $very_first_pos); $line_start = strpos($html, "<td>", $first_pos); $line_end = strpos($html, "</td>", $line_start) + 4; $difference = $line_end - $line_start; $line = substr($html, $line_start, $difference); $data[$key] = strip_tags($line); } return $data; } else { return $this->errstr." (".$this->errno.")"; } } function createHistoryArray($page) { if (!in_array($page, $this->trackLists)) { $this->trackLists[] = $page; if ($html = $this->getHTML($page)) { $fromPos = stripos($html, $this->tableStart); $toPos = stripos($html, $this->tableEnd); $tableData = substr($html, $fromPos, ($toPos-$fromPos)); $lines = explode("</tr><tr>", $tableData); $tracks = array(); $c = 0; foreach ($lines AS $line) { $info = explode ("</td><td>", $line); $time = trim(strip_tags($info[0])); if (substr($time, 0, 9) != "Copyright") { $this->tracks[$c]['time'] = $time; $this->tracks[$c++]['track'] = trim(strip_tags($info[1])); } } unset($this->tracks[0]); $this->tracks[1]['track'] = str_replace("Current Song", "", $this->tracks[1]['track']); } else { $this->tracks[0] = array("time"=>$this->errno, "track"=>$this->errstr); } } } function getHistoryArray($page="/played.html") { if (!in_array($page, $this->trackLists)) $this->createHistoryArray($page); return $this->tracks; } function getHistoryTable($page="/played.html", $timeColText=False, $trackColText=False, $class=False) { if (!in_array($page, $this->trackLists)) $this->createHistoryArray($page); $output = "<table".($class ? " class=\"".$class."\"" : "").">"; if ($timeColText && $trackColText) $output .= "<tr><td>".$timeColText."</td><td>".$trackColText."</td></tr>"; foreach ($this->tracks AS $trackArr) $output .= "<tr><td>".$trackArr['time']."</td><td>".$trackArr['track']."</td></tr>"; $output .= "</table>\n"; return $output; } } if (!function_exists("stripos")) { function stripos($haystack, $needle, $offset=0) { return strpos(strtoupper($haystack), strtoupper($needle), $offset); } } $display_array = array("Stream Title", "Stream Genre", "Stream URL", "Current Song", "Content Type", "Stream Status", "Server Status"); $radio = new Radio($serverioIP, $serverioPORT); $data_array = $radio->getServerInfo("/", $display_array); error_reporting(1); if ($data_array[0] == "A"){ $djimg = BASEDIR."images/djs/off.gif"; }else{ if (file_exists(BASEDIR."images/djs/".$data_array[1].".gif")) { $djimg = BASEDIR."images/djs/".$data_array[1].".gif"; }else{ $djimg = BASEDIR."images/djs/none.gif"; }} if($data_array[0] == "A"){ $dje = "Tyla"; }else{ $dje = $data_array[1]; $laida = $data_array[0]; } if($data_array[3] == "o"){ $dainaa = "Tyla"; }else{ $dainaa = $data_array[3]; } if($data_array[0] == "Server is currently down.") { $dje = "Tyla"; $dainaa = "Tyla"; $laida = ""; $djimg = BASEDIR."images/djs/off.gif"; } [/geshi] Wünsche dir viel Glück damit Leute ohne Macke, sind Kacke ![]() Oh Herr, schmeiss Grundwissen von Himmel ! |
|
|
Anaconda |
Geschrieben am 03.11.2009 00000011 22:45
|
![]() Jung Mitglied ![]() Beiträge: 13 Registriert am: 07.03.09 Fusioneer: 16 years 5 months 0 weeks 3 days 9 hours 14 minutes 11 seconds |
der code ist super kann den jemand auf v7 anpassen ??? weil dann würde ich das auch gerne nehmen .... |
|
Springe ins Forum: |