|
From: OryNider <ory...@us...> - 2007-10-02 04:15:48
|
Update of /cvsroot/mxbb/mx_shotcast In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6992 Modified Files: cur_song_save.php getinfo1.php getinfo2.php getinfo_save.php play_real_save.php play_wmp_save.php radio_update_save.php radioplayer_save.php shotcast_save_front.php Log Message: clearing old files. Index: radioplayer_save.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/radioplayer_save.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** radioplayer_save.php 6 Jun 2007 23:18:13 -0000 1.1 --- radioplayer_save.php 2 Oct 2007 04:15:27 -0000 1.2 *************** *** 1,149 **** - <?php - /** - * - * @package mxBB Portal Module - mx_shotcast - * @version $Id$ - * @copyright (c) 2002-2006 [OryNider] mxBB Development Team - * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 - * - */ - - /*************************************************************************** - * mx_shotcast - *************************************************************************** - * History: - *OryNider (16/09/2006) : 1st try - * 2007/01/27 - * -modified by OryNider to work if some functions are disabled in php.ini - ***************************************************************************/ - - include "getinfo_save.php"; - - user_listensc($nick); - ?> - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> - <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> - <head> - <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> - <meta name="description" content="Radio Player" /> - <meta name="keywords" content="Radio Player" /> - <meta name="author" content="Radio Player originaly made by: Niklas Pull - http://pull.zapto.org" /> - <title>Radio Player :: <?=$station;?></title> - <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;} - #main {width: 350px; height: 100px; position: relative; left: 0px; top: 0px; margin:0; padding:0; background-image: url(images/player.png); background-repeat: no-repeat; background-attachment: fixed; background-color: #eeeeee} - #display {width: 315px; height: 39px; position: relative; left: 18px; top: 18px;} - #display_low {width: 310px; height: 21px; position: relative; left: 3px; top: 3px;} - #bottom {width: 350px; height: 39px; position: relative; left: 0px; top: 22px;} - #songtitle {width: 310px; height: 12px; position: relative; left: 3px; top: 3px;} - #station {width: 150px; position: relative; left: 23px; top: 30px;} - #bitrate {width: 55px; position: relative; left: 185px; top: 18px;} - #equalizer {width: 55px; position: relative; left: 280px; top: 0px;} - #icon {width: 55px; position: relative; left: 300px; top: 10px;} - #iframe {width: 0px; position: relative; left: 0px; top: 0px;} - .table {font-family: Verdana; font-size: 10px;} - --> - </style> - <script> - function createRequestObject() { - var ro; - var browser = navigator.appName; - if(browser == "Microsoft Internet Explorer"){ - ro = new ActiveXObject("Microsoft.XMLHTTP"); - }else{ - ro = new XMLHttpRequest(); - } - return ro; - } - - var http = createRequestObject(); - - function sndReq() { - http.open('get', 'cur_song_save.php'); - http.onreadystatechange = handleResponse; - http.send(null); - setTimeout("sndReq()", 2000); - } - - function handleResponse() { - if(http.readyState == 4){ - var response = http.responseText; - if (response != responseold || responsecheck != 1) { - var responsecheck = 1; - document.getElementById("messages").innerHTML = http.responseText; - var responseold = response; - } - } - } - - - </script> - </head> - <body onLoad="javascript:sndReq();"> - <div id="iframe"> - <SCRIPT language="javascript"> - <!-- - document.writeln("<iframe width=\"350\" height=\"1\""); - document.writeln(" id=\"myiframe\" name=\"myiframe\""); - document.writeln(" src=\"radio_update_save.php\""); - document.writeln(" scrolling=\"no\""); - document.writeln(" style=\"width:350px;height:1px;border:1px\">"); - document.writeln("Sorry, your browser doesn't seem to support IFrames!"); - document.writeln("</iframe>"); - document.writeln(""); - //--> - </SCRIPT> - </div> - <div id="main"> - - <div id="display"> - <div id="songtitle"> - <div id="messages"> - </div> - </div> - <div id="display_low"> - <table border="0" cellpadding="0" cellspacing="0" width="300" height="21"> - <tr class="table"> - <td align="left" valign="bottom"> - <i>Station: <b><?=$servertitle;?></b></i> - </td> - <td align="center" valign="bottom"> - <?=$bitrate;?> kbps - </td> - <td align="right" valign="bottom"> - <img src="images/equalizer_<?=$status;?>.gif" height="21"> - </td> - </tr> - </table> - </div> - </div> - - <div id="bottom"> - <table border="0" cellpadding="0" cellspacing="0" width="350" height="39"> - <tr class="table"> - <td width="193"> - <img src="images/player2.png" width="193" height="39" usemap="#play" border="0"> - </td> - <td width="157" height="39" background="images/player3_<?=$z;?>.png"> - Switch to: <a href="radioplayer_save.php?z=<?=$mode;?>"><img src="images/small_<?=$mode;?>.png" border="0"></a> - </td> - </tr> - </table> - </div> - - </div> - - <div id="iframe"> - <iframe src="<?=$status;?>_<?=$z;?>_save.php" name="stream" width="0" height="0"></iframe> - </div> - - <map name="play"> - <area shape="rect" alt="Stop" coords="55,0,78,27" href="radioplayer_save.php?z=<?=$z;?>" target="_self"> - <area shape="rect" alt="Play" coords="21,0,47,28" href="radioplayer_save.php?z=<?=$z;?>&status=play" target="_self"> - </map> - </body> - </html> --- 0 ---- Index: shotcast_save_front.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/shotcast_save_front.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shotcast_save_front.php 6 Jun 2007 23:18:15 -0000 1.1 --- shotcast_save_front.php 2 Oct 2007 04:15:27 -0000 1.2 *************** *** 1,209 **** - <?php - /** - * - * @package mxBB Portal Module - mx_shotcast - * @version $Id$ - * @copyright (c) 2002-2006 [OryNider] mxBB Development Team - * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 - * - */ - - /*************************************************************************** - * mx_chatbox module written by markus_petrux at phpmix dot com - *************************************************************************** - * History: - * 2006/09/10 - * -modified by OryNider to shotcast_front - * 2007/01/27 - * -modified by OryNider to work if some functions are disabled in php.ini - ***************************************************************************/ - - // -------------------------------------------------------------------------------- - // Security check - // - - if( !defined('IN_PORTAL') ) - { - die("Hacking attempt"); - } - - // -------------------------------------------------------------------------------- - // Initialization - // - - // - // Common Includes and Read Module Settings - // - 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); - - // - // Start session management - // - - // $mx_user->init($user_ip, PAGE_INDEX); - - // - // End session management - // - - - $time=date("U"); - // $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 - - ini_set("display_errors", "0"); - - - $shoutcastserver = $shotcast_config['shotcast_name']; - $servertitle = $shotcast_config['shotcast_name']; - $currentlisteners = "11"; - $bitrate = "32"; - $song[0] = "Unknon Artist"; - - // - // Read block Configuration - // - $title = $mx_block->block_info['block_title']; - $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); - $shotcast_icon = 'shotcast_front_02.gif'; - $wmp_icon = 'wmp_front.gif'; - $real_icon = 'real_front.gif'; - - // -------------------------------------------------------------------------------- - // Get ChatBox Session information - // - - // 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)) - { - 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 != "" ) - { - $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; - while ($record = $db->sql_fetchrow($sol)) - { - $isimler[$i++] = $record['username']; - 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 />'; - } - - - // -------------------------------------------------------------------------------- - // Generate block output (using templates) - // Generate HTML for the block... - // - $template->set_filenames(array( - 'body' => 'shotcast_front.tpl') - ); - - - if ( !$userdata['session_logged_in'] ) - { - $template->assign_block_vars('switch_user_logged_out', array()); - } - else - { - if ( $can_listen=="no") - { - $template->assign_block_vars('switch_user_listening', array()); - } - else - { - $template->assign_block_vars('switch_user_logged_in', array()); - } - } - - if( empty($listeners) ) - { - $template->assign_block_vars('switch_listeners_list_off', array()); - $listeners_list = ''; - } - else - { - $template->assign_block_vars('switch_listeners_list_on', array()); - $listeners_list = sprintf($lang['Who_Are_Listening'], $listeners); - } - - $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), - 'TOTAL_LISTENERS_PEAK' => sprintf($lang['How_Many_Peak'], $howmanypeak), - 'LISTENERS_LIST' => $listeners_list, - 'L_CLICK_TO_LISTEN_STATION' => $lang['Click_to_listen_station'], - 'L_CLICK_TO_LISTEN_WMP' => $lang['Click_to_listen_wmp'], - 'L_CLICK_TO_LISTEN_REAL' => $lang['Click_to_listen_real'], - 'S_LISTEN_STATION' => append_sid($module_root_path.'radioplayer_save.php'), - 'S_LISTEN_WMP' => append_sid($module_root_path.'radioplayer_save.php?lang=&z=wmp'), - 'S_LISTEN_REAL' => append_sid($module_root_path.'radioplayer_save.php?lang=&z=real'), - 'S_MOREINFO' => append_sid($module_root_path.'moreinfo.php'), - 'L_LOGIN_TO_LISTEN_STATION' => $lang['Login_to_listen_station'], - 'L_ALREADY_LISTENING' => $lang['Already_listening'], - 'BLOCK_SIZE' => $block_size, - // 'U_URL' => append_sid(PORTAL_URL . 'index.' . $phpEx . '?block_id=' . $block_id), - 'BLOCK_ID' => $block_id, - 'L_VERSION' => _SHOTCAST_VERSION, - 'L_TITLE' => 'shotcast') - ); - - $template->pparse('body'); - - unset($liteners, $sql, $howmanylisten, $listeners_list, $block_size, $module_root_path, $isimler, $can_listen); - ?> --- 0 ---- Index: getinfo1.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/getinfo1.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** getinfo1.php 6 Jun 2007 23:17:59 -0000 1.1 --- getinfo1.php 2 Oct 2007 04:15:24 -0000 1.2 *************** *** 1,71 **** - <?php - /** - * - * @package mxBB Portal Module - mx_shotcast - * @version $Id$ - * @copyright (c) 2002-2006 [OryNider] mxBB Development Team - * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 - * - */ - - - // - // Start session management - // - // $mx_user->init($user_ip, PAGE_INDEX); - - /* - if ( !$userdata['session_logged_in'] ) - { - mx_redirect(append_sid(PHPBB_URL . "login.".$phpEx."?redirect=chat.".$phpEx, true)); - exit; - } - */ - - // - // End session management - // - - - $time=date("U"); - // $nick = str_replace(" ", "_", $userdata['username']); - - /* - if ($_POST['update']==true) - { - update_shotcast_user($nick,$time); - } - */ - - //read check period - $period=$shotcast_config['check_period']*1000; - - $scip = "277.0.0.0"; - $shoutcastserver = $shotcast_config['shotcast_name']; - $servertitle = $shotcast_config['shotcast_name']; - $currentlisteners = "0"; - $bitrate = "56"; - $song[0] = "Unknon Artist"; - $maxlisteners = "32"; - - // if ($currentlisteners=="") { $currentlisteners = $text[2]; } - // if ($bitrate=="") { $bitrate = $text[5]; } - // if ($song[0]=="") { $song[0] = $text[6]; - - 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 --- 0 ---- Index: play_wmp_save.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/play_wmp_save.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** play_wmp_save.php 6 Jun 2007 23:18:09 -0000 1.1 --- play_wmp_save.php 2 Oct 2007 04:15:26 -0000 1.2 *************** *** 1,135 **** - <?php include "getinfo_save.php";?> - <html><head> - <STYLE type=text/css>BODY { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #CEDEDF; - } - </STYLE> - </head><body> - <TABLE cellSpacing=0 cellPadding=0 width=315 border=0> - <TBODY> - <TR> - <TD vAlign=top align=left> - - <TABLE cellSpacing=0 cellPadding=0 width=300 border=0> - <TBODY> - <!-- Check Media Player Version --> - <SCRIPT LANGUAGE="JavaScript"> - var WMP7; - var Mac; - var Win; - var Unix; - var Linux; - - Win = navigator.userAgent.indexOf("Win") > -1; - Mac = navigator.userAgent.indexOf("Mac") > -1; - Unix = navigator.appVersion.indexOf("X11") > -1; - Linux = navigator.appVersion.indexOf("Linux") > -1; - - - if (Mac) - { - - if ( navigator.appName == "Netscape" ){ - //Netscape code - document.write (' <Embed id="wmp" name="wmp" type="audio/mpeg"'); - document.write (' pluginspage="http://www.microsoft.com/windows/windowsmedia/"'); - document.write (' filename="http://<?=$scip;?>:<?=$scport;?>"'); - document.write (' src="http://<?=$scip;?>:<?=$scport;?>"'); - document.write (' Name=MediaPlayer'); - document.write (' ShowControls=1'); - document.write (' ShowDisplay=1'); - document.write (' ShowStatusBar=1'); - document.write (' AUTOSTART=1'); - document.write (' width=332'); - document.write (' height=354>'); - document.write (' </Embed>'); } - - if ( navigator.appName != "Netscape" ){ - document.write(' <embed id="wmp" name="wmp" type="audio/mpeg" width="332" height="354" ShowTracker="0" ShowDisplay="0" ShowGotoBar="0" ShowStatusBar="1" ShowCaptioning="0" AUTOSTART="1" src="http://<?=$scip;?>:<?=$scport;?>" ></embed>'); } - } - - - if (Win) - { - if ( navigator.appName != "Netscape" ){ - WMP7 = new ActiveXObject('WMPlayer.OCX'); - } - - // Windows Media Player 7 Code - if ( WMP7 ) - { - - document.write ('<OBJECT ID=MediaPlayer '); - document.write (' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'); - document.write (' standby="Loading Microsoft Windows Media Player components..."'); - document.write (' TYPE="application/x-oleobject" width="332" height="354">'); - document.write ('<PARAM NAME="url" VALUE="http://<?=$scip;?>:<?=$scport;?>">'); - document.write ('<PARAM NAME="AutoStart" VALUE="true">'); - document.write ('<PARAM NAME="ShowControls" VALUE="1">'); - document.write ('<PARAM NAME="uiMode" VALUE="mini">'); - - document.write (' <Embed type="application/x-mplayer2"'); - document.write (' pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"'); - document.write (' filename="http://<?=$scip;?>:<?=$scport;?>"'); - document.write (' src="http://<?=$scip;?>:<?=$scport;?>"'); - document.write (' Name="MediaPlayer"'); - document.write (' ShowControls="1"'); - document.write (' ShowDisplay="1"'); - document.write (' ShowStatusBar="1"'); - document.write (' AUTOSTART="true"'); - document.write (' width="332"'); - document.write (' height="354">'); - document.write (' </embed>'); - - document.write ('</OBJECT>'); - - - } - - // Windows Media Player 6.4 Code - else - - { - - //IE Code - document.write ('<OBJECT ID=MediaPlayer '); - document.write (' CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'); - document.write (' CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 '); - document.write (' standby="Loading Microsoft Windows Media Player components..."'); - document.write (' TYPE="application/x-oleobject" width="332" height="354">'); - document.write (' <PARAM NAME="FileName" VALUE="http://<?=$scip;?>:<?=$scport;?>">'); - document.write ('<PARAM NAME="url" VALUE="http://<?=$scip;?>:<?=$scport;?>"> '); - document.write ('<PARAM NAME="AutoStart" VALUE="1">'); - document.write ('<PARAM NAME="ShowControls" VALUE="1">'); - - //Firefox code - document.write (' <Embed type="application/x-mplayer2"'); - document.write (' pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&"'); - document.write (' filename="http://<?=$scip;?>:<?=$scport;?>"'); - document.write (' src="http://<?=$scip;?>:<?=$scport;?>"'); - document.write (' Name="MediaPlayer"'); - document.write (' ShowControls="1"'); - document.write (' ShowDisplay="1"'); - document.write (' ShowStatusBar="1"'); - document.write (' AUTOSTART="true"'); - document.write (' width="332"'); - document.write (' height="354">'); - document.write (' </embed>'); - - document.write ('</OBJECT>'); - - } - } - - else - { - - document.write(' <embed type="audio/mpeg" width="332" height="354" AUTOSTART="1" filename="http://<?=$scip;?>:<?=$scport;?>" src="http://<?=$scip;?>:<?=$scport;?>" ></embed>'); - - } - - </SCRIPT> - </TD></TR> - </TBODY></TABLE> - </body> - </html> \ No newline at end of file --- 0 ---- Index: play_real_save.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/play_real_save.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** play_real_save.php 6 Jun 2007 23:18:04 -0000 1.1 --- play_real_save.php 2 Oct 2007 04:15:26 -0000 1.2 *************** *** 1,26 **** - <?php include "getinfo_save.php";?> - <html> - <head> - <title>RealMedia</title> - </head> - - <body> - <p> - <object id="RVOCX" classid="CLSID:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="320" height="172"> - <param name="SRC" value="http://<?=$scip;?>:<?=$scport;?>/<?=$playlist;?>"> - <param name="CONTROLS" value="ImageWindow"> - <param name="CONSOLE" value="cons"> - <embed autostart="true" src="http://<?=$scip;?>:<?=$scport;?>/<?=$playlist;?>" type="audio/x-pn-realaudio-plugin" width="320" height="172" controls="ImageWindow" console="cons"> </embed> - <param name="autostart" value="true"> - </object> - </p> - <p> - <object id=RVOCX classid="CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="320" height="30" > - <param name="SRC" value="http://<?=$scip;?>:<?=$scport;?>/<?=$playlist;?>"> - <param name="CONTROLS" value="ControlPanel"> - <param name="CONSOLE" value="cons"> - <embed src="http://<?=$scip;?>:<?=$scport;?>/<?=$playlist;?>" type="audio/x-pn-realaudio-plugin" width="320" height="30" controls="ControlPanel" console="cons" > </embed> - </object> - </p> - </body> - </html> \ No newline at end of file --- 0 ---- Index: cur_song_save.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/cur_song_save.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cur_song_save.php 6 Jun 2007 23:17:57 -0000 1.1 --- cur_song_save.php 2 Oct 2007 04:15:24 -0000 1.2 *************** *** 1,2 **** - <?php include "getinfo_save.php";?> - <b><?=$song[0];?></b> \ No newline at end of file --- 0 ---- Index: getinfo_save.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/getinfo_save.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** getinfo_save.php 6 Jun 2007 23:18:00 -0000 1.1 --- getinfo_save.php 2 Oct 2007 04:15:25 -0000 1.2 *************** *** 1,59 **** - <?php - /** - * - * @package mxBB Portal Module - mx_shotcast - * @version $Id$ - * @copyright (c) 2002-2006 [OryNider] mxBB Development Team - * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 - * - */ - - /*************************************************************************** - * mx_shotcast - *************************************************************************** - * History: - *OryNider (16/09/2006) : 1st try - * 2007/01/27 - * -modified by OryNider to work if some functions are disabled in php.ini - ***************************************************************************/ - - include "shotcast_config.php"; - - ini_set("display_errors", "0"); - - $mx_user->init($user_ip, PAGE_INDEX); - $nick = str_replace(" ", "_", $userdata['username']); - $time=date("U"); - if ($_POST['update']==true) - { - update_shotcast_user($nick,$time); - } - - $shoutcastserver = $shotcast_config['shotcast_name']; - $servertitle = $shotcast_config['shotcast_name']; - $currentlisteners = "11"; - $bitrate = "56"; - $song[0] = "Unknon Artist"; - $maxlisteners = "32"; - - // if ($currentlisteners=="") { $currentlisteners = $text[2]; } - // if ($bitrate=="") { $bitrate = $text[5]; } - // if ($song[0]=="") { $song[0] = $text[6]; } - - 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 --- 0 ---- Index: radio_update_save.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/radio_update_save.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** radio_update_save.php 6 Jun 2007 23:18:11 -0000 1.1 --- radio_update_save.php 2 Oct 2007 04:15:26 -0000 1.2 *************** *** 1,134 **** - <?php - /** - * - * @package mxBB Portal Module - mx_shotcast - * @version $Id$ - * @copyright (c) 2002-2006 [OryNider] mxBB Development Team - * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 - * - */ - - /*************************************************************************** - * mx_shotcast - *************************************************************************** - * History: - *OryNider (16/09/2006) : 1st try - * 2007/01/27 - * -modified by OryNider to work if some functions are disabled in php.ini - ***************************************************************************/ - - error_reporting( E_ALL ); - 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); - - define('_SHOTCAST_CONFIG', true); - include_once($module_root_path . 'includes/common.'.$phpEx); - - // - // Start session management - // - $mx_user->init($user_ip, PAGE_INDEX); - // - // End session management - // - - $time=date("U"); - $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 - - $shoutcastserver = $shotcast_config['shotcast_name']; - $servertitle = $shotcast_config['shotcast_name']; - $currentlisteners = "11"; - $bitrate = "56"; - $song[0] = "Unknon Artist"; - $maxlisteners = "32"; - - $time=date("U"); - - if ($_POST['update']==true) - { - update_shotcast_users($nick,$time); - } - else - { - update_shotcast_users($nick,$time); - } - - function update_total_users($currentlisteners) - { - global $shotcast_config, $board_config, $db, $lang; - - - $sql = "UPDATE ". SHOTCAST_CONFIG_TABLE ." SET `config_name` = 'currentlisteners' WHERE `config_value` = '". $currentlisteners ."'"; - - if( !$result = $db->sql_query($sql) ) - { - die("SQL Error in function update_total_users(): UPDATE<br />" . $sql); - } - } - - 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) - echo "<html>"; - echo "<head>"; - echo "<script language=\"javascript\">"; - echo "setInterval(\"document.forms['update'].submit();\",".$period.");"; - echo "</script>"; - echo "<script>\n"; - echo "<!--\n"; - echo "\n"; - echo "//enter refresh time in \"minutes:seconds\" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59\n"; - echo "var limit=\"0:30\"\n"; - echo "\n"; - echo "if (document.images){\n"; - echo "var parselimit=limit.split(\":\")\n"; - echo "parselimit=parselimit[0]*60+parselimit[1]*1\n"; - echo "}\n"; - echo "function beginrefresh(){\n"; - echo "if (!document.images)\n"; - echo "return\n"; - echo "if (parselimit==1)\n"; - echo "window.location.reload()\n"; - echo "else{\n"; - echo "parselimit-=1\n"; - echo "curmin=Math.floor(parselimit/60)\n"; - echo "cursec=parselimit%60\n"; - echo "if (curmin!=0)\n"; - echo "curtime=curmin+\" minutes and \"+cursec+\" seconds left until page refresh!\"\n"; - echo "else\n"; - echo "curtime=cursec+\" seconds left until page refresh!\"\n"; - echo "window.status=curtime\n"; - echo "setTimeout(\"beginrefresh()\",1000)\n"; - echo "}\n"; - echo "}\n"; - echo "\n"; - echo "window.onload=beginrefresh\n"; - echo "//-->\n"; - echo "</script>\n"; - echo "</head>"; - echo "<body background=\"templates/gateway_files/iframe_bg.png\">"; - echo "<form name=\"update\" action=\"radio_update_save.php\" method=\"POST\">"; - echo "<input type=\"hidden\" name=\"update\" value=\"true\">"; - echo "</form>"; - echo " Loged in as: $nick\n"; - echo "</body>"; - echo "</html>"; - ?> \ No newline at end of file --- 0 ---- Index: getinfo2.php =================================================================== RCS file: /cvsroot/mxbb/mx_shotcast/getinfo2.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** getinfo2.php 6 Jun 2007 23:17:59 -0000 1.1 --- getinfo2.php 2 Oct 2007 04:15:25 -0000 1.2 *************** *** 1,127 **** - <?php - /** - * - * @package mxBB Portal Module - mx_shotcast - * @version $Id$ - * @copyright (c) 2002-2006 [OryNider] mxBB Development Team - * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 - * - */ - - /*************************************************************************** - * mx_shotcast - *************************************************************************** - * History: - *OryNider (16/09/2006) : 1st try - * 2007/01/27 - * -modified by OryNider to work if URL file-access is disabled in the - * server configuration - ***************************************************************************/ - - // - // Start session management - // - // $mx_user->init($user_ip, PAGE_INDEX); - - /* - if ( !$userdata['session_logged_in'] ) - { - mx_redirect(append_sid(PHPBB_URL . "login.".$phpEx."?redirect=chat.".$phpEx, true)); - exit; - } - */ - - // - // End session management - // - - /* - $time=date("U"); - $nick = str_replace(" ", "_", $userdata['username']); - - if ($_POST['update']==true) - { - update_shotcast_user($nick,$time); - } - */ - - //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 - - 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 --- 0 ---- |