Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: header.php

Parašė Gasper· 2008 Bal. 21 18:04:37
#1

Sveiki, visi gal kas galetų man į headeri radio panelę įdėti nes man tai persudėtinga:?

<?php
if (!defined("IN_FUSION")) { header("Location: ../../index.php"); exit; }
require_once INCLUDES."theme_functions_include.php";

//  Theme Settings
$body_text = "#555555";
$body_bg = "#ffffff";
$theme_width = "80";
$theme_width_l = "175";
$theme_width_r = "175";

function render_header($header_content) {
global $theme_width,$settings,$locale,$userdata,$aidlink,$db_prefix;

   echo "<table class='forumline' align='center' width='$theme_width' cellspacing='0' cellpadding='0' style='border-right: solid #000000 1px; border-left: solid #000000 1px; border-top: solid #000000 1px; margin-top: -5px;'>";
   echo "<tr><td><table align='center' width='100%' cellspacing='0' cellpadding='0'>";
   echo "<tr><td><table align='center' width='100%' cellspacing='0' cellpadding='0'>";
   echo "<tr><td class='header' width='100%'>";

   echo "<tr><table align=center width=100% height=100 background='".THEME."header.jpg' border=0 cellspacing=0 cellpadding=0>";

echo "</td></tr>
<tr></tr>
<tr><td height=357></td></tr>
</table>";




echo"</td></tr><tr></tr><tr><td></td></tr></table>";


echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";

}

function render_footer($license=false) {
require_once THEME."footer.php";

}

function render_news($subject, $news, $info) {

echo "<table cellpadding='0' cellspacing='0' width='80%' class='naujienu_fonas'>
<tr>
<td><img src='".BASEDIR."themes/Givex_fm/capmain/capmain_01.png' align='center'></td>
</tr>
<tr>
<td>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>

<td class='capmain'>$subject</td>
</table>
</td>
</tr>
<tr>
<td class='main-body'>$news</td>
</tr>

\n";
echo "<tr>
<td align='right' class='news-footer'><font color='cccccc' > Skaityta:[".$info['news_reads']."] |<font color='cccccc' > Komentarai:[".$info['news_comments']."]".($info['news_ext'] == "y" ? "&nbsp; | <a href='news.php?readmore=".$info['news_id']."'>Toliau..</a> \n" : "")."</td>
 
</form>
</tr>\n";
echo "</td>
</tr>
</table><img src='".THEME."capmain/capmain_04.png'>\n";

}


function render_article($subject, $article, $info) {
   
echo "<table width='100%' cellpadding='0' cellspacing='0' class='border'>
<tr>
<td>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<td class='tablo-sol' align='left' width='25'>&nbsp;</td>
<td class='capmain'>$subject</td>
</table>
</td>
</tr>
<tr>
<td class='main-body'>
".($info['article_breaks'] == "y" ? nl2br($article) : $article)."
</td>
</tr>
<tr>
<td align='center' class='news-footer'>\n";

echo "</td>
</tr>
</table>\n";

}

function opentable($title) {

echo "<table cellpadding='0' cellspacing='0' width='100%' class='naujienu_fonas'>
<tr>
<td><img src='".BASEDIR."themes/Givex_fm/capmain/capmain_01.png' align='center'></td>
</tr>

<tr>
<td>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<td class='capmain'>$title</td>
</table>
</td>
</tr>
<tr>
<td class='main-body'>\n";

}

function closetable() {

echo "</td>
</tr>
<tr>
<td height='10'>&nbsp;</td>
</tr>
</table><img src='".THEME."capmain/capmain_04.png'>\n";
tablebreak();
}

function openside($title) {


echo "<table cellpadding='0' cellspacing='0' width='100%' class='paneliu_fonas'>
<tr>
<td><img src='".BASEDIR."themes/Givex_fm/scapmain/scapmain_01.png' align='center'></td>
</tr>
<tr>
<td>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<td class='scapmain'>$title</td>
</table>
</td>
</tr>
<tr>
<td class='side-body'>\n";

}

function closeside() {

echo "</td>
</tr>
<tr>
<td height='10'>&nbsp;</td>
</tr>
</table><center><img src='".THEME."scapmain/scapmain_04.png' <center>\n";
tablebreak();

}

function opensidex($title,$state="on") {

$boxname = str_replace(" ", "", $title);
echo "<table cellpadding='0' cellspacing='0' width='100%' class='border'>
<tr>
<td class='scapmain'>$title</td>
<td width='20%' class='scapmainx' align='center'>".panelbutton($state,$boxname)."</td>
</tr>
<tr>
<td colspan='2' class='side-body'>
<div id='box_$boxname'".($state=="off"?" style='display:none'":"").">\n";

}

function closesidex() {

echo "</div>
</td>
</tr>
<tr>
<td height='10'>&nbsp;</td>
</tr>
</table>\n";
tablebreak();

}

function tablebreak() {

echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td height='10'></td>
</tr>
</table>";

}
?>




Radio Paneles kodas(Tiesa ši panelė paimta iš saito panelių):

openside("");

error_reporting(0);
$scdef = "Technine profilaktika";               // Default station name to display when server or stream is down
$scip = "ip"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = "port";                   // port of shoutcast server
$scpass = "pass";                 // password to shoutcast server
$maxusers = "32"; //Kiek vienu sykiu klausosi zmoniu
//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.' ';
 }
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] == "AIM"))
   $$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 = ""; break;
 case 'Givexas': $aimlogo = ""; break;
case 'Dovis': $aimlogo = ""; break;
case 'Gintaras': $aimlogo = ""; break;
  case 'Saulius': $aimlogo = ""; break;
}
$_SESSION['djus'] = $aim;
echo'<div align="center">
 <table cellpadding="0" cellspacing="0" width="1">
  <!-- MSTaašype="nolayout" -->
  <tr>
   <td height="36" bgcolor="">
   <p align="center">
   <a href="radio ipas"><img border="0" src="http://www.hhhhhh.lt/radio/dj/'.$aimlogo.'.jpg" width="135" heigth="135"></a></td>
  </tr>
  <tr>
   <td height="17" valign="bottom" bgcolor="">
   <div align="center">
    <table cellpadding="0" cellspacing="0" width="130">
     <tr>
   <td height="17">
   <p align="center">
   <b>   <font face="Tahoma" style="font-size: 8pt" color="#777777">Eteryje:</b></font>
   <font face="Tahoma" style="font-size: 8pt" color="#777777">'.$aim.'</font></td>
  </tr>
  <tr>
   <td height="17">
   <p align="center">
   <font face="Tahoma" style="font-size: 8pt" color="#3E1710"><b></b></font>
  <marquee behavior="right"> <font face="Arial" style="font-size: 8pt" color="#777777">'.$daina.'</font></td></marquee></p>

  </tr>
  </tr>
  </table>
                 </div>
   </td>
  </tr>
  <tr>
   <td>
   </td>
  </tr>
 </table>
</div>';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Sveiki yra kile keletas nesklandumu tikimes viskas bus greitai sutvarkyta!.</font>';
}

/*
* Procentai isreiksti grafiskai
* Pavyzdys: Internetines radijos dabartiniai klausytojai
* Yra maksimalus leistinas klausytoju skaicius ir dabar besiklausanciu procentali israiska grafiskai
*/
$pavadinimas = ""; //pavadinimas
$ko = "<b>klausytojų:</b>"; //vienetas (pvz: Lt.)





//pagrindiniai veiksmai
$procentai = (int)round((100 * $currentlisteners) / $maxusers);
$width = $procentai; //paveiksliuko plotis procentaliai
if ($procentai <= 1) {$pic = $nulis_pic; $width = "100";}
elseif ($procentai <= 40) { $pic = $mazas_pic; }
elseif ($procentai <= 80) { $pic = $vidutinis_pic; }
elseif ($procentai <= 100) { $pic = $didelis_pic; }
else { $pic = $didelis_pic; $width = "100"; } //jei daugiau nei 100%

//atvaziduojam lentele su rezultatais
echo "<center><b> $ko  ".$currentlisteners."";



closeside();



Redagavo Gasper· 2008 Bal. 21 18:04:21