Thread: [Easymod-cvs] easymod2/mods/easymod easymod_display_functions.php,1.14,1.15 easymod_install.php,1.20
Status: Beta
Brought to you by:
wgeric
|
From: Eric F. <wg...@us...> - 2005-06-21 18:11:42
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10586/mods/easymod Modified Files: easymod_display_functions.php easymod_install.php Log Message: fixing language select bugs Index: easymod_display_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_display_functions.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** easymod_display_functions.php 20 Jun 2005 22:53:15 -0000 1.14 --- easymod_display_functions.php 21 Jun 2005 18:11:33 -0000 1.15 *************** *** 366,370 **** // Pick a language, any language ... // ! function em_language_select($default, $select_name="language", $dirname="admin/mods/easymod/language") { global $phpEx, $phpbb_root_path; --- 366,370 ---- // Pick a language, any language ... // ! function em_language_select($default, $select_name='language', $dirname='admin/mods/easymod/languages') { global $phpEx, $phpbb_root_path; *************** *** 1016,1018 **** ! ?> \ No newline at end of file --- 1016,1018 ---- ! ?> Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** easymod_install.php 20 Jun 2005 22:53:15 -0000 1.20 --- easymod_install.php 21 Jun 2005 18:11:33 -0000 1.21 *************** *** 45,134 **** include($phpbb_root_path . 'extension.inc'); ! include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); include( $phpbb_root_path . $script_path . 'em_includes/em_ftp.'.$phpEx); include( $phpbb_root_path . $script_path . 'em_includes/em_modio.'.$phpEx); include( $phpbb_root_path . $script_path . 'em_includes/em_functions.'.$phpEx); - include( $phpbb_root_path . $script_path . 'easymod_display_functions.'.$phpEx); // - // Start session management - // - $userdata = session_pagestart($user_ip, PAGE_POSTING); - init_userprefs($userdata); - // - // End session management - // - - - - // // set teh language (typo intentional ;-) ) // - - // include the lang file $lang = array(); ! if(isset($HTTP_GET_VARS['language']) || isset($HTTP_POST_VARS['language'])) { ! $language = (isset($HTTP_POST_VARS['language'])) ? htmlspecialchars($HTTP_POST_VARS['language']) : htmlspecialchars($HTTP_GET_VARS['language']); } else { ! $dirname="admin/mods/easymod/language"; ! $dir = opendir($phpbb_root_path . $dirname); ! $EM_lang = array(); ! while ( $file = readdir($dir) ) { ! if (preg_match('#^lang_easymod_#i', $file) && is_file(@phpbb_realpath($phpbb_root_path . $dirname . '/' . $file)) && !is_link(@phpbb_realpath($phpbb_root_path . $dirname . '/' . $file))) ! { ! $filecode = substr($file, 13, strpos($file, '.')-13); ! include @phpbb_realpath($phpbb_root_path . $dirname . '/lang_easymod_' . $filecode . '.' .$phpEx); ! $displayname = $lang['EM_lang_name']; ! $EM_lang[$displayname] = $filecode; ! } } ! closedir($dir); - $language = (isset($userdata['user_lang'])) ? $userdata['user_lang'] : $board_config['default_lang']; - $language = (in_array($language, $EM_lang)) ? $language : 'english'; - } // remember the lang in case we hit an error that send us back to step 1 ! $hidden = "<input type=\"hidden\" name=\"language\" value=\"$language\">\n" ; // load the appropriate lang pack ! if ($language == 'english') ! { ! // make sure the lang file exists ! if (!file_exists($phpbb_root_path . $script_path . 'language/lang_easymod_english.'.$phpEx)) ! { ! // display error message (obviously we can't use the lang system for this error) ;-) ! echo "<b>CRITICAL ERROR:</b> the lang_easymod_english.$phpEx file could not be found in the easymod/language directory. EasyMOD cannot be installed without this file present.\n" ; ! exit ; ! } ! ! include( $phpbb_root_path . $script_path . 'language/lang_easymod_english.'.$phpEx); ! } ! else { ! // make sure the lang file exists ! if (!file_exists($phpbb_root_path . $script_path . 'language/lang_easymod_'.$language.'.'.$phpEx)) ! { ! // display error message (obviously we can't use the lang system from this ;-) ! echo "<b>CRITICAL ERROR:</b> the lang_easymod_$language.$phpEx file could not be found in the easymod/language directory. EasyMOD cannot be installed without this file present.\n" ; ! exit ; ! } ! ! include( $phpbb_root_path . $script_path . 'language/lang_easymod_'.$language.'.'.$phpEx); } ! ! --- 45,112 ---- include($phpbb_root_path . 'extension.inc'); ! include($phpbb_root_path . 'config.'.$phpEx); ! include($phpbb_root_path . 'includes/constants.'.$phpEx); ! include($phpbb_root_path . 'includes/functions.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); + include($phpbb_root_path . 'includes/db.'.$phpEx); include( $phpbb_root_path . $script_path . 'em_includes/em_ftp.'.$phpEx); include( $phpbb_root_path . $script_path . 'em_includes/em_modio.'.$phpEx); include( $phpbb_root_path . $script_path . 'em_includes/em_functions.'.$phpEx); include( $phpbb_root_path . $script_path . 'easymod_display_functions.'.$phpEx); // // set teh language (typo intentional ;-) ) // $lang = array(); ! ! if(!empty($HTTP_GET_VARS['language']) || !empty($HTTP_POST_VARS['language'])) { ! $language = (!empty($HTTP_POST_VARS['language'])) ? htmlspecialchars($HTTP_POST_VARS['language']) : htmlspecialchars($HTTP_GET_VARS['language']); ! } ! else if ( !empty($HTTP_COOKIE_VARS['em_lang']) ) ! { ! $language = htmlspecialchars($HTTP_COOKIE_VARS['em_lang']); } else { ! $language = 'english'; ! } ! $dirname = $phpbb_root_path . $script_path . 'languages'; ! $dir = opendir($dirname); ! ! $EM_lang = array(); ! while ( $file = readdir($dir) ) ! { ! if (preg_match('#^lang_easymod_#i', $file) && is_file($dirname . '/' . $file) && !is_link($dirname . '/' . $file)) { ! $filecode = substr($file, 13, strpos($file, '.')-13); ! include $dirname . '/lang_easymod_' . $filecode . '.' .$phpEx; ! $displayname = $lang['EM_lang_name']; ! $EM_lang[$displayname] = $filecode; } + } ! closedir($dir); ! ! $language = (in_array($language, $EM_lang)) ? $language : 'english'; // remember the lang in case we hit an error that send us back to step 1 ! $hidden = '<input type="hidden" name="language" value="' . $language . "\">\n";; // load the appropriate lang pack ! if (!file_exists($phpbb_root_path . $script_path . 'languages/lang_easymod_'.$language.'.'.$phpEx)) { ! // display error message (obviously we can't use the lang system from this ;-) ! echo "<b>CRITICAL ERROR:</b> the lang_easymod_$language.$phpEx file could not be found in the easymod/language directory. EasyMOD cannot be installed without this file present.\n" ; ! exit ; } ! include( $phpbb_root_path . $script_path . 'languages/lang_easymod_'.$language.'.'.$phpEx); ! setcookie('em_lang', $language, time() + 360); *************** *** 671,675 **** ! $hidden = "<input type=\"hidden\" name=\"sel_read\" value=\"$read\">\n" ; $hidden .= "<input type=\"hidden\" name=\"sel_write\" value=\"$write\">\n" ; $hidden .= "<input type=\"hidden\" name=\"sel_move\" value=\"$move\">\n" ; --- 649,653 ---- ! $hidden .= "<input type=\"hidden\" name=\"sel_read\" value=\"$read\">\n" ; $hidden .= "<input type=\"hidden\" name=\"sel_write\" value=\"$write\">\n" ; $hidden .= "<input type=\"hidden\" name=\"sel_move\" value=\"$move\">\n" ; *************** *** 694,699 **** $hidden .= "<input type=\"hidden\" name=\"ftp_cache\" value=\"$ftp_cache\">\n" ; - $hidden .= "<input type=\"hidden\" name=\"language\" value=\"$language\">\n" ; - form_settings( $hidden, 3, $lang['EM_install_EM'], true) ; --- 672,675 ---- *************** *** 1689,1691 **** } ! ?> \ No newline at end of file --- 1665,1667 ---- } ! ?> |