[Easymod-cvs] easymod2/mods/easymod easymod_display_functions.php,1.1,1.2 easymod_install.php,1.2,1.
Status: Beta
Brought to you by:
wgeric
From: Eric F. <wg...@us...> - 2005-04-27 22:12:50
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30776/mods/easymod Modified Files: easymod_display_functions.php easymod_install.php Log Message: - Fixed getcwd() returns blank bug. Hopefully I didn't break it - $phpbb_root_path and $script_path are used instead of hardcoding paths Index: easymod_display_functions.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_display_functions.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** easymod_display_functions.php 24 Apr 2005 14:59:52 -0000 1.1 --- easymod_display_functions.php 27 Apr 2005 22:12:39 -0000 1.2 *************** *** 116,123 **** $variables['TEXT'] = $text ; ! display_template( './templates/page_start.tpl', $variables) ; if (!$simple) { ! display_template( './templates/page_header.tpl', $variables) ; } } --- 116,123 ---- $variables['TEXT'] = $text ; ! display_template( $phpbb_root_path . $script_path . 'templates/page_start.tpl', $variables) ; if (!$simple) { ! display_template( $phpbb_root_path . $script_path . 'templates/page_header.tpl', $variables) ; } } *************** *** 142,146 **** $variables['DEBUG'] = $lang['EM_debug_display'] ; ! display_template( './templates/page_footer.tpl', $variables) ; } --- 142,146 ---- $variables['DEBUG'] = $lang['EM_debug_display'] ; ! display_template( $phpbb_root_path . $script_path . 'templates/page_footer.tpl', $variables) ; } *************** *** 153,157 **** $variables['HEIGHT'] = $height ; ! display_template( './templates/helpwin.tpl', $variables) ; } --- 153,157 ---- $variables['HEIGHT'] = $height ; ! display_template( $phpbb_root_path . $script_path . 'templates/helpwin.tpl', $variables) ; } *************** *** 169,173 **** $variables['RESCAN'] = (!$rescan) ? '' : '<input class="mainoption" type="submit" value="' . $lang['Rescan'] . '" name="rescan"/>' ; ! display_template( './templates/form_settings.tpl', $variables) ; } --- 169,173 ---- $variables['RESCAN'] = (!$rescan) ? '' : '<input class="mainoption" type="submit" value="' . $lang['Rescan'] . '" name="rescan"/>' ; ! display_template( $phpbb_root_path . $script_path . 'templates/form_settings.tpl', $variables) ; } *************** *** 179,183 **** // assign template data - // $variables = array() ; $variables['EM_debug_info'] = $lang['EM_debug_info'] ; $variables['EM_debug_format'] = $lang['EM_debug_format'] ; --- 179,182 ---- *************** *** 214,218 **** $variables['EM_VERSION'] = $easymod_install_version ; $variables['PHPBB_VERSION'] = get_phpbb_version() ; ! $variables['CWD'] = getcwd() ; $variables['STEP'] = $install_step ; $variables['MODE'] = $mode ; --- 213,217 ---- $variables['EM_VERSION'] = $easymod_install_version ; $variables['PHPBB_VERSION'] = get_phpbb_version() ; ! $variables['CWD'] = dirname(__FILE__); $variables['STEP'] = $install_step ; $variables['MODE'] = $mode ; *************** *** 229,233 **** $variables['FILE_LISTING'] = $values['file_listing'] ; ! display_template( './templates/display_debug.tpl', $variables) ; // check FTP compatiblity --- 228,232 ---- $variables['FILE_LISTING'] = $values['file_listing'] ; ! display_template( $phpbb_root_path . $script_path . 'templates/display_debug.tpl', $variables) ; // check FTP compatiblity *************** *** 245,249 **** } ! display_template( './templates/display_debug_footer.tpl', $variables) ; } --- 244,248 ---- } ! display_template( $phpbb_root_path . $script_path . 'templates/display_debug_footer.tpl', $variables) ; } *************** *** 285,289 **** $values['file_listing'] = '' ; ! if ($dh = opendir('./')) { while (($file = readdir($dh)) !== false) --- 284,288 ---- $values['file_listing'] = '' ; ! if ($dh = opendir(dirname(__FILE__))) { while (($file = readdir($dh)) !== false) *************** *** 308,312 **** $variables['ERROR'] = $error ; ! display_template( './templates/display_error.tpl', $variables) ; } --- 307,311 ---- $variables['ERROR'] = $error ; ! display_template( $phpbb_root_path . $script_path . 'templates/display_error.tpl', $variables) ; } *************** *** 569,591 **** function check_installablity() { ! global $db, $lang, $easymod_install_version ; // make sure we are in the correct directory ! $cwd = getcwd() ; $cwd = str_replace("\\", '/', $cwd) ; $dirs = explode('/', $cwd) ; $file_list = array() ; ! //// ! //// make sure EM is in the right directory ! //// ! // for some odd reason getcwd returns empty on some servers??? (added in 0.0.10a-2) ! if ($cwd == '') ! { ! // do nothing ! } ! ! // otherwise make sure we are in the correct directory for installation ! else if (($dirs[count($dirs)-3] != 'admin') || ($dirs[count($dirs)-2] != 'mods') || (strtolower($dirs[count($dirs)-1]) != 'easymod')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_install_dir'] ) ; --- 568,581 ---- function check_installablity() { ! global $db, $lang, $easymod_install_version, $phpbb_root_path; // make sure we are in the correct directory ! $cwd = dirname(__FILE__); $cwd = str_replace("\\", '/', $cwd) ; $dirs = explode('/', $cwd) ; $file_list = array() ; ! // check to make sure we are in the correct folder ! if (($dirs[count($dirs)-3] != 'admin') || ($dirs[count($dirs)-2] != 'mods') || (strtolower($dirs[count($dirs)-1]) != 'easymod')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_install_dir'] ) ; *************** *** 597,601 **** //// // make sure subsilver dir exists ! if (!file_exists('../../../templates/subSilver')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_no_subsilver'] ) ; --- 587,591 ---- //// // make sure subsilver dir exists ! if (!file_exists($phpbb_root_path . 'templates/subSilver')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_no_subsilver'] ) ; *************** *** 617,621 **** // make sure english exists ! if (!file_exists('../../../language/lang_english')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_no_english'] ) ; --- 607,611 ---- // make sure english exists ! if (!file_exists($phpbb_root_path . 'language/lang_english')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_no_english'] ) ; *************** *** 746,750 **** // assign template data ! $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; --- 736,740 ---- // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; *************** *** 770,774 **** // dispay the page and the footer ! display_template( './templates/step1_classic.tpl', $variables) ; page_footer() ; exit ; --- 760,764 ---- // dispay the page and the footer ! display_template( $phpbb_root_path . $script_path . 'templates/step1_classic.tpl', $variables) ; page_footer() ; exit ; *************** *** 802,806 **** // dispay the page and the footer ! display_template( './templates/step1_simple.tpl', $variables) ; page_footer() ; exit ; --- 792,796 ---- // dispay the page and the footer ! display_template( $phpbb_root_path . $script_path . 'templates/step1_simple.tpl', $variables) ; page_footer() ; exit ; *************** *** 863,867 **** // dispay the page and the footer ! display_template( './templates/step1b_simple.tpl', $variables) ; page_footer() ; exit ; --- 853,857 ---- // dispay the page and the footer ! display_template( $phpbb_root_path . $script_path . 'templates/step1b_simple.tpl', $variables) ; page_footer() ; exit ; *************** *** 883,887 **** // assign template data ! $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; --- 873,877 ---- // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; *************** *** 899,903 **** // dispay the page and the footer ! display_template( './templates/step1b_ftp.tpl', $variables) ; page_footer() ; exit ; --- 889,893 ---- // dispay the page and the footer ! display_template( $phpbb_root_path . $script_path . 'templates/step1b_ftp.tpl', $variables) ; page_footer() ; exit ; *************** *** 923,927 **** // assign template data ! $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; --- 913,917 ---- // assign template data ! $variables['U_FORM'] = $phpbb_root_path . $script_path . 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; *************** *** 947,951 **** // dispay the page and the footer ! display_template( './templates/step1c_empw.tpl', $variables) ; page_footer() ; exit ; --- 937,941 ---- // dispay the page and the footer ! display_template( $phpbb_root_path . $script_path . 'templates/step1c_empw.tpl', $variables) ; page_footer() ; exit ; Index: easymod_install.php =================================================================== RCS file: /cvsroot/easymod/easymod2/mods/easymod/easymod_install.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** easymod_install.php 26 Apr 2005 12:35:15 -0000 1.2 --- easymod_install.php 27 Apr 2005 22:12:39 -0000 1.3 *************** *** 22,26 **** define('IN_PHPBB', 1); $phpbb_root_path = './../../../'; ! $script_path = 'admin/mods/easymod' ; //// $easymod_install_version = '0.1.13' ; --- 22,26 ---- define('IN_PHPBB', 1); $phpbb_root_path = './../../../'; ! $script_path = 'admin/mods/easymod/' ; //// $easymod_install_version = '0.1.13' ; *************** *** 1768,1772 **** // added security starting in 0.0.11, blowfish encrypt the ftp_pass ! include($phpbb_root_path . $script_path . '/em_includes/em_cipher.php') ; $cipher = new Cipher_BlockMode_cbc(); $cipher->blowfish->setKey( $em_pass); --- 1768,1772 ---- // added security starting in 0.0.11, blowfish encrypt the ftp_pass ! include($phpbb_root_path . $script_path . 'em_includes/em_cipher.php') ; $cipher = new Cipher_BlockMode_cbc(); $cipher->blowfish->setKey( $em_pass); |