|
From: Jon O. <jon...@us...> - 2008-02-08 23:44:12
|
Update of /cvsroot/mxbb/mx_shotcast In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15467 Modified Files: db_install.php db_uninstall.php db_upgrade.php radioplayer.php shotcast_front.php shotcast_last10.php Log Message: Removing trailing newlines... Index: db_uninstall.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/db_uninstall.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_uninstall.php 2 Oct 2007 04:40:05 -0000 1.2 --- db_uninstall.php 8 Feb 2008 23:44:04 -0000 1.3 *************** *** 19,23 **** // Start session management // ! $mx_user->init($user_ip, PAGE_INDEX); if( !$userdata['session_logged_in'] ) --- 19,23 ---- // Start session management // ! $mx_user->init($user_ip, PAGE_INDEX); if( !$userdata['session_logged_in'] ) *************** *** 62,64 **** echo '<tr><td class="row1" align="center"><span class="gen">' . $message . '</span></td></tr>'; echo '</table> <br />'; ! ?> --- 62,64 ---- echo '<tr><td class="row1" align="center"><span class="gen">' . $message . '</span></td></tr>'; echo '</table> <br />'; ! ?> \ No newline at end of file Index: shotcast_front.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast_front.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shotcast_front.php 2 Oct 2007 04:52:17 -0000 1.3 --- shotcast_front.php 8 Feb 2008 23:44:05 -0000 1.4 *************** *** 79,96 **** if( empty($currentlisteners) && empty($text[2]) ) ! { ! $howmanypeak = $currentlisteners = $text[2] = $shotcast_config['currentlisteners']; } ! else if (empty($currentlisteners) && ($text[2] > 0)) ! { ! $howmanypeak = $currentlisteners = $text[2]; } else if( ($currentlisteners > 0) && ($text[2] > 0)) { ! $howmanypeak = ($currentlisteners > $text[2]) ? $currentlisteners : $text[2]; } else { ! $howmanypeak = $text[2]; } --- 79,96 ---- if( empty($currentlisteners) && empty($text[2]) ) ! { ! $howmanypeak = $currentlisteners = $text[2] = $shotcast_config['currentlisteners']; } ! else if (empty($currentlisteners) && ($text[2] > 0)) ! { ! $howmanypeak = $currentlisteners = $text[2]; } else if( ($currentlisteners > 0) && ($text[2] > 0)) { ! $howmanypeak = ($currentlisteners > $text[2]) ? $currentlisteners : $text[2]; } else { ! $howmanypeak = $text[2]; } *************** *** 186,188 **** unset($liteners, $sql, $howmanylisten, $listeners_list, $block_size, $module_root_path, $isimler, $can_listen); ! ?> --- 186,188 ---- unset($liteners, $sql, $howmanylisten, $listeners_list, $block_size, $module_root_path, $isimler, $can_listen); ! ?> \ No newline at end of file Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/db_upgrade.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_upgrade.php 2 Oct 2007 04:40:05 -0000 1.2 --- db_upgrade.php 8 Feb 2008 23:44:04 -0000 1.3 *************** *** 91,93 **** echo "</table><br />"; ! ?> --- 91,93 ---- echo "</table><br />"; ! ?> \ No newline at end of file Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/db_install.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_install.php 2 Oct 2007 04:40:04 -0000 1.2 --- db_install.php 8 Feb 2008 23:44:04 -0000 1.3 *************** *** 95,97 **** echo "</table><br />"; ! ?> --- 95,97 ---- echo "</table><br />"; ! ?> \ No newline at end of file Index: radioplayer.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/radioplayer.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** radioplayer.php 2 Oct 2007 04:40:13 -0000 1.2 --- radioplayer.php 8 Feb 2008 23:44:04 -0000 1.3 *************** *** 19,23 **** $state = ($text[1] == 1) ? 'Up' : 'Down'; $text[2] = !empty($text[2]) ? $text[2] : $currentlisteners; ! $text[5] = !empty($text[5]) ? $text[5] : $bitrate; $song[0] = !empty($song[0]) ? $song[0] : $text[6]; user_listensc($nick); --- 19,23 ---- $state = ($text[1] == 1) ? 'Up' : 'Down'; $text[2] = !empty($text[2]) ? $text[2] : $currentlisteners; ! $text[5] = !empty($text[5]) ? $text[5] : $bitrate; $song[0] = !empty($song[0]) ? $song[0] : $text[6]; user_listensc($nick); *************** *** 148,150 **** </map> </body> ! </html> --- 148,150 ---- </map> </body> ! </html> \ No newline at end of file Index: shotcast_last10.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast_last10.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** shotcast_last10.php 2 Oct 2007 04:52:18 -0000 1.2 --- shotcast_last10.php 8 Feb 2008 23:44:05 -0000 1.3 *************** *** 1,3 **** ! <?php /** * --- 1,3 ---- ! <?php /** * *************** *** 35,86 **** include_once($module_root_path . 'getinfo.'.$phpEx); ! $bgcolor = '#ffffff'; // Page background color ! $tablew = '100%'; // Table width ! $tableh = '1'; ! $toprow = '#c0c0c0'; // Top background color ! $bottom = '#ffffff'; // Bottom background color ! $border = '#000000'; // Border color ! $thickness = '2'; // Border thickness ! $padding = '4'; // Cell padding ! $font = 'Verdana'; // Font ! $fontsize = '2'; // Font size $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); ! $refresh = '30'; // How often should it refresh? (seconds) ! // Return JavaScript or HTML ! $jsOutput=FALSE; // TRUE=js | FALSE=HTML ! // try to get the target from the url... /* ! $host = $_REQUEST[host]; ! if (!$host) $host = $yourIP; ! $port = $_REQUEST[port]; ! if (!$port) $port = $yourPORT; */ ! $host = $shotcast_config['shotcast_host']; // IP adress or domain $port = $shotcast_config['shotcast_port']; // Port if( empty($lang['Before_that_you_heard']) && empty($lang['Now_Playing']) ) ! { $lang['Before_that_you_heard'] = "Before that you heard"; ! $lang['Now_Playing'] = "Now Playing"; ! $lang['Off_Air'] = "The server is <b>Off-Air</b>, try again later."; } ! $lf = chr(10); // 0x0A [\n] ! // The lastN is configurable at the DNAS with, ShowLastSongs= it defaults to 10 and has a maximum of 20 ! $t_max = $_REQUEST[n]; ! if (!t_max || $t_max<1 || $t_max>19) $t_max=10; ! //19 is the max here because 20=current_track+19 ! // Let's get /index.html first... to keep this short, there is no code to handle the dnas being down ! // or not running, so the script will display nothing in those cases. ! $connect_timeout=5; ! $success=0; --- 35,86 ---- include_once($module_root_path . 'getinfo.'.$phpEx); ! $bgcolor = '#ffffff'; // Page background color ! $tablew = '100%'; // Table width ! $tableh = '1'; ! $toprow = '#c0c0c0'; // Top background color ! $bottom = '#ffffff'; // Bottom background color ! $border = '#000000'; // Border color ! $thickness = '2'; // Border thickness ! $padding = '4'; // Cell padding ! $font = 'Verdana'; // Font ! $fontsize = '2'; // Font size $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); ! $refresh = '30'; // How often should it refresh? (seconds) ! // Return JavaScript or HTML ! $jsOutput=FALSE; // TRUE=js | FALSE=HTML ! // try to get the target from the url... /* ! $host = $_REQUEST[host]; ! if (!$host) $host = $yourIP; ! $port = $_REQUEST[port]; ! if (!$port) $port = $yourPORT; */ ! $host = $shotcast_config['shotcast_host']; // IP adress or domain $port = $shotcast_config['shotcast_port']; // Port if( empty($lang['Before_that_you_heard']) && empty($lang['Now_Playing']) ) ! { $lang['Before_that_you_heard'] = "Before that you heard"; ! $lang['Now_Playing'] = "Now Playing"; ! $lang['Off_Air'] = "The server is <b>Off-Air</b>, try again later."; } ! $lf = chr(10); // 0x0A [\n] ! // The lastN is configurable at the DNAS with, ShowLastSongs= it defaults to 10 and has a maximum of 20 ! $t_max = $_REQUEST[n]; ! if (!t_max || $t_max<1 || $t_max>19) $t_max=10; ! //19 is the max here because 20=current_track+19 ! // Let's get /index.html first... to keep this short, there is no code to handle the dnas being down ! // or not running, so the script will display nothing in those cases. ! $connect_timeout=5; ! $success=0; *************** *** 89,258 **** if (@phpversion() < '5.0.0') { $state = "Up"; } ! $fp1 = @fsockopen($host, $port, &$errno, &$errstr, $connect_timeout); //open connection ! if (!$fp1) { //if this fails, I'm done.... ! $er = '<p>' . $lang['Socket_functions_disabled'] . '</p>'; ! @fclose($fp1); ! $success++; ! } ! else { ! $er = ''; ! $request="GET /index.html HTTP/1.1\r\nHost:" . $host . ":" . $port . "\r\nUser-Agent: SHOUTcast DNAS Status [index] * (Mozilla/PHP)\r\nConnection: close\r\n\r\n"; //get index.html ! @fputs($fp1,$request,strlen($request)); ! $page=''; ! while(!feof($fp1)) ! { ! $page .= fread($fp1, 16384); ! } ! @fclose($fp1); ! // now I have the entire /index.html in $page -- all I want from here is the current track... ! // (hint-hint) ! $song00 = ereg_replace("</b></td>.*", "", ereg_replace(".*Current Song: </font></td><td><font class=default><b>", "", $page)); // easy, right <img src="images/smilies/smile.gif" border="0" alt=""> ! // now let's get /played.html... (this is kinda long) ! $fp = @fsockopen($host, $port, &$errno, &$errstr, $connect_timeout); ! if(!$fp) ! { ! //if connection could not be made ! @fclose($fp); ! $success++; ! } ! else ! { ! $request="GET /played.html HTTP/1.1\r\nHost: " . $host . ":" . $port . "\r\nUser-Agent: SHOUTcast DNAS Status [played] * (Mozilla/PHP)\r\n"."Connection: close\r\n\r\n"; ! @fputs($fp,$request,strlen($request)); ! $page=''; ! while (!feof($fp)) ! { ! $page .= @fread($fp, 16384); ! } ! @fclose($fp); //close connection ! $played_html=$page; ! if ($played_html) ! { ! $played_html = ereg_replace('<x>','|-|',ereg_replace('</tr>','',ereg_replace('</td><td>','<x>',ereg_replace('<tr><td>','',ereg_replace('</tr>','</tr>' . $lf,ereg_replace('-->','--]',ereg_replace('<!--','[!--',ereg_replace('</table><br><br>.*','',ereg_replace('.*<b>Current Song</b></td></tr>','',$played_html))))))))); ! $xxn = strlen($played_html); ! $r = 2; ! $t_count = 0; ! $reading = 0; ! $track[0] = $song00; while ($r<$xxn & $t_count<=$t_max) ! { ! $cur = substr($played_html,$r,1); ! if ($cur == $lf) { $reading=0; } ! if ($reading == 1) { $track[$t_count] .= $cur; } ! if ($cur == "|" & substr($played_html,$r-1,1) == "-" & substr($played_html,$r-2,1) == "|") ! { ! $reading = 1; ! $t_count++; ! } ! $r++; ! } ! } ! } ! } ! ! ! // I now have $track[0-N] containg the current plus last N tracks... ! // Output time... if (!empty($er)) { ! // I couldn't connect to the DNAS ! $r = 0; $output_string = ''; ! $output_string .= '<table width="' . $tablew . '" height="' . $tableh . '" class="forumline" border="' . $thickness . '" bordercolor="' . $border . '"><tr bgcolor="' . $toprow . '"><td vAlign=top> ! <table width="100%" border="0" cellpadding="' . $padding . '"><tr><td> ! <font face=' . $font . ' size=' . $fontsize . '>' . $er; //Now playing... ! if ($success != 0) { ! $output_string .= '<td><tr>'; } ! if ($success == 0) { while ($r <= $t_max) ! { ! if ($r==0) { ! $output_string .= '<tr><td vAlign=top> ' . $lang['Before_that_you_heard'] . ' :</i><br><br>'; } else { ! $output_string .= str_replace("'", "'",str_replace('"', '"',$track[$r])) . '<br>'; } ! $r++; } } ! // I also want to close the table code now.... ! $output_string .= '</td></tr></font></td></tr></table></td></tr></table>'; ! ! echo $output_string . ''; } ! else if ($success == 0 && $state == "Up") ! { echo " <table width=\" . $block_size . \" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"forumline\">\n"; ! $r = 0; ! $output_string=''; ! //tweak the output string (the table init) here.... ! $output_string .= '<table width="' . $tablew . '" height="' . $tableh . '" class="forumline" border="' . $thickness . '" bordercolor="' . $border . '"><tr bgcolor="' . $toprow . '"><td vAlign=top> ! <table width="100%" border="0" cellpadding="' . $padding . '"><tr><td vAlign=top> ! <font face=' . $font . ' size=' . $fontsize . '>'; //Now playing... while ($r<=$t_max) ! { ! if ($r==0) { ! $output_string .= $lang['Now_Playing'] . ': <A><b>'.str_replace("'", "'",str_replace('"', '"',$track[$r])).'</b></A></td></tr></table></td></tr><tr><td><table bgcolor=' . $bottom . ' width="100%" border="0" cellpadding="' . $padding . '"><tr><td><br><font face=' . $font . ' size=' . $fontsize . '> ' . $lang['Before_that_you_heard'] . ' :<b><br><br>'; } ! else { ! $output_string .= str_replace("'", "'",str_replace('"', '"',$track[$r])) . '<br>'; } ! $r++; } ! // I also want to close the table code now.... ! $output_string .= '</b></font></td></tr></table></td></tr></table>'; ! ! echo $output_string . ''; ! } ! else ! { ! // I couldn't connect to the DNAS ! $r = 0; $output_string = ''; ! $output_string .= '<table width="' . $tablew . '" height="' . $tableh . '" class="forumline" border="' . $thickness . '" bordercolor="' . $border . '"><tr bgcolor="' . $toprow . '"><td vAlign=top> ! <table width="100%" border="0" cellpadding="' . $padding . '"><tr><td> ! <font face=' . $font . ' size=' . $fontsize . '>' . $lang['Off_Air']; //Now playing... ! if ($success != 0) { ! $output_string .= '<td><tr>'; } ! if ($success == 0) { while ($r <= $t_max) ! { ! if ($r==0) { ! $output_string .= '<tr><td vAlign=top> ' . $lang['Before_that_you_heard'] . ' :</i><br><br>'; } else { ! $output_string .= str_replace("'", "'",str_replace('"', '"',$track[$r])) . '<br>'; } ! $r++; } } ! // I also want to close the table code now.... ! $output_string .= '</td></tr></font></td></tr></table></td></tr></table>'; ! ! echo $output_string . ''; ! } ! ?> --- 89,258 ---- if (@phpversion() < '5.0.0') { $state = "Up"; } ! $fp1 = @fsockopen($host, $port, &$errno, &$errstr, $connect_timeout); //open connection ! if (!$fp1) { //if this fails, I'm done.... ! $er = '<p>' . $lang['Socket_functions_disabled'] . '</p>'; ! @fclose($fp1); ! $success++; ! } ! else { ! $er = ''; ! $request="GET /index.html HTTP/1.1\r\nHost:" . $host . ":" . $port . "\r\nUser-Agent: SHOUTcast DNAS Status [index] * (Mozilla/PHP)\r\nConnection: close\r\n\r\n"; //get index.html ! @fputs($fp1,$request,strlen($request)); ! $page=''; ! while(!feof($fp1)) ! { ! $page .= fread($fp1, 16384); ! } ! @fclose($fp1); ! // now I have the entire /index.html in $page -- all I want from here is the current track... ! // (hint-hint) ! $song00 = ereg_replace("</b></td>.*", "", ereg_replace(".*Current Song: </font></td><td><font class=default><b>", "", $page)); // easy, right <img src="images/smilies/smile.gif" border="0" alt=""> ! // now let's get /played.html... (this is kinda long) ! $fp = @fsockopen($host, $port, &$errno, &$errstr, $connect_timeout); ! if(!$fp) ! { ! //if connection could not be made ! @fclose($fp); ! $success++; ! } ! else ! { ! $request="GET /played.html HTTP/1.1\r\nHost: " . $host . ":" . $port . "\r\nUser-Agent: SHOUTcast DNAS Status [played] * (Mozilla/PHP)\r\n"."Connection: close\r\n\r\n"; ! @fputs($fp,$request,strlen($request)); ! $page=''; ! while (!feof($fp)) ! { ! $page .= @fread($fp, 16384); ! } ! @fclose($fp); //close connection ! $played_html=$page; ! if ($played_html) ! { ! $played_html = ereg_replace('<x>','|-|',ereg_replace('</tr>','',ereg_replace('</td><td>','<x>',ereg_replace('<tr><td>','',ereg_replace('</tr>','</tr>' . $lf,ereg_replace('-->','--]',ereg_replace('<!--','[!--',ereg_replace('</table><br><br>.*','',ereg_replace('.*<b>Current Song</b></td></tr>','',$played_html))))))))); ! $xxn = strlen($played_html); ! $r = 2; ! $t_count = 0; ! $reading = 0; ! $track[0] = $song00; while ($r<$xxn & $t_count<=$t_max) ! { ! $cur = substr($played_html,$r,1); ! if ($cur == $lf) { $reading=0; } ! if ($reading == 1) { $track[$t_count] .= $cur; } ! if ($cur == "|" & substr($played_html,$r-1,1) == "-" & substr($played_html,$r-2,1) == "|") ! { ! $reading = 1; ! $t_count++; ! } ! $r++; ! } ! } ! } ! } ! ! ! // I now have $track[0-N] containg the current plus last N tracks... ! // Output time... if (!empty($er)) { ! // I couldn't connect to the DNAS ! $r = 0; $output_string = ''; ! $output_string .= '<table width="' . $tablew . '" height="' . $tableh . '" class="forumline" border="' . $thickness . '" bordercolor="' . $border . '"><tr bgcolor="' . $toprow . '"><td vAlign=top> ! <table width="100%" border="0" cellpadding="' . $padding . '"><tr><td> ! <font face=' . $font . ' size=' . $fontsize . '>' . $er; //Now playing... ! if ($success != 0) { ! $output_string .= '<td><tr>'; } ! if ($success == 0) { while ($r <= $t_max) ! { ! if ($r==0) { ! $output_string .= '<tr><td vAlign=top> ' . $lang['Before_that_you_heard'] . ' :</i><br><br>'; } else { ! $output_string .= str_replace("'", "'",str_replace('"', '"',$track[$r])) . '<br>'; } ! $r++; } } ! // I also want to close the table code now.... ! $output_string .= '</td></tr></font></td></tr></table></td></tr></table>'; ! ! echo $output_string . ''; } ! else if ($success == 0 && $state == "Up") ! { echo " <table width=\" . $block_size . \" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"forumline\">\n"; ! $r = 0; ! $output_string=''; ! //tweak the output string (the table init) here.... ! $output_string .= '<table width="' . $tablew . '" height="' . $tableh . '" class="forumline" border="' . $thickness . '" bordercolor="' . $border . '"><tr bgcolor="' . $toprow . '"><td vAlign=top> ! <table width="100%" border="0" cellpadding="' . $padding . '"><tr><td vAlign=top> ! <font face=' . $font . ' size=' . $fontsize . '>'; //Now playing... while ($r<=$t_max) ! { ! if ($r==0) { ! $output_string .= $lang['Now_Playing'] . ': <A><b>'.str_replace("'", "'",str_replace('"', '"',$track[$r])).'</b></A></td></tr></table></td></tr><tr><td><table bgcolor=' . $bottom . ' width="100%" border="0" cellpadding="' . $padding . '"><tr><td><br><font face=' . $font . ' size=' . $fontsize . '> ' . $lang['Before_that_you_heard'] . ' :<b><br><br>'; } ! else { ! $output_string .= str_replace("'", "'",str_replace('"', '"',$track[$r])) . '<br>'; } ! $r++; } ! // I also want to close the table code now.... ! $output_string .= '</b></font></td></tr></table></td></tr></table>'; ! echo $output_string . ''; ! ! } ! else ! { ! // I couldn't connect to the DNAS ! $r = 0; $output_string = ''; ! $output_string .= '<table width="' . $tablew . '" height="' . $tableh . '" class="forumline" border="' . $thickness . '" bordercolor="' . $border . '"><tr bgcolor="' . $toprow . '"><td vAlign=top> ! <table width="100%" border="0" cellpadding="' . $padding . '"><tr><td> ! <font face=' . $font . ' size=' . $fontsize . '>' . $lang['Off_Air']; //Now playing... ! if ($success != 0) { ! $output_string .= '<td><tr>'; } ! if ($success == 0) { while ($r <= $t_max) ! { ! if ($r==0) { ! $output_string .= '<tr><td vAlign=top> ' . $lang['Before_that_you_heard'] . ' :</i><br><br>'; } else { ! $output_string .= str_replace("'", "'",str_replace('"', '"',$track[$r])) . '<br>'; } ! $r++; } } ! // I also want to close the table code now.... ! $output_string .= '</td></tr></font></td></tr></table></td></tr></table>'; ! ! echo $output_string . ''; ! } ! ?> \ No newline at end of file |