|
From: OryNider <ory...@us...> - 2008-01-31 10:22:43
|
Update of /cvsroot/mxbb/mx_counter/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22757/admin Modified Files: Tag: core28x admin_counter_cfg.php Log Message: upgrade for 2.8.1 Index: admin_counter_cfg.php =================================================================== RCS file: /cvsroot/mxbb/mx_counter/admin/admin_counter_cfg.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** admin_counter_cfg.php 6 Jun 2007 23:49:07 -0000 1.1 --- admin_counter_cfg.php 31 Jan 2008 10:22:34 -0000 1.1.2.1 *************** *** 16,19 **** --- 16,22 ---- + //Move this to the board lang_admin.php file if you need traslation. + $lang['Portal_Counter'] = !empty($lang['Portal_Counter']) ? $lang['Portal_Counter'] : 'Portal Counter'; + // // Add our entry to the Administration Control Panel... *************** *** 44,47 **** --- 47,54 ---- require($module_root_path . 'includes/counter_common.'.$phpEx); + // ====================================================== + // [ ADMINCP COMMON INITIALIZATION ] + // ====================================================== + // ********************************************************************** // Read language definition *************** *** 56,65 **** } - // - // Send page header... - // - include_once($mx_root_path . 'admin/page_header_admin.'.$phpEx); - - // ====================================================== // [ MAIN PROCESS ] --- 63,66 ---- *************** *** 80,97 **** $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 ".COUNTER_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 counter configuration for $config_name", "", __LINE__, __FILE__, $sql); } } } $digitpath = $default_config['digitpath']; $template->set_filenames(array( --- 81,101 ---- $default_config[$config_name] = $config_value; ! $new[$config_name] = ( isset($HTTP_POST_VARS[$config_name]) ) ? htmlspecialchars($HTTP_POST_VARS[$config_name]) : $default_config[$config_name]; if( isset($HTTP_POST_VARS['submit'])) { $sql = "UPDATE ".COUNTER_CONFIG_TABLE. " SET config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'" . ! " WHERE config_name = '" . str_replace("\'", "''", $config_name) . "'"; if( !$db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Failed to update counter configuration for $config_name", "", __LINE__, __FILE__, $sql); } + // Behave as per HTTP/1.1 spec for others + echo '"<meta http-equiv="refresh" content="1;url="$file">"'; } } $digitpath = $default_config['digitpath']; + $digits = intval($default_config['digits']); $template->set_filenames(array( *************** *** 99,105 **** ); ! for($i=0;$i<=$default_config['digits'];$i++) { ! $digit_image = '<img src=' . $module_root_path . 'numbers/' . $digitpath . '/' . $i . '.gif>'; $template->assign_block_vars('digitpreview', array('DIGIT_IMAGE' => $digit_image)); --- 103,109 ---- ); ! for($i=0;$i<$digits;$i++) { ! $digit_image = '<img alt="' . $i . '" src="' . $module_root_path . 'numbers/' . $digitpath . '/' . $i . '.gif" />'; $template->assign_block_vars('digitpreview', array('DIGIT_IMAGE' => $digit_image)); *************** *** 110,147 **** $direct = opendir($dir); ! $file = readdir($direct); ! ! while ($file) { ! $file = readdir($direct); ! $filetype = filetype($dir . $file); ! ! if ($file == ".." OR $file == "." OR $file == "") ! { ! $pagelist_digitpath = ""; ! } ! elseif ($filetype == "dir") ! { ! $pagelist_digitpath = "<OPTION value=\"$file\" > $file \n"; ! } ! ! $array = "$array;$file"; ! $template->assign_block_vars('digitpagelist', array('DIGITPATH' => $pagelist_digitpath)); ! ! } $s_hidden_fields = '<input type="hidden" name="config_name" value="' . htmlspecialchars($new[$config_name]) . '" />'; - - $template->assign_vars(array( ! 'S_ACTION' => append_sid("admin_counter_cfg.$phpEx"), 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'L_COUNTER_SETTINGS' => $lang['Counter_Settings'], ! 'L_COUNTER_SETTINGS_EXPLAIN' => $lang['Counter_Settings_explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_DIGITS' => $lang['digits'], 'L_DIGITPATH' => $lang['digitpath'], 'L_DIGITPREVIEW' => $lang['digitpreview'], --- 114,140 ---- $direct = opendir($dir); ! while (false !== ($file = readdir($direct))) ! { ! if (!is_dir($dir . $file) || $file == '..' || $file == '.' || $file == '') { ! continue; ! } ! ! $template->assign_block_vars('digitpagelist', array('DIGITPATH' => "<option value=\"$file\">$file</option>\n")); ! } ! closedir($direct); $s_hidden_fields = '<input type="hidden" name="config_name" value="' . htmlspecialchars($new[$config_name]) . '" />'; $template->assign_vars(array( ! 'S_ACTION' => mx_append_sid("admin_counter_cfg.$phpEx"), 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'L_COUNTER_SETTINGS' => $lang['Counter_Settings'], ! 'L_COUNTER_SETTINGS_EXPLAIN' => $lang['Counter_Settings_explain'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_DIGITS' => $lang['digits'], 'L_DIGITPATH' => $lang['digitpath'], + 'L_DIGITPATH_EXPLAIN' => $lang['digitpath_explain'], 'L_DIGITPREVIEW' => $lang['digitpreview'], *************** *** 152,156 **** $template->pparse("body"); ! include_once($mx_root_path . 'admin/page_footer_admin.' . $phpEx); ?> --- 145,149 ---- $template->pparse("body"); ! include_once($phpbb_root_path . 'admin/page_footer_admin.' . $phpEx); ?> |