Новичок
Покинул форум
Сообщений всего: 32
Дата рег-ции: Март 2012
Откуда: Japan
Помог: 0 раз(а)
|
Здравствуйте!
Сегодня столкнулся с данной проблеммой после перехода на новый сервер ВПС. Я впервые поставил ВертригоСерв, раньше все вручную стояло...
Перенес сайт вместе со скриптами, которые там работали отлично, а тут куча ошибок полезло...
Вот скрипты:
Скрипт №1
Ошибки
Notice: Undefined offset: 4 in C:\Program Files (x86)\VertrigoServ\www\PHP_Scripts\song2.php on line 18
Спойлер (Отобразить)
<?php
$data = file_get_contents('http://www.frost-fm.ru:8000/status.xsl?mount=/FrostFM');
function antara($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
$link = 'http://www.frost-fm.ru/stol_zakazov/web/index.php';
header("Content-type: text/html; charset=windows-1251");
if(antara($data, "Content Type:</td>\n<td class=\"streamdata\">","</td>") ==''){
$link = 'http://www.frost-fm.ru/index.php?newsid=12';
$data = file_get_contents('http://www.frost-fm.ru:8000/status.xsl?mount=/FrostFM.SWTOR');}
if(antara($data, "Content Type:</td>\n<td class=\"streamdata\">","</td>") ==''){
$link = 'www.frost-fm.ru/index.php?newsid=11';
$data = file_get_contents('http://www.frost-fm.ru:8000/status.xsl?mount=/FrostFM.AION');}
if(antara($data, "Content Type:</td>\n<td class=\"streamdata\">","</td>") ==''){
$link = '';
$data = file_get_contents('http://www.frost-fm.ru:8000/status.xsl?mount=/FrostFM.NoExist');}
$data = iconv("utf-8", "cp1251", $data);
$title = antara($data, "Stream Title:</td>\n<td class=\"streamdata\">","</td>");
$description = antara($data, "Stream Description:</td>\n<td class=\"streamdata\">","</td>");
$content_type = antara($data, "Content Type:</td>\n<td class=\"streamdata\">","</td>");
$Mount_started = antara($data, "Mount started:</td>\n<td class=\"streamdata\">","</td>");
$Bitrate = antara($data, "Bitrate:</td>\n<td class=\"streamdata\">","</td>");
$Current_listeners = antara($data, "Current Listeners:</td>\n<td class=\"streamdata\">","</td>");
$Peak_listeners = antara($data, "Peak Listeners:</td>\n<td class=\"streamdata\">","</td>");
$Stream_genre = antara($data, "Peak Listeners:</td>\n<td class=\"streamdata\">","</td>");
$Stream_url = antara($data, "Stream URL:</td>\n<td class=\"streamdata\">","</td>");
$Current_song = antara($data, "Current Song:</td>\n<td class=\"streamdata\">","</td>");
$hellp_curr_listeners = antara($hellp, "Сейчас слушают:</td>\n<td class=\"streamdata\">","</td>");
$hellp_peak_listeners = antara($hellp, "Максимум было</td>\n<td class=\"streamdata\">","</td>");
$Curr_listens=$Current_listeners2+$Current_listeners+$hellp_curr_listeners;
$Peak_listens=$Peak_listeners2+$Peak_listeners+$hellp_peak_listeners;
$staylst=$Curr_listens+1;
echo '<span style="font-size: 0.72em; font-family:Trebuchet MS, Tahoma, Arial, sans-serif; color:#3090c3">
<span style="font-size: large;"><br><b>В эфире:</span><span style="font-size: small; font-family:Trebuchet MS, Tahoma, Arial, sans-serif; color:#3090c3;"><a href="'.$link.'" ><br>'.$title.'</a></b><br></span><span style="font-size: small;">
<span style="font-size: large; font-family:Trebuchet MS, Tahoma, Arial, sans-serif; color:#3090c3"><br><b>У руля:</b><br></span><span style="font-size: small; font-family:Trebuchet MS, Tahoma, Arial, sans-serif; color:#3090c3"> '.$description.' <br></span>
<span style="font-size: large; font-family:Trebuchet MS, Tahoma, Arial, sans-serif; color:#3090c3"><br><b>Сейчас в эфире:</b><br></span><span style="font-size: small; font-family:Trebuchet MS, Tahoma, Arial, sans-serif; color:#3090c3"> '.$Current_song.' <br></span>
<center></center>';
?>
Скрипт №2
Ошибки
Notice: Undefined variable: hellp in C:\Program Files (x86)\VertrigoServ\www\PHP_Scripts\slusateli.php on line 41
Notice: Undefined variable: hellp in C:\Program Files (x86)\VertrigoServ\www\PHP_Scripts\slusateli.php on line 42
Notice: Undefined variable: Current_listeners2 in C:\Program Files (x86)\VertrigoServ\www\PHP_Scripts\slusateli.php on line 43
Notice: Undefined variable: Peak_listeners2 in C:\Program Files (x86)\VertrigoServ\www\PHP_Scripts\slusateli.php on line 44
Спойлер (Отобразить)
<?php
header("Content-type: text/html; charset=windows-1251");
$xml[1] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.xspf");
$xml[2] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.ogg.xspf");
$xml[3] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.SWTOR.ogg.xspf");
$xml[4] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.SWTOR.xspf");
$xml[5] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.AION.xspf");
$xml[6] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.AION.ogg.xspf");
$xml[7] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.NoExist.ogg.xspf");
$xml[8] = simplexml_load_file("http://www.frost-fm.ru:8000/FrostFM.NoExist.xspf");
//по необходимости увеличиваем
$kp=8; //количество потоков
$i=1;
$vsego=0;
while ($i <= $kp) {
$ano = $xml[$i]->trackList->track->annotation;
$mass=explode("\n", $ano);
$kol=substr($mass[4],18);
$i=$i+1;
$vsego=$vsego+$kol;
}
echo "<b><br>Слушают:<br></b><b> " .$vsego; "<br></b> "
?>
Уже устал копаться в гугли, ничего не нашел толкового, прошу руку помощи, необходимо исправить ошибки, из-за них 1й скрипт вообще не работает, а на сколько хорошо работает 2й я не знаю...
Я ошибки убирал с помощью php_value error_reporting 7, но мне нужно от них избавиться и что б скрипты работали...
|