[Easymod-cvs] easymod2/mods/easymod easymod_install.php,1.39,1.40
Status: Beta
Brought to you by:
wgeric
From: Markus P. <mar...@us...> - 2005-11-05 22:55:38
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4952/mods/easymod Modified Files: easymod_install.php Log Message: Fixed the first issue reported via PM by Nux. Keep them coming ;-) Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** easymod_install.php 5 Nov 2005 22:28:21 -0000 1.39 --- easymod_install.php 5 Nov 2005 22:55:27 -0000 1.40 *************** *** 58,61 **** --- 58,64 ---- //// + // Enable debug helpers? + define('EM_DEBUG_AID', 1); + if( !@file_exists($phpbb_root_path . $script_path . 'em_includes/em_ftp.'.$phpEx) ) { *************** *** 73,91 **** // set teh language (typo intentional ;-) ) // ! $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); if( !empty($HTTP_GET_VARS['language']) || !empty($HTTP_POST_VARS['language']) ) --- 76,80 ---- // set teh language (typo intentional ;-) ) // ! $EM_lang = _em_get_install_languages(); if( !empty($HTTP_GET_VARS['language']) || !empty($HTTP_POST_VARS['language']) ) *************** *** 122,126 **** // - function wrapper_find(&$file_list, &$find_array, $search_array) { --- 111,114 ---- *************** *** 191,194 **** --- 179,208 ---- } + function _em_get_install_languages() + { + // do not declare $lang as global here, or else will be unset ;-) + global $phpbb_root_path, $script_path, $phpEx; + + $dirname = $phpbb_root_path . $script_path . 'languages'; + $dir = @opendir($dirname); + + $EM_lang = array(); + while( $file = @readdir($dir) ) + { + if( preg_match("#^lang_easymod_(.*)\.$phpEx#i", $file, $match) ) + { + $filecode = $match[1]; + $lang = array(); + include($dirname . '/lang_easymod_' . $filecode . '.' .$phpEx); + $displayname = $lang['EM_lang_name']; + $EM_lang[$displayname] = $filecode; + unset($lang); + } + } + @closedir($dir); + + return $EM_lang; + } + |