|
From: OryNider <ory...@us...> - 2008-02-28 06:27:50
|
Update of /cvsroot/mxbb/mx_shotcast In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21483/mx_shotcast Modified Files: db_install.php db_uninstall.php db_upgrade.php getinfo.php moreinfo.php mx_install_readme.htm radio_update.php radioplayer.php shotcast.pak shotcast_front.php shotcast_last10.php shotcast_stats.php Removed Files: stop_real.php stop_wmp.php Log Message: cvs commit test --- stop_real.php DELETED --- Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/db_upgrade.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_upgrade.php 24 Feb 2008 01:26:47 -0000 1.5 --- db_upgrade.php 28 Feb 2008 06:26:38 -0000 1.6 *************** *** 41,45 **** // Precheck // ! if ( $result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "shotcast_config" ) ) { // --- 41,45 ---- // Precheck // ! if ($result = $db->sql_query( "SELECT config_name from " . $mx_table_prefix . "shotcast_config" )) { // *************** *** 47,60 **** // $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/>"; --- 47,68 ---- // $upgrade_100 = 0; + $upgrade_108 = 0; // // validate before 1.0 Gold // ! if (!$result = $db->sql_query("SELECT config_value from " . $mx_table_prefix . "shotcast_config WHERE config_name = 'force_online'")) { $upgrade_100 = 1; } + // + // validate before 1.08 + // + if (!$result = $db->sql_query("SELECT bot_id from " . $mx_table_prefix . "shotcast_session")) + { + $upgrade_108 = 1; + } + $message = "<b>Upgrading!</b><br/><br/>"; *************** *** 66,69 **** --- 74,95 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "shotcast_config VALUES ('stream_type', 'mp3')"; } + + if ($upgrade_108 == 1) + { + $message .= "<b>Upgrading to v. 1.08...</b><br/><br/>"; + + $sql[] = "DROP TABLE IF EXISTS " . $mx_table_prefix . "shotcast_session"; + + $sql[] = "CREATE TABLE ".$mx_table_prefix."shotcast_session ( + id int(11) unsigned NOT NULL auto_increment, + user_id mediumint(8) DEFAULT '0' NOT NULL, + username varchar(99) NOT NULL, + time int(11) DEFAULT '0' NOT NULL, + session_ip char(8) DEFAULT '0' NOT NULL, + bot_id mediumint(8) DEFAULT '0' NOT NULL, + PRIMARY KEY (id), + KEY user_id (user_id) + ) TYPE=MyISAM"; + } else { Index: shotcast_front.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast_front.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shotcast_front.php 24 Feb 2008 01:26:47 -0000 1.6 --- shotcast_front.php 28 Feb 2008 06:26:39 -0000 1.7 *************** *** 34,37 **** --- 34,38 ---- // Initialization // + define('IN_SHOTCAST', true); // *************** *** 42,56 **** mx_message_die(GENERAL_ERROR, "Could not find mx_shotcast includes folder.", "", __LINE__, __FILE__); } - define('IN_SHOTCAST', 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); } --- 43,53 ---- mx_message_die(GENERAL_ERROR, "Could not find mx_shotcast includes folder.", "", __LINE__, __FILE__); } ! require($module_root_path .'includes/common.'.$phpEx); ! require($module_root_path . 'getinfo.'.$phpEx); ! ! if (empty($shotcast_config['shotcast_host'])) { $shotcast_config['shotcast_host'] = '127.0.0.1'; } *************** *** 68,79 **** // - // REMOVE OLD SESSIONS - drop_shotcast_users($shotcast_config['check_period']); - // Get all remain sessions ! $sql = "SELECT * FROM ".SHOTCAST_SESSION_TABLE; if (!$sol = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, "Could not query shotcast Session information", "", __LINE__, __FILE__, $sql); } --- 65,73 ---- // // Get all remain sessions ! $sql = "SELECT * FROM " . SHOTCAST_SESSION_TABLE; if (!$sol = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, "Could not query radio Session information", "", __LINE__, __FILE__, $sql); } *************** *** 95,99 **** } ! $isimler[0] = $howmanylisten = $db->sql_numrows($sol); // Return this $i = 1; --- 89,101 ---- } ! $howmanylisten = $db->sql_numrows($sol); // Return this ! ! //Get registreg users sessions ! $sql = "SELECT * FROM " . SHOTCAST_SESSION_TABLE . " WHERE user_id <> '" . ANONYMOUS . "'"; ! if (!$sol = $db->sql_query($sql)) ! { ! mx_message_die(GENERAL_ERROR, "Could not query radio Session information", "", __LINE__, __FILE__, $sql); ! } ! $isimler[0] = $db->sql_numrows($sol); $i = 1; *************** *** 103,125 **** if ( ( $shotcast_config['show_listen_select'] ) ) { ! $can_listen="yes"; } ! elseif ($record['username']==$userdata['username']) { ! $can_listen="no"; } else { ! $can_listen="yes"; } } $listeners = ( empty($isimler[1]) ? '' : ! '<a href="' . append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u='.$isimler[1]) . '" >'.$isimler[1].'</a><br />' ); for($s = 2; $s <= $isimler[0]; $s++) { ! $listeners .= ', <a href="' . append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u='.$isimler[$s]) . '" >'.$isimler[$s].'</a><br />'; } // -------------------------------------------------------------------------------- --- 105,164 ---- if ( ( $shotcast_config['show_listen_select'] ) ) { ! $can_listen="yes"; } ! elseif ($record['username'] == $userdata['username']) { ! $can_listen="no"; } else { ! $can_listen="yes"; } } $listeners = ( empty($isimler[1]) ? '' : ! '<a href="' . mx_append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u='.$isimler[1]) . '" >'.$isimler[1].'</a>' ); for($s = 2; $s <= $isimler[0]; $s++) { ! $listeners .= ', <a href="' . mx_append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u='.$isimler[$s]) . '" >'.$isimler[$s].'</a><br />'; } + //Get bots sessions + $sql = "SELECT * FROM " . SHOTCAST_SESSION_TABLE . " + WHERE user_id = '" . ANONYMOUS . "' + AND bot_id <> '" . ANONYMOUS . "'"; + if (!$sol = $db->sql_query($sql)) + { + mx_message_die(GENERAL_ERROR, "Could not query radio Session information", "", __LINE__, __FILE__, $sql); + } + $isimlerb[0] = $db->sql_numrows($sol); + + $i = 1; + while ($record = $db->sql_fetchrow($sol)) + { + $isimlerb[$i++] = $record['username']; + } + + $radio_bots = empty($isimlerb[1]) ? '' : $isimlerb[1]; + for($s = 2; $s <= $isimlerb[0]; $s++) + { + $radio_bots .= ', ' . $isimlerb[$s]; + } + + $msn_color = 'style="font-weight: bold; color:#' . $theme['fontcolor1'] . '"'; + $yahoo_color = 'style="font-weight: bold; color: #DD2222;"'; + $lycos_color = 'style="font-weight: bold;"'; + + $radio_bots = str_replace('google','<span style="font-weight: bold; color: #2244BB;">G</span><span style="font-weight: bold; color: #DD2222;">o</span><span style="font-weight: bold; color: #EEBB00;">o</span><span style="font-weight: bold; color: #2244BB;">g</span><span style="font-weight: bold; color: #339933;">l</span><span style="font-weight: bold; color: #DD2222;">e</span>',$radio_bots); + $radio_bots = str_replace('adsense','<span ' . $yahoo_color . '>adsense</span>',$radio_bots); + $radio_bots = str_replace('msn','<span ' . $msn_color . '>msn</span>',$radio_bots); + $radio_bots = str_replace('lycos','<span ' . $lycos_color . '>lycos</span>',$radio_bots); + $radio_bots = str_replace('yahoo','<span ' . $yahoo_color . '>Yahoo!</span>',$radio_bots); + $radio_bots = str_replace('slurp','<span ' . $yahoo_color . '>Yahoo! Slurp</span>',$radio_bots); + + if ($isimlerb[0]) + { + $listeners .= ', ' . $radio_bots; + } // -------------------------------------------------------------------------------- *************** *** 132,136 **** ! if ( !$userdata['session_logged_in'] ) { $template->assign_block_vars('switch_user_logged_out', array()); --- 171,175 ---- ! if (!$userdata['session_logged_in']) { $template->assign_block_vars('switch_user_logged_out', array()); *************** *** 138,148 **** else { ! if ( $can_listen=="no") { ! $template->assign_block_vars('switch_user_listening', array()); } else { ! $template->assign_block_vars('switch_user_logged_in', array()); } } --- 177,187 ---- else { ! if ($can_listen == "no") { ! $template->assign_block_vars('switch_user_listening', array()); } else { ! $template->assign_block_vars('switch_user_logged_in', array()); } } --- stop_wmp.php DELETED --- Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/db_install.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_install.php 24 Feb 2008 01:26:46 -0000 1.5 --- db_install.php 28 Feb 2008 06:26:37 -0000 1.6 *************** *** 51,57 **** $sql[] = "CREATE TABLE ".$mx_table_prefix."shotcast_session ( username varchar(99) NOT NULL, ! time bigint(20) NOT NULL, ! UNIQUE username (username) ) TYPE=MyISAM"; --- 51,62 ---- $sql[] = "CREATE TABLE ".$mx_table_prefix."shotcast_session ( + id int(11) unsigned NOT NULL auto_increment, + user_id mediumint(8) DEFAULT '0' NOT NULL, username varchar(99) NOT NULL, ! time int(11) DEFAULT '0' NOT NULL, ! session_ip char(8) DEFAULT '0' NOT NULL, ! bot_id mediumint(8) DEFAULT '0' NOT NULL, ! PRIMARY KEY (id), ! KEY user_id (user_id) ) TYPE=MyISAM"; Index: radio_update.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/radio_update.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** radio_update.php 24 Feb 2008 01:26:47 -0000 1.4 --- radio_update.php 28 Feb 2008 06:26:38 -0000 1.5 *************** *** 65,73 **** if (isset($_POST['update'])) { ! update_shotcast_users($nick,$time); } else { ! update_shotcast_users($nick,$time); } --- 65,73 ---- if (isset($_POST['update'])) { ! update_shotcast_users($nick); } else { ! update_shotcast_users($nick); } *************** *** 92,98 **** } - //read check period - $period = $shotcast_config['check_period'] * 1000; - //radio_update.php (send to the db the user statue "listening" every $period seconds) echo "<html>"; --- 92,95 ---- Index: shotcast.pak =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast.pak,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** shotcast.pak 2 Oct 2007 04:40:14 -0000 1.2 --- shotcast.pak 28 Feb 2008 06:26:39 -0000 1.3 *************** *** 12,14 **** --- 12,18 ---- parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:ShotCast Stats=+:Demo block=+:88=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 + New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 + function=+:71=+:89=+:Radio Player=+:Radio Player or Index=+:radioplayer.php=+: + parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 + block=+:=+:Radio Player=+:Demo block=+:89=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 |