|
From: OryNider <ory...@us...> - 2007-06-06 23:17:59
|
Update of /cvsroot/mxbb/mx_shotcast/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9956/admin Added Files: admin_shotcast.php Log Message: --- NEW FILE: admin_shotcast.php --- <?php /** * * @package mxBB Portal Module - mx_shotcast * @version $Id: admin_shotcast.php,v 1.1 2007/06/06 23:17:56 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_shotcast module * ***************************************************************************/ // ====================================================== // [ ADMINCP COMMON INITIALIZATION ] // ====================================================== // // Add our entry to the Administration Control Panel... // if( !empty($setmodules) ) { $module['shotcast']['Settings'] = 'modules/mx_shotcast/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 ".SHOTCAST_CONFIG_TABLE; if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't query shotcast 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 ".SHOTCAST_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 shotcast 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_listen_select_yes = ( $new['show_listen_select'] ) ? ' selected' : ''; $show_listen_select_no = ( !$new['show_listen_select'] ) ? ' selected' : ''; $template->set_filenames(array( "body" => "admin/shotcast_config_body.tpl") ); $template->assign_vars(array( 'S_ACTION' => append_sid("admin_shotcast.$phpEx"), 'L_SHOTCAST_SETTINGS' => $lang['shotcast_Settings'], 'L_SHOTCAST_SETTINGS_EXPLAIN' => $lang['shotcast_Settings_explain'], 'L_SHOTCAST' => $lang['Radio_name'], 'L_STREAM' => $lang['shotcast_host'], 'L_PORT' => $lang['shotcast_port'], 'L_PASS' => $lang['shotcast_pass'], 'L_PLAY_LIST' => $lang['play_list'], 'L_SHOW_STATUS' => $lang['Show_status'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_CHECK_PERIOD' => $lang['Check_period'], 'L_CHECK_PERIOD_EXPLAIN' => $lang['Check_period_explain'], 'L_SHOW_LISTEN' => $lang['show_listen'], 'L_SHOW_LISTEN_INFO' => $lang['show_listen_info'], "L_NO" => $lang['No'], "L_YES" => $lang['Yes'], 'STATION_HOST' => $new['shotcast_host'], 'STATION_NAME' => $new['shotcast_name'], 'STATION_PORT' => $new['shotcast_port'], 'STATION_PASS' => $new['shotcast_pass'], 'PLAY_LIST' => $new['play_list'], 'CHECK_PERIOD' => $new['check_period'], //GUI_SETTING 'USER_STATE_BUTTON' => $user_state_button, 'S_LISTEN_YES' => $show_listen_select_yes, 'S_LISTEN_NO' => $show_listen_select_no, 'SHOW_STATUS' => $show_status) ); $template->pparse("body"); unset($colors, $colors_options); include_once($mx_root_path . 'admin/page_footer_admin.' . $phpEx); ?> |