|
From: Florin C B. <ory...@us...> - 2013-05-28 07:14:40
|
Update of /cvsroot/mxbb/mx_shotcast/config In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22638/config Added Files: config.php config_ice.php config_shout.php display_config.php index.htm index.html Log Message: Version 3.5.2 --- NEW FILE: index.html --- <HTML><HEAD> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <META name="GENERATOR" content="3D Editor 1.03 Copyright (c) 2003 by Albu Cristian"> <META name="robots" content="INDEX, FOLLOW"> <TITLE>Index of /radioplayer/v4/config</TITLE> </HEAD> <BODY text="#FCFCFC" bgcolor="#0055AA" link="#147AEB" vlink="#144ABB" alink="#14FFBB"> <H1><HR><CENTER>Index of /radioplayer/v4/config<P>Last Updated: Saturday, May 11th, 2013</CENTER><HR></H1><P><TABLE WIDTH=100%> <TD WIDTH=20% BGCOLOR=#147AEB><FONT COLOR=#EB8514><B>File name</B></FONT> <TD WIDTH=10% BGCOLOR=#005ACB><FONT COLOR=#EB8514><B>Size</B></FONT> <TD WIDTH=20% BGCOLOR=#003AAB><FONT COLOR=#EB8514><B>Last update</B></FONT> <TD WIDTH=50% BGCOLOR=#001A8B><FONT COLOR=#EB8514><B>Description</B></FONT></TR> <TR VALIGN=TOP><TD><A HREF="../index.html">[..]</A><TD ALIGN=CENTER><DIR><TD ALIGN=CENTER>5/11/2013, 16:3<TD>Parent directory <TR VALIGN=TOP><TD><A HREF="config.php">config.php</A><TD ALIGN=RIGHT>2,498<TD ALIGN=CENTER>2/17/2009, 18:21<TD> <TR VALIGN=TOP><TD><A HREF="display_config.php">display_config.php</A><TD ALIGN=RIGHT>2,133<TD ALIGN=CENTER>8/6/2010, 4:6<TD> </TABLE><P ALIGN=RIGHT><SMALL>There are 2 files and 1 directories<BR ALIGN=RIGHT>for a total of 4631 bytes.</SMALL></BODY> </HTML> --- NEW FILE: config_ice.php --- <?php /*************************************************************************** * *********************** SET UP VARIABLES HERE ****************************/ // // Generic config parameters // // Radio Station Name here $station_name = "Radio Station Offline"; // IP address (e.g. kdshfm.com) $caster_ip = ""; // Port for the caster (e.g. 7000) Leave blank if u don't know what your doing. $caster_port = ""; // Caster type: shout or ice $caster = "ice"; // What skin to use $radio_skin = "default"; // What language to use $language = "english"; // If Stream should start automatic when player is loaded $autoplay = true; // // Icecast config parameters // // If icecast is used with mount points else leave blank (e.g. /livemp3) $icecast_mount_point = "/livemp3"; // .pls type play list (e.g. listen.pls , livemp3) $playlist_pls = "livemp3"; //$playlist_pls = "livemp3"; // .asx type play list. Looks like u need an asx type of play list for wmp if // u run Icecast (e.g. livemp3) $playlist_asx = "livemp3"; // IP address of the server where the play lists are located. Leave blank if // they are on the same server as the caster ip. $playlist_ip = ""; // Port of the server where the play lists are located. Leave blank if they // are on the same server as the caster ip. $playlist_port = ""; //Secure cookies on the site were the playlist(s) is located ? $cookie_secure = false; //If other then port 80 where the play lists are located. Leave blank if they $server_port = ''; // // Logo config parameters // // Logo should be put in the root of "/logos". U can use any format tha works // on the web (jpeg, gif, png...) // What do u want to use? CD-cover, equliazer, logo (cover, eq, logo) $picture = "cover"; // Fallback if no cover is found (eq/logo) $fallback = "eq"; // The filename of the logo u want to use $logo_name = "logo.gif"; // Fallback URL to use when no cover is found. Leave blank if they // are on the same server as the caster ip. $caster_url = ""; /************************* DO NOT EDIT BELOW THIS LINE *********************/ /************************ IF U DON'T KNOW WHAT U ARE DOING *****************/ // // Advanced config parameters // // Use Curl to get cd cover data (yes/no) $curl = "no"; // If both web server and icecast are behind a router and the web server needs // to know the internal ip of caster so it can pull the info for the player. // This could be the case if all three got different internal ip-s. $caster_internal_ip = ""; $caster_internal_port = ""; //Server protocol if we use cookies $server_protocol = ($cookie_secure) ? 'https://' : 'http://'; // Fallback URL to use when no cover is found. Edit above. $no_cover_url = (empty($caster_url)) ? $server_protocol.$caster_ip . (($caster_port != 80) ? ":".$caster_port : "") : $caster_url; $full_logo_url = ""; // Easier java debug messages (yes/no). $java_debug = "no"; /************************* DO NOT EDIT BELOW THIS LINE *********************/ /***************************************************************************/ ?> --- NEW FILE: display_config.php --- <?php /********************************* EDIT DISPLAY ******************************/ // !!!DONT TOUCH IF U DONT KNOW WHAT U ARE DOING!!! // // Here u can change ure title and info to whatever u want it to be... and // it's easy as pie. ;) // Here U have a couple of pre defined values that u can use. // They are: // 1. $a - The song that is playing now. // 2. $b - How many listeners there are online now. // 3. $c - Maximum amount of listeners that can connect. (Only ShotCast) // 4. $d - What type format ure sending in mpeg or acc. // 5. $e - The genre of your server. // 6. $f - The bitrate ure sending in. // 7. $g - Maximum amount of listeners u ever had connected. // And if u are running ice cast then u have some more variables. // They are: // 8. $h - Server name. // 9. $i = Server description. // 10. $j = Quality. // 11. $k = Video quality. // 12. $l = Frame size. // 13. $m = Frame rate. // 14. $n = Server URL. // 15. $o = Artist. // // So how do u make ure own pretty title? // Here are some exmples: // // 1. // $title = "Now playing: $a ($b/$c)"; // The player title would now show e.g. // "Now playing: Frodo United - Gandalf song (63/120)" // // 2. // $title = "$a"; // The player title would now show e.g. // "Happy Hamster - Hardcore pimpin" // // 3. // $title = "U are now listening to $a in $f kbps. U are one of $b listeners."; // The player title would now show e.g. // "U are now listening to 1 hour - Jet engine sound in 32 kbps. U are one of 25 listeners." // // Radio title //E.g. $title = "$a"; $title = "$a"; //HTML TITLE /TITLE TAG and Status $title_bar = $lang['Radio_Player']." • ".$station_name; $title_tag = $lang['Radio_Player']." • ".$station_name; // There are four lines of info u can change to whatever u like. Dont use text that is to long // couse it may damage the apperence of the player. // First info $firstinfo = $lang['listeners'].": $b"; // Second info $secondinfo = $lang['Server_genre']." $e"; // Third info $thirdinfo = $lang['Bitrate']." $f"; // Forth info $forthinfo = " $d"; // How often to update title (miliseconds). To low value is not good. U might hammer your // server to death. $update_title = "5000"; //************************* DO NOT EDIT BELOW THIS LINE *********************/ ?> --- NEW FILE: config.php --- <?php /** * * @package Mx-Publisher Module - mx_shotcast * @version $Id: config.php,v 1.1 2013/05/28 07:14:38 orynider Exp $ * @copyright (c) 2002-2006 [OryNider] MXP-CMS Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ /* /* MX-CMS Code Starts /* Security check */ if((!defined('IN_SHOTCAST') && !defined('IN_PORTAL'))) { die("Hacking attempt"); } // History: // Little Frog (v 1.x - 2.x) // OryNider (v 1.x - 3.x) // DrKnas (v 4.0 - 4.2.x) // OryNider (Current maintainer: 3.5.x & 4.9.x & mxpcms versions) /* /* MX-CMS Code Starts */ if(!is_object($mx_block) && !defined('IN_ADMIN')) { define('IN_PORTAL', true); $mx_root_path = $module_root_path . "../../"; include_once($mx_root_path . 'common.'.$phpEx); // Start session management $mx_user->init($user_ip, PAGE_INDEX); // End session management $title = 'Media Player Radio'; $is_block = FALSE; } if(defined('IN_PORTAL') || is_object($mx_block)) { // Read block Configuration $title = $mx_block->block_info['block_title']; $is_block = TRUE; } // // Define table names. // @define('SHOTCAST_CONFIG_TABLE', $mx_table_prefix.'shotcast_config'); @define('SHOTCAST_SESSION_TABLE', $mx_table_prefix.'shotcast_session'); //Check for shotcast version if(file_exists($mx_root_path . "modules/mx_radio/includes/common.$phpEx")) { !defined('SHOTCAST_SESSION_TABLE') ? define('SHOTCAST_SESSION_TABLE', $mx_table_prefix.'radio_session') : false; } //$mx_user->set_module_default_style('_core'); // For compatibility with core 2.8.x // Cache settings $use_cache = 1; // // mx_shotcast version... // $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'); } // // Load language files. // $default_lang = ($mx_user->lang['default_lang']) ? $mx_user->encode_lang($mx_user->lang['default_lang']) : (($board_config['default_lang']) ? $board_config['default_lang'] : 'english'); if (empty($default_lang)) { // - populate $default_lang $default_lang = 'english'; } //Main module lang if ((@include_once $module_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx") === false) { if ((@include_once $module_root_path . "language/lang_english/lang_main.$phpEx") === false) { mx_message_die(CRITICAL_ERROR, 'Language file ' . $module_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx" . ' couldn\'t be opened.'); } $default_lang = 'english'; } //Admin Module Lang if(@file_exists($module_root_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx") ) { include($module_root_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx"); } else { include($module_root_path . "language/lang_english/lang_admin.$phpEx"); } // // Common definitions... // $time = date("U"); $cfg_shotcastname = $board_config['sitename'] . ' -> ' . 'shotcast'; if(empty($user_ip)) { $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : getenv('REMOTE_ADDR') ); $user_ip = phpBB2::encode_ip($client_ip); } $user_id = $userdata['user_id']; $nick = str_replace(" ", "_", $userdata['username']); $radio_bot_id = ANONYMOUS; // ================================================================================ // [ SHOTCAST CONFIG ] // ================================================================================ $shotcast_config = array(); // // Get radio Settings from config table // if (($mx_cache->get('shotcast_config')) && ($use_cache)) { $shotcast_config = $mx_cache->get('shotcast_config'); } else { $sql = "SELECT * FROM " . SHOTCAST_CONFIG_TABLE; if (!($result = $db->sql_query($sql))) { if (!function_exists('mx_message_die')) { die("Couldnt query shotcast_config information, Allso this hosting or server is using a cache optimizer not compatible with MX-Publisher or just lost connection to database wile query."); } else { mx_message_die( GENERAL_ERROR, 'Couldnt query shotcast_config information', '', __LINE__, __FILE__, $sql ); } } while ($row = $db->sql_fetchrow($result)) { $shotcast_config[$row['config_name']] = $row['config_value']; } $db->sql_freeresult($result); if ($use_cache) { $mx_cache->put('shotcast_config', $shotcast_config); } } //read check period $period = $shotcast_config['check_period'] * 1000; if ($userdata['user_id'] == ANONYMOUS) { if($this_agent) { $nick = $this_agent; } else { $nick = $shotcast_config['guestname']; } if ($this_bot_id) { $radio_bot_id = $this_bot_id; } } // ================================================================================ // [ COMMON FUNCTIONS ] // ================================================================================ function user_listensc($nick) { global $userdata, $shotcast_config, $db, $user_ip, $radio_bot_id; $current_time = date("U"); $user_id = $userdata['user_id']; $sql = "DELETE FROM " . SHOTCAST_SESSION_TABLE . " WHERE session_ip = '" . $user_ip . "'"; if(!$result = $db->sql_query($sql)) { mx_message_die(CRITICAL_ERROR, 'SQL Error in function user_listensc(): DELETE<br />', '', __LINE__, __FILE__, $sql); } $sql = "INSERT INTO " . SHOTCAST_SESSION_TABLE . " (user_id, username, time, session_ip, bot_id) VALUES ('$user_id', '" . addslashes($nick) . "', '$current_time', '$user_ip', '$radio_bot_id')"; if(!$result = $db->sql_query($sql)) { mx_message_die(CRITICAL_ERROR, 'SQL Error in function user_listensc(): INSERT INTO<br />', '', __LINE__, __FILE__, $sql); } } //Update user statue "listening/not listening" //Since this is loaded in a iframe it's not need for debuging code function update_shotcast_users($nick) { global $shotcast_config, $db, $lang, $user_ip; $time = date("U"); $sql = "UPDATE " . SHOTCAST_SESSION_TABLE . " SET time = $time WHERE session_ip = '" . $user_ip . "'"; if(!$result = $db->sql_query($sql)) { $sql = "UPDATE " . SHOTCAST_SESSION_TABLE . " SET time = $time WHERE username = '" . $nick . "'"; if(!$result = $db->sql_query($sql)) { user_listensc($nick); } } /* if(defined('RADIO_SESSION_TABLE')) { $sql = "DELETE FROM " . RADIO_SESSION_TABLE . " WHERE session_ip = '$user_ip'"; $db->sql_query($sql); $sql = "INSERT INTO " . RADIO_SESSION_TABLE . " (user_id, username, time, session_ip, bot_id) VALUES ('$user_id', '" . addslashes($nick) . "', '$time', '$user_ip', '$radio_bot_id')"; $db->sql_query($sql); } */ } function drop_shotcast_users($period) { global $shotcast_config, $db, $lang; $current_time = date("U"); //prevent delay $period = $period + 2; // Calcul max_time $max_time = $current_time - $period; $sql = "DELETE FROM " . SHOTCAST_SESSION_TABLE . " WHERE time < {$max_time}"; if(!$result = $db->sql_query($sql)) { mx_message_die(CRITICAL_ERROR, 'SQL Error in function drop_shotcast_users()', '', __LINE__, __FILE__, $sql); } } /* /* MX-CMS Code Ends */ //require($module_root_path . 'includes/config.'.$phpEx); /*************************************************************************** * *********************** SET UP VARIABLES HERE ****************************/ // // Generic config parameters // // Radio Station Name here $station_name = strip_tags($shotcast_config['shotcast_name']) ; //Radio Station Offline // IP address (e.g. kdshfm.com) $caster_ip = $shotcast_config['shotcast_host']; // Port for the caster (e.g. 7000) Leave blank if u don't know what your doing. $caster_port = (int) $shotcast_config['shotcast_port']; // SHOUTcast Password $caster_pass = $shotcast_config['shotcast_pass']; // Caster type: shout or ice $caster = $shotcast_config['caster']; // What skin to use $radio_skin = $shotcast_config['skin']; // What language to use $language = $default_lang; // If Stream should start automatic when player is loaded $autoplay = $shotcast_config['allow_autoplay']; // // Icecast config parameters // // If icecast is used with mount points else leave blank (e.g. /livemp3) $icecast_mount_point = $shotcast_config['play_mount']; // .pls type play list (e.g. listen.pls , livemp3) $playlist_pls = $shotcast_config['play_list']; //$playlist_pls = "livemp3"; // .asx type play list. Looks like u need an asx type of play list for wmp if // u run Icecast (e.g. livemp3) $playlist_asx = $shotcast_config['play_asx']; // IP address of the server where the play lists are located. Leave blank if // they are on the same server as the caster ip. $playlist_ip = $shotcast_config['play_host']; // Port of the server where the play lists are located. Leave blank if they // are on the same server as the caster ip. $playlist_port = (int) trim($portal_config['play_port']); //If other then port 80 where the play lists are located. Leave blank if they $server_port = ($portal_config['server_port'] <> 80) ? ':' . (int) trim($portal_config['server_port']) . '/' : '/'; // // Logo config parameters // // Logo should be put in the root of "/logos". U can use any format tha works // on the web (jpeg, gif, png...) // What do u want to use? CD-cover, equliazer, logo (cover, eq, logo) $picture = $shotcast_config['picture_type']; // Fallback if no cover is found (eq/logo) $fallback = $shotcast_config['fallback']; // The filename of the logo u want to use $logo_name = $shotcast_config['logo']; //logo.gif = $images['mx_logo'] // Fallback URL to use when no cover is found. Leave blank if they // are on the same server as the caster ip. $caster_url = ""; /************************* DO NOT EDIT BELOW THIS LINE *********************/ /************************ IF U DON'T KNOW WHAT U ARE DOING *****************/ // // Advanced config parameters // // Use Curl to get cd cover data (yes/no) $curl = $shotcast_config['use_curl']; // If both web server and icecast are behind a router and the web server needs // to know the internal ip of caster so it can pull the info for the player. // This could be the case if all three got different internal ip-s. $caster_internal_ip = $shotcast_config['cast_ip']; $caster_internal_port = $shotcast_config['cast_port']; // Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection $cookie_secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; //Server protocol if we use cookies $protocol_type = ($cookie_secure) ? 'https' : 'http'; $server_protocol = $protocol_type.'://'; // Fallback URL to use when no cover is found. Edit above. $no_cover_url = (empty($caster_url)) ? $server_protocol.$caster_ip . (($caster_port != 80) ? ":".$caster_port : "") : $caster_url; $full_logo_url = PORTAL_URL . 'templates/' . $theme['template_name'] . '/images/'.$logo_name; // Easier java debug messages (yes/no). $java_debug = $shotcast_config['show_debug']; /************************* DO NOT EDIT BELOW THIS LINE *********************/ /***************************************************************************/ ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> --- NEW FILE: config_shout.php --- <?php /*************************************************************************** * *********************** SET UP VARIABLES HERE ****************************/ // // Generic config parameters // // Radio Station Name here $station_name = "Radio Station Offline"; // IP address (e.g. kdshfm.com) $caster_ip = ""; // Port for the caster (e.g. 7000) Leave blank if u don't know what your doing. $caster_port = ""; // Caster type: shout or ice $caster = "shout"; // What skin to use $radio_skin = "default"; // What language to use $language = "english"; // If Stream should start automatic when player is loaded $autoplay = true; // // Icecast config parameters // // If icecast is used with mount points else leave blank (e.g. /livemp3) $icecast_mount_point = ""; // .pls type play list (e.g. listen.pls , livemp3) $playlist_pls = "listen.pls"; //$playlist_pls = "livemp3"; // .asx type play list. Looks like u need an asx type of play list for wmp if // u run Icecast (e.g. livemp3) $playlist_asx = ""; // IP address of the server where the play lists are located. Leave blank if // they are on the same server as the caster ip. $playlist_ip = ""; // Port of the server where the play lists are located. Leave blank if they // are on the same server as the caster ip. $playlist_port = ""; //Secure cookies on the site were the playlist(s) is located ? $cookie_secure = false; //If other then port 80 where the play lists are located. Leave blank if they $server_port = ''; // // Logo config parameters // // Logo should be put in the root of "/logos". U can use any format tha works // on the web (jpeg, gif, png...) // What do u want to use? CD-cover, equliazer, logo (cover, eq, logo) $picture = "cover"; // Fallback if no cover is found (eq/logo) $fallback = "eq"; // The filename of the logo u want to use $logo_name = "logo.gif"; // Fallback URL to use when no cover is found. Leave blank if they // are on the same server as the caster ip. $caster_url = ""; /************************* DO NOT EDIT BELOW THIS LINE *********************/ /************************ IF U DON'T KNOW WHAT U ARE DOING *****************/ // // Advanced config parameters // // Use Curl to get cd cover data (yes/no) $curl = "no"; // If both web server and icecast are behind a router and the web server needs // to know the internal ip of caster so it can pull the info for the player. // This could be the case if all three got different internal ip-s. $caster_internal_ip = ""; $caster_internal_port = ""; //Server protocol if we use cookies $server_protocol = ($cookie_secure) ? 'https://' : 'http://'; // Fallback URL to use when no cover is found. Edit above. $no_cover_url = (empty($caster_url)) ? $server_protocol.$caster_ip . (($caster_port != 80) ? ":".$caster_port : "") : $caster_url; $full_logo_url = ""; // Easier java debug messages (yes/no). $java_debug = "no"; /************************* DO NOT EDIT BELOW THIS LINE *********************/ /***************************************************************************/ ?> |