|
From: OryNider <ory...@us...> - 2007-10-02 05:01:45
|
Update of /cvsroot/mxbb/mx_shotcast In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12867 Modified Files: Tag: core28x cur_song.php db_install.php db_uninstall.php db_upgrade.php getinfo.php moreinfo.php play_real.php play_wmp.php radio_update.php radioplayer.php shotcast.pak shotcast_config.php shotcast_front.php shotcast_stats.php Log Message: upgrading... Index: shotcast_stats.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast_stats.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** shotcast_stats.php 6 Jun 2007 23:18:16 -0000 1.1 --- shotcast_stats.php 2 Oct 2007 05:00:31 -0000 1.1.2.1 *************** *** 9,17 **** */ // -------------------------------------------------------------------------------- // Security check // ! if( !defined('IN_PORTAL') ) { die("Hacking attempt"); --- 9,23 ---- */ + // + // ERROR HANDLING + // + //error_reporting( E_ALL ); + @ini_set( 'display_errors', '1' ); + // -------------------------------------------------------------------------------- // Security check // ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { die("Hacking attempt"); *************** *** 23,47 **** if( !file_exists($module_root_path . 'includes/common.'.$phpEx) ) { ! message_die(GENERAL_ERROR, "Could not find mx_shotcast includes folder.", "", __LINE__, __FILE__); } ! define('_SHOTCAST_CONFIG', true); include_once($module_root_path . 'includes/common.'.$phpEx); ! include_once($module_root_path . 'getinfo2.'.$phpEx); - if ($text[1]==1) - { - $state = "Up"; - $shotcast_state_icon = 'online.gif'; - } - else - { - $state = "Down"; - $shotcast_state_icon = 'offline.gif'; - } ! if ($text[2]=="") { $text[2] = $currentlisteners; } ! if ($text[3]=="") { $text[3] = $maxlisteners; } ! if ($text[5]=="") { $text[5] = $bitrate; } ! if ($song[0]=="") { $song[0] = $text[6]; } // --- 29,45 ---- if( !file_exists($module_root_path . 'includes/common.'.$phpEx) ) { ! mx_message_die(GENERAL_ERROR, "Could not find mx_shotcast includes folder.", "", __LINE__, __FILE__); } ! @define('_SHOTCAST_CONFIG', true); include_once($module_root_path . 'includes/common.'.$phpEx); ! include_once($module_root_path . 'getinfo.'.$phpEx); ! $state = ($text[1] == 1) ? 'Up' : 'Down'; ! $shotcast_state_icon = ($text[1] == 1) ? 'online.gif' : 'offline.gif'; ! $text[2] = !empty($text[2]) ? $text[2] : $currentlisteners; ! $text[3] = !empty($text[3]) ? $text[3] : $maxlisteners; ! $text[5] = !empty($text[5]) ? $text[5] : $bitrate; ! $song[0] = !empty($song[0]) ? $song[0] : $text[6]; // *************** *** 60,64 **** $template->assign_vars(array( ! 'SHOTCAST_STATE_IMG' => $module_root_path.'templates/images/'.$shotcast_state_icon, 'L_STATION' => $lang['Stats_for'], --- 58,62 ---- $template->assign_vars(array( ! 'SHOTCAST_STATE_IMG' => $module_root_path.'images/'.$shotcast_state_icon, 'L_STATION' => $lang['Stats_for'], *************** *** 76,81 **** 'L_MAX_LISTENERS' => $lang['Max_listeners'], 'S_MAX_LISTENERS' => $text[3], ! 'L_SERVERGENRE' => $lang['Server_genre'], ! 'S_SERVERGENRE' => $servergenre, 'L_SONGURL' => $lang['Stream_URL'], 'S_SONGURL' => $songurl, --- 74,79 ---- 'L_MAX_LISTENERS' => $lang['Max_listeners'], 'S_MAX_LISTENERS' => $text[3], ! 'L_SERVERGENRE' => $lang['Server_genre'], ! 'S_SERVERGENRE' => $servergenre, 'L_SONGURL' => $lang['Stream_URL'], 'S_SONGURL' => $songurl, Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/db_upgrade.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** db_upgrade.php 6 Jun 2007 23:17:58 -0000 1.1 --- db_upgrade.php 2 Oct 2007 05:00:20 -0000 1.1.2.1 *************** *** 31,35 **** } ! $mx_module_version = '1.0.0 RC 3'; $mx_module_copy = 'mxBB <i> - Shotcast</i> module by OryNider & <a href="http://www.mxbb.net" target="_blank">Mx Team</a>'; --- 31,35 ---- } ! $mx_module_version = '1.0'; $mx_module_copy = 'mxBB <i> - Shotcast</i> module by OryNider & <a href="http://www.mxbb.net" target="_blank">Mx Team</a>'; *************** *** 38,47 **** $sql = array(); ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " ! SET module_version = '" . $mx_module_version . "', ! module_copy = '" . $mx_module_copy . "' ! WHERE module_id = '" . $mx_module_id . "'"; ! $message .= mx_do_install_upgrade( $sql ); echo "<br /><br />"; --- 38,87 ---- $sql = array(); ! // ! // Precheck ! // ! if ( $result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "shotcast_config" ) ) ! { ! // ! // Upgrade checks ! // ! $upgrade_100 = 0; ! // ! // validate before 1.0 Gold ! // ! $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "shotcast_config WHERE config_name = 'force_online'" ); ! if ( $db->sql_numrows( $result ) == 0 ) ! { ! $upgrade_100 = 1; ! } ! ! $message = "<b>Upgrading!</b><br/><br/>"; ! ! if ( $upgrade_100 == 1 ) ! { ! $message .= "<b>Upgrading to v. 1.0 (Gold)...</b><br/><br/>"; ! ! $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config VALUES ('force_online', '1')"; ! } ! else ! { ! $message .= "<b>Nothing to upgrade...</b><br/><br/>"; ! } ! ! $sql[] = "UPDATE " . $mx_table_prefix . "module" . " ! SET module_version = '" . $mx_module_version . "', ! module_copy = '" . $mx_module_copy . "' ! WHERE module_id = '" . $mx_module_id . "'"; ! ! $message .= mx_do_install_upgrade( $sql ); ! } ! else ! { ! // ! // If not installed ! // ! $message = "<b>Module is not installed...and thus cannot be upgraded ;)</b><br/><br/>"; ! } echo "<br /><br />"; Index: shotcast_front.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast_front.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** shotcast_front.php 6 Jun 2007 23:18:15 -0000 1.1 --- shotcast_front.php 2 Oct 2007 05:00:30 -0000 1.1.2.1 *************** *** 16,19 **** --- 16,24 ---- * -modified by OryNider to shotcast_front ***************************************************************************/ + // + // ERROR HANDLING + // + //error_reporting( E_ALL ); + @ini_set( 'display_errors', '1' ); // -------------------------------------------------------------------------------- *************** *** 21,25 **** // ! if( !defined('IN_PORTAL') ) { die("Hacking attempt"); --- 26,30 ---- // ! if( !defined('IN_PORTAL') || !is_object($mx_block)) { die("Hacking attempt"); *************** *** 35,50 **** if( !file_exists($module_root_path . 'includes/common.'.$phpEx) ) { ! message_die(GENERAL_ERROR, "Could not find mx_shotcast includes folder.", "", __LINE__, __FILE__); } ! define('_SHOTCAST_CONFIG', true); include_once($module_root_path . 'includes/common.'.$phpEx); ! if ( empty($shotcast_config['shotcast_host']) ) { ! include_once($module_root_path . 'getinfo1.'.$phpEx); } else { ! include_once($module_root_path . 'getinfo2.'.$phpEx); } --- 40,56 ---- if( !file_exists($module_root_path . 'includes/common.'.$phpEx) ) { ! mx_message_die(GENERAL_ERROR, "Could not find mx_shotcast includes folder.", "", __LINE__, __FILE__); } ! @define('_SHOTCAST_CONFIG', true); include_once($module_root_path . 'includes/common.'.$phpEx); ! if ( !empty($shotcast_config['shotcast_host']) ) { ! include_once($module_root_path . 'getinfo.'.$phpEx); } else { ! $shotcast_config['shotcast_host'] = '127.0.0.1'; ! include_once($module_root_path . 'getinfo.'.$phpEx); } *************** *** 69,98 **** if (!$sol = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, "Could not query shotcast Session information", "", __LINE__, __FILE__, $sql); } if( empty($currentlisteners) && empty($text[2]) ) { ! $text[2] = $shotcast_config['currentlisteners']; } ! elseif (empty($currentlisteners) && !empty($text[2])) { ! $currentlisteners = $text[2]; } ! ! ! // if( $currentlisteners != "" ) ! if( !empty($currentlisteners)) { ! $howmanylisten = $db->sql_numrows($sol); ! $howmanypeak = $currentlisteners; } else { ! $howmanylisten = $db->sql_numrows($sol); // Return this ! $howmanypeak="0"; } ! $isimler[0] = $db->sql_numrows($sol); $i = 1; --- 75,99 ---- if (!$sol = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, "Could not query shotcast Session information", "", __LINE__, __FILE__, $sql); } 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]; } ! $isimler[0] = $howmanylisten = $db->sql_numrows($sol); // Return this $i = 1; *************** *** 159,165 **** $template->assign_vars(array( ! 'SHOTCAST_IMG' => $module_root_path.'templates/images/'.$shotcast_icon, ! 'WMP_IMG' => $module_root_path.'templates/images/'.$wmp_icon, ! 'REAL_IMG' => $module_root_path.'templates/images/'.$real_icon, 'TOTAL_LISTENERS_ONLINE' => sprintf($lang['How_Many_Listeners'], $howmanylisten), --- 160,166 ---- $template->assign_vars(array( ! 'SHOTCAST_IMG' => $module_root_path.'images/'.$shotcast_icon, ! 'WMP_IMG' => $module_root_path.'images/'.$wmp_icon, ! 'REAL_IMG' => $module_root_path.'images/'.$real_icon, 'TOTAL_LISTENERS_ONLINE' => sprintf($lang['How_Many_Listeners'], $howmanylisten), Index: shotcast_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast_config.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** shotcast_config.php 6 Jun 2007 23:18:14 -0000 1.1 --- shotcast_config.php 2 Oct 2007 05:00:28 -0000 1.1.2.1 *************** *** 9,27 **** */ ! define('IN_PORTAL', 1); ! ! $mx_root_path = "../../"; ! $mx_module_path = "./"; ! ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! include_once($mx_root_path . 'common.'.$phpEx); ! // ! // Start session management ! // ! // $mx_user->init($user_ip, PAGE_INDEX); ! define('_SHOTCAST_CONFIG', true); ! include_once($mx_module_path .'includes/common.'.$phpEx); // --- 9,26 ---- */ ! if( !defined('IN_PORTAL')) ! { ! die("Hacking attempt"); ! } ! if( !is_object($mx_block)) ! { ! $mx_root_path = "../../"; ! include_once($mx_root_path . 'common.'.$phpEx); ! $mx_user->init($user_ip, PAGE_INDEX); ! } ! @define('_SHOTCAST_CONFIG', true); ! include_once($module_root_path .'includes/common.'.$phpEx); // *************** *** 32,40 **** $nick = str_replace(" ", "_", $userdata['username']); - //read check period ! $period=$shotcast_config['check_period']*1000; $station = $shotcast_config['shotcast_name']; // Station name ! $scip = $shotcast_config['shotcast_host']; // IP adress or domain $scport = $shotcast_config['shotcast_port']; // Port $scpass = $shotcast_config['shotcast_pass']; // SHOUTcast Password --- 31,38 ---- $nick = str_replace(" ", "_", $userdata['username']); //read check period ! $period = $shotcast_config['check_period'] * 1000; $station = $shotcast_config['shotcast_name']; // Station name ! $scip = $shotcast_config['shotcast_host']; // IP adress or domain $scport = $shotcast_config['shotcast_port']; // Port $scpass = $shotcast_config['shotcast_pass']; // SHOUTcast Password Index: cur_song.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/cur_song.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** cur_song.php 6 Jun 2007 23:17:56 -0000 1.1 --- cur_song.php 2 Oct 2007 05:00:17 -0000 1.1.2.1 *************** *** 1,2 **** ! <?php include "getinfo.php";?> ! <b><?=$song[0];?></b> \ No newline at end of file --- 1,60 ---- ! <?php ! ! define( 'IN_PORTAL', 1 ); ! ! $module_root_path = './'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! ! include($module_root_path . 'shotcast_config.'.$phpEx); ! include($module_root_path . 'getinfo.'.$phpEx); ! ! $song[0] = !empty($song[0]) ? $song[0] : $text[6]; ! ! ?> ! <HTML> ! <HEAD> ! <META http-equiv="pragma" content="no-cache"> ! <META HTTP-EQUIV="refresh" CONTENT="60"> ! <META name="robots" content="noindex"> ! <script> ! <!-- ! ! /* ! Auto Refresh Page with Time script ! By JavaScript Kit (javascriptkit.com) ! Over 200+ free scripts here! ! */ ! ! //enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59 ! var limit="0:60" ! ! if (document.images){ ! var parselimit=limit.split(":") ! parselimit=parselimit[0]*60+parselimit[1]*1 ! } ! function beginrefresh(){ ! if (!document.images) ! return ! if (parselimit==1) ! window.location.reload() ! else{ ! parselimit-=1 ! curmin=Math.floor(parselimit/60) ! cursec=parselimit%60 ! if (curmin!=0) ! curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!" ! else ! curtime=cursec+" seconds left until page refresh!" ! window.status=curtime ! setTimeout("beginrefresh()",1000) ! } ! } ! ! window.onload=beginrefresh ! //--> ! </script> ! </HEAD> ! <body> ! <span style="font-weight : bold;"><?=$song[0];?></span> ! </body> ! </HTML> \ No newline at end of file Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/db_install.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** db_install.php 6 Jun 2007 23:17:57 -0000 1.1 --- db_install.php 2 Oct 2007 05:00:18 -0000 1.1.2.1 *************** *** 35,39 **** } ! $mx_module_version = '1.0.0 RC 3'; $mx_module_copy = 'mxBB <i> - Shotcast</i> module by OryNider & <a href="http://www.mxbb.net" target="_blank">Mx Team</a>'; --- 35,39 ---- } ! $mx_module_version = '1.0'; $mx_module_copy = 'mxBB <i> - Shotcast</i> module by OryNider & <a href="http://www.mxbb.net" target="_blank">Mx Team</a>'; *************** *** 63,69 **** ) TYPE=MyISAM"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_name', 'Radio Cezareea Romania')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_host', 'tv3.stream-music.net')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_port', '8188')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_pass', 'thejoyfm')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('play_list', 'listen.pls')"; --- 63,69 ---- ) TYPE=MyISAM"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_name', 'The Joy Fm')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_host', '209.85.88.199')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_port', '10040')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('shotcast_pass', 'thejoyfm')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('play_list', 'listen.pls')"; *************** *** 71,74 **** --- 71,75 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('check_period', '960')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('show_listen_select', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('force_online', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config ( config_name , config_value ) VALUES ('show_status', 'true')"; Index: radio_update.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/radio_update.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** radio_update.php 6 Jun 2007 23:18:10 -0000 1.1 --- radio_update.php 2 Oct 2007 05:00:26 -0000 1.1.2.1 *************** *** 19,44 **** // ini_set( 'display_errors', '1' ); ! define('IN_PORTAL', true); ! $mx_root_path = '../../'; $module_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); - include_once($mx_root_path . 'common.'.$phpEx); - - $mx_user->init($user_ip, PAGE_INDEX); ! define('_SHOTCAST_CONFIG', true); ! include_once($module_root_path . 'includes/common.'.$phpEx); ! include_once($module_root_path . 'getinfo2.'.$phpEx); - $time=date("U"); - $nick = str_replace(" ", "_", $userdata['username']); ! if ($_POST['update']==true) { ! update_shotcast_users($nick,$time); } else { ! update_shotcast_users($nick,$time); } --- 19,38 ---- // ini_set( 'display_errors', '1' ); ! define( 'IN_PORTAL', 1 ); ! $module_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); ! include($module_root_path . 'shotcast_config.'.$phpEx); ! include($module_root_path . 'getinfo.'.$phpEx); ! if (isset($_POST['update'])) { ! update_shotcast_users($nick,$time); } else { ! update_shotcast_users($nick,$time); } *************** *** 58,68 **** } ! if( $currentlisteners != "" ) { ! update_total_users($currentlisteners); } //read check period ! $period=$shotcast_config['check_period']*1000; //radio_update.php (send to the db the user statue "listening" every $period seconds) --- 52,62 ---- } ! if( !empty($currentlisteners)) { ! update_total_users($currentlisteners); } //read check period ! $period = $shotcast_config['check_period'] * 1000; //radio_update.php (send to the db the user statue "listening" every $period seconds) *************** *** 104,108 **** echo "</script>\n"; echo "</head>"; ! echo "<body background=\"templates/gateway_files/iframe_bg.png\">"; echo "<form name=\"update\" action=\"radio_update.php\" method=\"POST\">"; echo "<input type=\"hidden\" name=\"update\" value=\"true\">"; --- 98,102 ---- echo "</script>\n"; echo "</head>"; ! echo "<body background=\"images/iframe_bg.png\">"; echo "<form name=\"update\" action=\"radio_update.php\" method=\"POST\">"; echo "<input type=\"hidden\" name=\"update\" value=\"true\">"; Index: radioplayer.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/radioplayer.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** radioplayer.php 6 Jun 2007 23:18:12 -0000 1.1 --- radioplayer.php 2 Oct 2007 05:00:27 -0000 1.1.2.1 *************** *** 9,17 **** */ ! include "getinfo.php"; ! if ($currentlisteners=="") { $currentlisteners = $text[2]; } ! if ($bitrate=="") { $bitrate = $text[5]; } ! if ($song[0]=="") { $song[0] = $text[6]; } user_listensc($nick); ?> --- 9,24 ---- */ ! define( 'IN_PORTAL', 1 ); ! $module_root_path = './'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! ! include($module_root_path . 'shotcast_config.'.$phpEx); ! include($module_root_path . 'getinfo.'.$phpEx); ! ! $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); ?> *************** *** 27,31 **** <style type="text/css"> <!-- ! body {margin:0; padding: 0; BACKGROUND-IMAGE: url(templates/gateway_files/iframe_bg.png); font-family: Verdana; font-size: 10px;} a{text-decoration:none; background-color:inherit; color:#26c;} a:hover{text-decoration:underline;} --- 34,38 ---- <style type="text/css"> <!-- ! body {margin:0; padding: 0; BACKGROUND-IMAGE: url(images/iframe_bg.png); font-family: Verdana; font-size: 10px;} a{text-decoration:none; background-color:inherit; color:#26c;} a:hover{text-decoration:underline;} Index: getinfo.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/getinfo.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** getinfo.php 6 Jun 2007 23:17:59 -0000 1.1 --- getinfo.php 2 Oct 2007 05:00:22 -0000 1.1.2.1 *************** *** 9,93 **** */ ! include "shotcast_config.php"; - $mx_user->init($user_ip, PAGE_INDEX); $nick = str_replace(" ", "_", $userdata['username']); ! $time=date("U"); ! if ($_POST['update']==true) { ! update_shotcast_user($nick,$time); } ! ini_set("display_errors", "0"); ! if (@phpversion() >= '5.0.0') { ! $open = fsockopen($scip,$scport); ! if ($open) { ! fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n"); ! $read = fread($open,1000); ! $text = explode("content-type:text/html",$read); ! $text = explode(",",$text[1]); ! fclose($open); ! } else { $er="Connection Refused!"; } } ! //$scfp = fsockopen($scip, $scport, &$errno, &$errstr, 1); ! $scfp = fsockopen($scip, $scport); ! if(!$scfp) { ! $scsuccs=1; ! } ! 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); ! } ! $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE", "SERVERGENRE", "SONGURL", "SERVERURL", "REPORTEDLISTENERS"); ! $y=0; ! while($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) ! $$scphp = urldecode($$scphp); ! $y++; ! } ! $pageed = ereg_replace(".*<SONGHISTORY>", "", $page); ! $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed); ! $songatime = explode("<SONG>", $pageed); ! $r=1; ! while($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++; ! } ! fclose($scfp); } ! if(isset($_GET['status'])){ ! $status = $_GET['status']; ! } else{ ! $status = "stop"; } ! if(isset($_GET['z'])){ ! $z = $_GET['z']; ! } else{ ! $z = "wmp"; } ! if ($z == 'wmp'){ ! $mode = 'real'; ! } elseif ($z == 'real'){ ! $mode = 'wmp'; } ?> \ No newline at end of file --- 9,166 ---- */ ! if( !defined('IN_PORTAL')) ! { ! die("Hacking attempt"); ! } $nick = str_replace(" ", "_", $userdata['username']); ! $period = !empty($period) ? $period : $shotcast_config['check_period'] * 1000; ! $station = !empty($station) ? $station : $shotcast_config['shotcast_name']; // Station name ! $scip = !empty($scip) ? $scip : $shotcast_config['shotcast_host']; // IP adress or domain ! $scport = !empty($scport) ? $scport : $shotcast_config['shotcast_port']; // Port ! $scpass = !empty($scpass) ? $scpass : $shotcast_config['shotcast_pass']; // SHOUTcast Password ! $time = date("U"); ! $errno = 0; ! $errstr = ''; ! $connect_timeout = 5; ! ! if ( isset($_POST['update']) ) { ! update_shotcast_user($nick, $time); } ! if (@phpversion() >= '5.0.0') ! { ! //$open = fsockopen($scip, $scport, &$errno, &$errstr, $connect_timeout); //open connection ! $open = @fsockopen($scip, $scport); //open connection ! if(!$open) ! { ! //if connection could not be made ! @fclose($open); ! $text = array(); ! if ($shotcast_config['force_online'] == 1) ! { ! $text[1] = '1,1,4,32,1,128,Unknon Artist'; ! $text = explode(",",$text[1]); ! } ! $er = '<p>' . $lang['Socket_functions_disabled'] . '</p>'; ! } ! else ! { ! //$request = "GET /7.html HTTP/1.1\r\nHost:" . $scip . ":" . $scport . "\r\nUser-Agent: SHOUTcast DNAS Status [7] * XML Getter (Mozilla Compatible)\r\nConnection: close\r\n\r\n"; //get 7.html ! @fputs($open,"GET /7 HTTP/1.1\r\nUser-Agent:Mozilla\r\n\r\n"); ! $read = @fread($open, 1000); ! $text = explode("content-type:text/html", $read); ! $text = explode(",",$text[1]); ! @fclose($open); ! } ! } ! else ! { ! $text = array(); ! $er = '<p> Old php version! </p>'; } ! /* ! $scfp = fsockopen($scip, $scport, &$errno, &$errstr, $connect_timeout); ! if (!$scfp) ! { ! $scsuccs = 1; ! } ! */ + $scfp = @fsockopen($scip, $scport); + $scsuccs = ($scfp) ? '' : 1; ! if ($scfp) ! { ! @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); ! } ! $loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE", "SERVERGENRE", "SONGURL", "SERVERURL", "REPORTEDLISTENERS"); ! $y=0; ! while($loop[$y] != '') ! { ! $pageed = ereg_replace(".*<$loop[$y]>", "", $page); ! $scphp = strtolower($loop[$y]); ! $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed); ! if($loop[$y] == STREAMSTATUS || $loop[$y] == BITRATE || $loop[$y] == SERVERTITLE || $loop[$y] == SERVERGENRE || $loop[$y] == CURRENTLISTENERS || $loop[$y] == MAXLISTENERS || $loop[$y] == SONGURL || $loop[$y] == SERVERURL || $loop[$y] == SONGTITLE || $loop[$y] == REPORTEDLISTENERS) ! { ! $$scphp = urldecode($$scphp); ! } ! $y++; ! } ! $pageed = ereg_replace(".*<SONGHISTORY>", "", $page); ! $pageed = ereg_replace("</SONGHISTORY>.*", "", $pageed); ! $songatime = explode("<SONG>", $pageed); ! //$streamstatus = ereg_replace(".*<STREAMSTATUS>", "", $page); ! //$streamstatus = ereg_replace("</STREAMSTATUS>.*", "", $pageed); ! $r = 1; ! while($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++; ! } ! @fclose($scfp); ! ! $text[1] = ($text[1] == 1) ? $text[1] : $streamstatus; ! //$text[2] = !empty($text[2]) ? $text[2] : $currentlisteners; ! $text[3] = !empty($text[3]) ? $text[3] : $maxlisteners; ! $text[5] = !empty($text[5]) ? $text[5] : $bitrate; ! $text[6] = !empty($text[6]) ? $text[6] : $song[0]; ! } ! else ! { ! $shoutcastserver = $station = $servertitle = $shotcast_config['shotcast_name']; ! $currentlisteners = "0"; ! $bitrate = "56"; ! $song[0] = "Unknon Artist"; ! $maxlisteners = "32"; ! $servergenre = ""; ! $songurl = ""; ! $serverurl = ""; ! $reportedlisteners = ""; ! $er = '<p>' . $lang['Socket_functions_disabled'] . '</p>'; } ! if (isset($_GET['status'])) ! { ! $status = $_GET['status']; ! } ! else ! { ! $status = "stop"; } ! ! if (isset($_GET['z'])) ! { ! $z = $_GET['z']; ! } ! else ! { ! $z = "wmp"; } ! if ($z == 'wmp') ! { ! $mode = 'real'; ! } ! elseif ($z == 'real') ! { ! $mode = 'wmp'; } + ?> \ No newline at end of file Index: moreinfo.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/moreinfo.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** moreinfo.php 6 Jun 2007 23:18:01 -0000 1.1 --- moreinfo.php 2 Oct 2007 05:00:23 -0000 1.1.2.1 *************** *** 9,17 **** */ ! include "getinfo.php"; ! if ($text[1]==1) { $state = "Up"; } else { $state = "Down"; } ! if ($text[2]=="") { $text[2] = $currentlisteners; } ! if ($text[5]=="") { $text[5] = $bitrate; } ! if ($song[0]=="") { $song[0] = $text[6]; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" --- 9,24 ---- */ ! @define('IN_PORTAL', 1); ! ! $module_root_path = './'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! ! include($module_root_path . 'shotcast_config.'.$phpEx); ! include($module_root_path . 'getinfo.'.$phpEx); ! ! $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]; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" Index: play_real.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/play_real.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** play_real.php 6 Jun 2007 23:18:03 -0000 1.1 --- play_real.php 2 Oct 2007 05:00:24 -0000 1.1.2.1 *************** *** 1,3 **** ! <?php include "getinfo.php";?> <html> <head> --- 1,17 ---- ! <?php ! ! define( 'IN_PORTAL', 1 ); ! ! $module_root_path = './'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! ! include($module_root_path . 'shotcast_config.'.$phpEx); ! ! if (empty($song[0])) ! { ! $song[0] = $text[6]; ! } ! ! ?> <html> <head> Index: play_wmp.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/play_wmp.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** play_wmp.php 6 Jun 2007 23:18:05 -0000 1.1 --- play_wmp.php 2 Oct 2007 05:00:24 -0000 1.1.2.1 *************** *** 1,3 **** ! <?php include "getinfo.php";?> <html><head> <STYLE type=text/css>BODY { --- 1,17 ---- ! <?php ! ! define( 'IN_PORTAL', 1 ); ! ! $module_root_path = './'; ! $phpEx = substr(strrchr(__FILE__, '.'), 1); ! ! include($module_root_path . 'shotcast_config.'.$phpEx); ! ! if (empty($song[0])) ! { ! $song[0] = $text[6]; ! } ! ! ?> <html><head> <STYLE type=text/css>BODY { Index: shotcast.pak =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast.pak,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** shotcast.pak 6 Jun 2007 23:18:13 -0000 1.1 --- shotcast.pak 2 Oct 2007 05:00:28 -0000 1.1.2.1 *************** *** 1,18 **** ! module=+:1000=+:shotcast=+:modules/mx_shotcast/=+:mx_shotcast=+:1 ! New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:1000=+:1010=+:shotcast Front=+:=+:shotcast_front.php=+: ! parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:1020=+:shotcast Front=+:=+:1010=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:45=+:45=+:Shotcast Save Front=+:=+:shotcast_save_front.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:37=+:Shotcast Save Front=+:Demo block=+:45=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:46=+:99=+:Last 10=+:Shotcast Last 10 block =+:last10.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Demo - Last 10=+:Demo block=+:99=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:71=+:191=+:Shotcast Stats=+:Shotcast Statinstics block =+:shotcast_stats.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Demo - Shotcast Stats=+:Demo block=+:99=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- 1,14 ---- ! module=+:71=+:ShotCast=+:modules/mx_shotcast/=+:mxBB ShotCast=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:71=+:85=+:ShotCast Front=+:=+:shotcast_front.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:ShotCast Front=+:Demo block=+:85=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:71=+:87=+:ShotCast Last 10=+:ShotCast Last 10 Block =+:shotcast_last10.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:ShotCast Last 10=+:Demo block=+:87=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:71=+:88=+:Shotcast Stats=+:ShotCast Statinstics Block =+:shotcast_stats.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:ShotCast Stats=+:Demo block=+:88=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 |