Gytisz
Narys
Buldozeris
Pranešimai: 317
Įstojęs: 2010 Spa. 9 15:10:08
|
Parodyk daina.php failą 0
Va čia tai bairis... |
T-Boy
Narys
Kapitonas
Pranešimai: 670
Įstojęs: 2010 Kov. 4 21:03:46
|
<?php
error_reporting(0);
$scdef = "Šiuo metu radija yra."; // Default station name to display when server or stream is down
$scip = "localhost"; // ip or url of shoutcast server (DO NOT ADD <a href='HTTP://' target='_blank'><span style='color:005C5B'>HTTP://</span></a> don't include the port)
$scport = "8000"; // port of shoutcast server
$scpass = "changeme"; // password to shoutcast server
//End configuration
error_reporting(0);
$scsuccs = NULL;
$page = NULL;
$scfp = @fsockopen("$scip", $scport, $errno, $errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.'išjungta';
}
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]);
$AIM[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$AIM[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
$daina = str_replace('_',' ',substr ($song[0],0,90));
//end song info
fclose($scfp);
}
//Eterio Foto
if($streamstatus == "1"){
switch ($aim) {
case 'Dj Dede': $aimlogo = "Dede"; break;
case 'dJ BaNgIs': $aimlogo = "BaNgIs"; break;
case 'Dj Montis': $aimlogo = "Montis"; break;
case 'Dj': $aimlogo = "foto pavadinimas"; break;
case 'Dj': $aimlogo = "foto pavadinimas"; break;
case 'Dj': $aimlogo = "foto pavadinimas"; break;
default: $aimlogo = "dj";
}
$_SESSION['djus'] = $aim;
// daina groja
echo''.$daina.'';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Šiuo metu radija yra išjungta.</font>';
}
?>
0
|
avice
Narys
Terminatorius
Pranešimai: 1441
Įstojęs: 2010 Bir. 25 20:06:33
|
<div id="now_playing">
<div id="now">Now playing:</div>
<div id="line"></div>
<div id="playing"><?php include_once "daina.php"; echo $daina ?></div>
</div>
Bet yra bet, matau tavo daina.php
kuris ir turetu atvaizduot, beto kam tos kabutes echo ''.$daina.''? nepaprasciau echo $daina?0
|
T-Boy
Narys
Kapitonas
Pranešimai: 670
Įstojęs: 2010 Kov. 4 21:03:46
|
Gerai. Pakeičiau tą include pagal tave ir tą kintamąjį pertvarkiau pagal tave, dėkui už šį patarimą, tačiau vistiek nieko nauja. Viskas lygiai tas pats. Kaip nerodo, taip nerodo 0
|
Gytisz
Narys
Buldozeris
Pranešimai: 317
Įstojęs: 2010 Spa. 9 15:10:08
|
Tavo vietoj daryčiau šitaip:
<?php
error_reporting(0);
$scdef = "Šiuo metu radija yra."; // Default station name to display when server or stream is down
$scip = "localhost"; // ip or url of shoutcast server (DO NOT ADD <a href='HTTP://' target='_blank'><span style='color:005C5B'>HTTP://</span></a> don't include the port)
$scport = "8000"; // port of shoutcast server
$scpass = "changeme"; // password to shoutcast server
//End configuration
error_reporting(0);
$scsuccs = NULL;
$page = NULL;
$scfp = @fsockopen("$scip", $scport, $errno, $errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo''.$scdef.'išjungta';
}
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]);
$AIM[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
$AIM[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
$daina = str_replace('_',' ',substr ($song[0],0,90));
//end song info
fclose($scfp);
}
//Eterio Foto
if($streamstatus == "1"){
switch ($aim) {
case 'Dj Dede': $aimlogo = "Dede"; break;
case 'dJ BaNgIs': $aimlogo = "BaNgIs"; break;
case 'Dj Montis': $aimlogo = "Montis"; break;
case 'Dj': $aimlogo = "foto pavadinimas"; break;
case 'Dj': $aimlogo = "foto pavadinimas"; break;
case 'Dj': $aimlogo = "foto pavadinimas"; break;
default: $aimlogo = "dj";
}
$_SESSION['djus'] = $aim;
// daina groja
echo '<div id="now_playing">';
echo '<div id="now">Now playing:</div>';
echo '<div id="line"></div>';
echo '<div id="playing">';
echo''.$daina.'';
echo '</div></div>';
}
if($streamstatus == "0")
{
echo'<font size="2" face="tahoma" color="#6C6D7B">Šiuo metu radija yra išjungta.</font>';
}
?>
Tada iš dizainos kodo išimam šias eilutes:
<div id="now_playing">
<div id="now">Now playing:</div>
<div id="line"></div>
<div id="playing"><?php include_once "daina.php"; echo $daina ?></div>
</div>
ir pakeičiam į
<?php include_once "daina.php"; ?>
beto galbūt neįrašiai serverio duomenų kad nerodo kokia daina groja ?0
Va čia tai bairis...
Redagavo Gytisz 2014 Kov. 18 19:03:29 |
T-Boy
Narys
Kapitonas
Pranešimai: 670
Įstojęs: 2010 Kov. 4 21:03:46
|
Duomenys visi surašyti ir tikrai gerai! dėkui, kad stengiesi, bet net pats pasimečiau, nes vistiek kažkas negerai. Nu man tikrai viskas čia tvarkingai atrodo, bet kame esmė, tai nebepagaunu... 0
|
Gytisz
Narys
Buldozeris
Pranešimai: 317
Įstojęs: 2010 Spa. 9 15:10:08
|
Būna kažkoks erroras? Kokį serverį naudoji? Icecast/shoutcast? Jai icecast šiuo atvėju radijos panelė netinka. 0
Va čia tai bairis...
Redagavo Gytisz 2014 Kov. 18 20:03:19 |
T-Boy
Narys
Kapitonas
Pranešimai: 670
Įstojęs: 2010 Kov. 4 21:03:46
|
Erroro visiškai jokio. Naudoju shoutcast. Tiesiog nerodo jokio teksto. 0
|
Gytisz
Narys
Buldozeris
Pranešimai: 317
Įstojęs: 2010 Spa. 9 15:10:08
|
Bandyk šitaip.
Daina.php:
<?php
$ip = "ip adresas";
$port = "portas";
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
$title = "Serveris išjungtas";
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace('</body></html>', "", $info);
$split = explode(',', $info);
if (empty($split[6]) )
{
$title = "Daina neturi savo duomenu!";
}
else
{
$count = count($split);
$i = "6";
while($i<=$count)
{
if ($i > 6)
{
$title .= ", " . $split[$i];
}
else
{
$title .= $split[$i];
}
$i++;
}
}
}
$title = substr($title, 0, -2);
echo '<div id="now_playing">';
echo '<div id="now">Now playing:</div>';
echo '<div id="line"></div>';
echo '<div id="playing">';
echo '.$title.';
echo '</div></div>';
?>
Tada iš dizainos kodo išimam šias eilutes:
<div id="now_playing">
<div id="now">Now playing:</div>
<div id="line"></div>
<div id="playing"><?php include_once "daina.php"; echo $daina ?></div>
</div>
ir pakeičiam į
<?php include_once "daina.php"; ?>
0
Va čia tai bairis...
Redagavo Gytisz 2014 Kov. 18 20:03:51 |
T-Boy
Narys
Kapitonas
Pranešimai: 670
Įstojęs: 2010 Kov. 4 21:03:46
|
Neveikia. Išvis dingsta eilutė, kur turėtų rodyti pavadinimą. Nesvarbu tada. Paduosiu koduotojui, kuris tvarkė seniau šitą dizainą, kad sutvarkytų iki galo. Dėkui už pagalbą, pakėliau įvertinimą 0
|
Gytisz
Narys
Buldozeris
Pranešimai: 317
Įstojęs: 2010 Spa. 9 15:10:08
|
Galbūt galėčiau užmesti akį kur darai? Į pm 0
Va čia tai bairis... |
avice
Narys
Terminatorius
Pranešimai: 1441
Įstojęs: 2010 Bir. 25 20:06:33
|
O tau apskritai veikia tas script'as niekur neincludinus? t.y atidarant paprastai adressas.lt/daina.php ? 0
|
T-Boy
Narys
Kapitonas
Pranešimai: 670
Įstojęs: 2010 Kov. 4 21:03:46
|
Taip, veikia man tas daina.php. Kątik iš kito dizaino išsitraukia tą eterio panelę ir sukeičiau, bet bėda tai ta pati. Turiu nuojautą, kad čia blogai includina. Ir čia šiaip tik HTML dizainas, tai gal visai kažkaip tą include reikia daryti? 0
|