|
From: OryNider <ory...@us...> - 2007-06-06 23:31:10
|
Update of /cvsroot/mxbb/mx_radio/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19138/admin Added Files: admin_radio.php Log Message: --- NEW FILE: admin_radio.php --- <?php /** * * @package mxBB Portal Module - mx_radio * @version $Id: admin_radio.php,v 1.1 2007/06/06 23:30:52 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ /*************************************************************************** * History: * * 2006/09/21 * - Modified from admin_chatbox.php by OryNider for mx_radio module * ***************************************************************************/ // ====================================================== // [ ADMINCP COMMON INITIALIZATION ] // ====================================================== // // Add our entry to the Administration Control Panel... // if( !empty($setmodules) ) { $module['Media Radio']['Settings'] = 'modules/mx_radio/admin/' . @basename(__FILE__); return; } // // Setup basic portal stuff... // define('IN_PORTAL', true); $mx_root_path = '../../../'; $module_root_path = "../"; // // Security and page header... // // require($mx_root_path . 'extension.inc'); $phpEx = substr(strrchr(__FILE__, '.'), 1); require($mx_root_path . '/admin/pagestart.'.$phpEx); // // Include common module stuff... // require($module_root_path . 'includes/common.'.$phpEx); // // Send page header... // include_once($mx_root_path . 'admin/page_header_admin.'.$phpEx); // ====================================================== // [ MAIN PROCESS ] // ====================================================== // // Read the module settings... // $sql = "SELECT * FROM ".RADIO_CONFIG_TABLE; if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't query radio config table", "", __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $config_name = $row['config_name']; $config_value = $row['config_value']; $default_config[$config_name] = $config_value; $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name]; if( isset($HTTP_POST_VARS['submit'])) { $sql = "UPDATE ".RADIO_CONFIG_TABLE. " SET config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'" . " WHERE config_name = '$config_name'"; if( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Failed to update radio configuration for $config_name", "", __LINE__, __FILE__, $sql); } } } //Show status? if ($new['show_status']=="true") { $show_status="<select name=\"show_status\" size=1><option value=\"true\" selected>on<option value=\"false\">off</select>"; } else { $show_status="<select name=\"show_status\" size=1><option value=\"true\">on<option value=\"false\" selected>off</select>"; } //Show stationslist? if ($new['show_stations']=="true") { $show_stations="<select name=\"show_stations\" size=1><option value=\"true\" selected>on<option value=\"false\">off</select>"; } else { $show_stations="<select name=\"show_stations\" size=1><option value=\"true\">on<option value=\"false\" selected>off</select>"; } $gf_select_yes = ( $new['gf_select'] ) ? ' selected' : ''; $gf_select_no = ( !$new['gf_select'] ) ? ' selected' : ''; $template->set_filenames(array( "body" => "admin/radio_config_body.tpl") ); $template->assign_vars(array( 'S_ACTION' => append_sid("admin_radio.$phpEx"), 'L_RADIO_SETTINGS' => $lang['radio_Settings'], 'L_RADIO_SETTINGS_EXPLAIN' => $lang['radio_Settings_explain'], 'L_RADIO' => $lang['Radio_name'], 'L_STREAM' => $lang['Station_stream'], 'L_FLASH' => $lang['Flash_file'], 'L_GATEWAY' => $lang['Gateway_file'], 'L_SHOW_STATUS' => $lang['Show_status'], 'L_SHOW_STATIONS' => $lang['Show_stations'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_GF' => $lang['flash_gateway'], 'L_GF_INFO' => $lang['flash_gateway_info'], 'L_FLASH' => $lang['Flash_mode'], 'L_GATEWAY' => $lang['Gateway_mode'], 'L_CHECK_PERIOD' => $lang['Check_period'], 'L_CHECK_PERIOD_EXPLAIN' => $lang['Check_period_explain'], 'RADIO_NAME' => $new['radio_name'], 'STATION_STREAM' => $new['radio_FileName'], 'FLASH_FILE_URL' => $new['flash_FileName'], 'GATEWAY_FILE_URL' => $new['gateway_FileName'], 'CHECK_PERIOD' => $new['check_period'], //GUI_SETTING 'USER_STATE_BUTTON' => $user_state_button, 'SHOW_STATIONS' => $show_stations, 'S_FLASH_YES' => $gf_select_yes, 'S_GATEWAY_YES' => $gf_select_no, 'SHOW_STATUS' => $show_status) ); $template->pparse("body"); unset($colors, $colors_options); include_once($mx_root_path . 'admin/page_footer_admin.' . $phpEx); ?> |