|
From: OryNider <ory...@us...> - 2008-04-20 07:22:16
|
Update of /cvsroot/mxbb/mx_shotcast/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19604/includes Modified Files: common.php detectScript.htm Added Files: cur_song.php Log Message: 3.0.0-RC Index: detectScript.htm =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/includes/detectScript.htm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** detectScript.htm 6 Mar 2008 06:03:40 -0000 1.2 --- detectScript.htm 20 Apr 2008 07:21:40 -0000 1.3 *************** *** 21,25 **** function checkSong(){ ! var xmlHttp; try{ xmlHttp = new XMLHttpRequest(); --- 21,25 ---- function checkSong(){ ! var xmlHttp; try{ xmlHttp = new XMLHttpRequest(); *************** *** 42,52 **** if(xmlHttp.readyState == 4){ document.getElementById('songtitle').innerHTML = xmlHttp.responseText; ! setTimeout('Ajax()',25000); } } ! xmlHttp.open("GET","<?=$module_root_path;?>cur_song.<?=$phpEx;?>",true); xmlHttp.send(null); } function embedInfo(embed){ --- 42,54 ---- if(xmlHttp.readyState == 4){ document.getElementById('songtitle').innerHTML = xmlHttp.responseText; ! setTimeout('checkSong()',15900); } } ! xmlHttp.open("GET","<?=$module_root_path;?>includes/cur_song.<?=$phpEx;?>",true); xmlHttp.send(null); } + + function embedInfo(embed){ *************** *** 137,140 **** --- 139,143 ---- function playR(){ + document.getElementById('eq').src = '<?=$module_root_path;?>images/<?=SKIN;?>/equalizer_play.gif'; var embed = document.getElementById('embedchoise'); var frame = document.getElementById('embedFrame'); *************** *** 150,159 **** embedInfo(detectEmbed()); } - document.getElementById('eq').src = '<?=$module_root_path;?>images/<?=SKIN;?>/equalizer_play.gif'; } function stopR(){ - document.getElementById('embedFrame').src = ""; document.getElementById('eq').src = '<?=$module_root_path;?>images/<?=SKIN;?>/equalizer_stop.gif'; } --- 153,161 ---- embedInfo(detectEmbed()); } } function stopR(){ document.getElementById('eq').src = '<?=$module_root_path;?>images/<?=SKIN;?>/equalizer_stop.gif'; + document.getElementById('embedFrame').src = ""; } --- NEW FILE: cur_song.php --- <?php if( !defined('IN_PORTAL') || !is_object($mx_block)) { define('IN_PORTAL', true); $mx_root_path = "../../../"; $module_root_path = "./../"; $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once($mx_root_path . 'common.'.$phpEx); // // Start session management // $mx_user->init($user_ip, PAGE_INDEX); // // End session management // $title = 'Media Player Radio'; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '315' ); $is_block = FALSE; } else { // // Read block Configuration // $title = $mx_block->block_info['block_title']; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); if( is_object($mx_block)) { $is_block = TRUE; } } define('IN_SHOTCAST', true); require($module_root_path .'includes/common.'.$phpEx); require($module_root_path . 'getinfo.'.$phpEx); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); ?> <HTML> <HEAD> <META http-equiv="pragma" content="no-cache"> <META HTTP-EQUIV="refresh" CONTENT="159"> <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="1:59" 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()",15900) } } window.onload=beginrefresh //--> </script> </HEAD> <body> <?php if($radio->song()) { echo '<span style="font-weight : bold;">'.$radio->song().'</span>'; } else { echo '<span style="font-weight : bold;">'.$song[0].'</span>'; } ?> </body> </HTML> Index: common.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/includes/common.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** common.php 6 Mar 2008 03:09:36 -0000 1.7 --- common.php 20 Apr 2008 07:21:40 -0000 1.8 *************** *** 39,64 **** $module_name = 'shotcast'; ! $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_name = '$module_name'"; ! ! if(!($result = $db->sql_query($sql))) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't obtain shotcast module informations from database", '', __LINE__, __FILE__, $sql); ! } ! ! while($module = $db->sql_fetchrow($result)) { $music_module_copy = $module['module_copy']; $music_module_name = $module['module_name']; ! $music_module_version = $module['module_version']; } if( !empty($music_module_copy) ) { ! define('_SHOTCAST_VERSION', 'mxBB <i> - ' . $music_module_name . '</i> ' . $music_module_version . ' © 2007 by OryNider'); } else { ! define('_SHOTCAST_VERSION', 'mxBB <i> - ShotCast Module ver. 1.x</i> © 2007 by OryNider'); } --- 39,82 ---- $module_name = 'shotcast'; ! if (($mx_cache->get('shotcast_module')) && ($use_cache)) { + $module = $mx_cache->get('shotcast_module'); + $music_module_copy = $module['module_copy']; $music_module_name = $module['module_name']; ! $music_module_version = $module['module_version']; ! } + else + { + $module = array(); + + $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_name = '$module_name'"; + + if(!($result = $db->sql_query($sql))) + { + mx_message_die(GENERAL_ERROR, "Couldn't obtain shotcast module informations from database", '', __LINE__, __FILE__, $sql); + } + + while($module = $db->sql_fetchrow($result)) + { + $music_module_copy = $module['module_copy']; + $music_module_name = $module['module_name']; + $music_module_version = $module['module_version']; + } + if ($use_cache) + { + $mx_cache->put('shotcast_module', $module); + } + } if( !empty($music_module_copy) ) { ! define('_SHOTCAST_VERSION', 'mxBB <i> - ' . $music_module_name . '</i> ' . $music_module_version . ' © 2007-2008 by OryNider'); } else { ! define('_SHOTCAST_VERSION', 'mxBB <i> - ShotCast Module ver. 3.x</i> © 2007-2008 by OryNider'); } |