|
From: Selven <sel...@us...> - 2007-06-21 18:21:16
|
Update of /cvsroot/mxbb/mx_shoutbox/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27703/admin Added Files: admin_mx_shoutbox.php index.html Log Message: First Upload --- NEW FILE: index.html --- --- NEW FILE: admin_mx_shoutbox.php --- <?php // ------------------------------------------------------------- // // // FILENAME : admin_mx_shoutobx.php // COPYRIGHT : © 2002, 2003 apegaming.net // WWW : http://www.blame-the-french.com.com/ // LICENCE : GPL vs2.0 [ see /docs/COPYING ] // // ------------------------------------------------------------- if( !empty($setmodules) ) { $module['Shoutbox']['Configuration'] = 'modules/mx_shoutbox/admin/' . @basename(__FILE__); return; } define('IN_PORTAL', true); $mx_root_path = '../../../'; $module_root_path = '../'; require( $mx_root_path . 'admin/pagestart.php'); include( $module_root_path . 'includes/constants.'.$phpEx ); include( $mx_root_path . 'admin/page_header_admin.'.$phpEx ); // // Get language // if ( !file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_admin.'.$phpEx ); } else { include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.'.$phpEx ); } // // Pull all config data // $sql = "SELECT * FROM " . SHOUTBOX_CONFIG_TABLE; if(!$result = $db->sql_query($sql)) { mx_message_die(CRITICAL_ERROR, 'Could not query config information in mx shoutbox', '', __LINE__, __FILE__, $sql); } else { 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 " . SHOUTBOX_CONFIG_TABLE . " SET config_value = '" . str_replace("\'", "''", $new[$config_name]) . "' WHERE config_name = '$config_name'"; if( !$db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Failed to update mx shoutbox configuration for $config_name', '', __LINE__, __FILE__, $sql); } } } if( isset($HTTP_POST_VARS['submit']) ) { $message = $lang['shout_config_updated'] . '<br /><br />' . sprintf($lang['Click_return_shout_config'], '<a href="' . append_sid( PORTAL_URL . 'modules/mx_shoutbox/admin/admin_mx_shoutbox.'.$phpEx ) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid( PORTAL_URL . 'admin/index.'.$phpEx.'?pane=right' ) . '">', '</a>'); mx_message_die(GENERAL_MESSAGE, $message); } } $allow_guest_yes = ( $new['allow_guest'] ) ? 'checked="checked"' : ''; $allow_guest_no = ( !$new['allow_guest'] ) ? 'checked="checked"' : ''; $allow_member_del_yes = ( $new['allow_member_del'] ) ? 'checked="checked"' : ''; $allow_member_del_no = ( !$new['allow_member_del'] ) ? 'checked="checked"' : ''; $allow_member_edit_yes = ( $new['allow_member_edit'] ) ? 'checked="checked"' : ''; $allow_member_edit_no = ( !$new['allow_member_edit'] ) ? 'checked="checked"' : ''; $allow_bbcode_yes = ( $new['allow_bbcode'] ) ? 'checked="checked"' : ''; $allow_bbcode_no = ( !$new['allow_bbcode'] ) ? 'checked="checked"' : ''; $fixed_height_yes = ( $new['static_box'] ) ? 'checked="checked"' : ''; $fixed_height_no = ( !$new['static_box'] ) ? 'checked="checked"' : ''; // // Start output // $template->set_filenames(array( 'admin_shoutbox' => 'admin/mx_shoutbox_admin.tpl' )); $template->assign_vars(array( 'S_FORUM_ACTION' => append_sid( PORTAL_URL . 'modules/mx_shoutbox/admin/admin_mx_shoutbox.'.$phpEx), 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_SHOUT_CONFIG' => $lang['Shout_config'], 'L_SHOUT_CONFIG_EXPLAIN' => $lang['Shout_config_explain'], 'L_SHOUTBOX_SETTINGS' => $lang['Shout_settings'], 'L_LIST_INDEX' => $lang['Shout_list_index'], 'L_LIST_INDEX_EXPLAIN' => $lang['Shout_list_index_explain'], 'L_SHOUT_SIZE' => $lang['Shout_size'], 'L_SHOUT_SIZE_EXPLAIN' => $lang['Shout_size_explain'], 'L_ALLOW_GUEST' => $lang['Shout_allow_guest'], 'L_ALLOW_GUEST_EXPLAIN' => $lang['Shout_allow_guest_explain'], 'L_ALLOW_MEMBER_DEL' => $lang['Shout_allow_member_del'], 'L_ALLOW_MEMBER_DEL_EXPLAIN' => $lang['Shout_allow_member_del_explain'], 'L_ALLOW_MEMBER_EDIT' => $lang['Shout_allow_member_edit'], 'L_ALLOW_MEMBER_EDIT_EXPLAIN' => $lang['Shout_allow_member_edit_explain'], 'L_ALLOW_BBCODE' => $lang['Shout_allow_bbcode'], 'L_ALLOW_BBCODE_EXPLAIN' => $lang['Shout_allow_bbcode_explain'], 'L_ALLOW_SPAN' => $lang['Shout_allow_span'], 'L_ALLOW_SPAN_EXPLAIN' => $lang['Shout_allow_span'], 'L_STATIC_BOX' => $lang['Shout_fixed_height'], 'L_STATIC_BOX_EXPLAIN' => $lang['Shout_fixed_height_explain'], 'L_STATIC_BOX_SIZE' => $lang['Shout_box_height'], 'L_STATIC_BOX_SIZE_EXPLAIN' => $lang['Shout_box_height_explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'LIST_INDEX' => $new['list_index'], 'GUEST_YES' => $allow_guest_yes, 'GUEST_NO' => $allow_guest_no, 'MEMBER_YES' => $allow_member_del_yes, 'MEMBER_EDIT_YES' => $allow_member_edit_yes, 'MEMBER_EDIT_NO' => $allow_member_edit_no, 'MEMBER_NO' => $allow_member_del_no, 'BBCODE_YES' => $allow_bbcode_yes, 'BBCODE_NO' => $allow_bbcode_no, 'STATIC_YES' => $fixed_height_yes, 'STATIC_NO' => $fixed_height_no, 'SPAN_YES' => $allow_span_yes, 'SPAN_NO' => $allow_span_no, 'SHOUT_SIZE' => $new['shout_size'], 'STATIC_HEIGHT' => $new['static_box_height'] ) ); $template->pparse('admin_shoutbox'); include_once( $mx_root_path . 'admin/page_footer_admin.'.$phpEx); ?> |