[Easymod-cvs] easymod2/mods/easymod easymod.gif,NONE,1.1 easymod_display_functions.php,NONE,1.1 easy
Status: Beta
Brought to you by:
wgeric
From: Brendan K. <bk...@us...> - 2005-04-24 15:00:02
|
Update of /cvsroot/easymod/easymod2/mods/easymod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13181/mods/easymod Added Files: easymod.gif easymod_display_functions.php easymod_install.php lang_easymod.php Log Message: Just checking in a vanilla 0.1.13. Work shall commence soon :) --- NEW FILE: easymod_display_functions.php --- <?php /*************************************************************************** * easymod_display_functions.php * ------------------------------- * begin : Wednesday, November 26, 2003 * copyright : (C) 2002-2004 by Nuttzy - Craig Nuttall * email : nu...@bl... * * $Id: easymod_display_functions.php,v 1.1 2005/04/24 14:59:52 bkettle Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ // --------- // FUNCTIONS // // my own cheese-o-matic template system // anthing within {{}} is a template variable // anything within {{[]}} is an include tpl to be further processed // error handling is completely lacking so don't use this outside of EM ;-) function display_template( $template_file, $variables) { // make sure the tpl file exists if (!file_exists( $template_file)) { echo "<h1><span class=\"ok\">A required file [$template_file] is missing. Aborting install.</span></h1>\n" ; exit ; } // open the template file for readin $template = fopen( $template_file, 'r') ; // look through the file, displaying each line to the screen while (!feof( $template)) { // get a line from the file $line = fgets( $template, 4096) ; // see if there is a template variable on this line $prev_endpos = 0 ; $pos = strpos( $line, '{{')+2 ; $endpos = (strlen($line) > 2 ) ? strpos( $line, '}}', $pos)-1 : $pos ; // for some reason I couldn't get strpos to work correctly for me (even using === syntax) $start_var = (substr( $line, 0, 2) == '{{') ? true : false ; // if we found a varibale, then fill it in and see if there are more on this line as well; // pos will always be at least 2; if so then this means we either have no variable, or a variable starting // at the beginning of the line if (($pos > 2) || ($start_var)) { // check the entire line until we don't find more vars while (($pos > 2) || ($start_var)) { // display the line up to and including the variable $start_var = false ; $var = substr($line, $pos, $endpos-$pos+1) ; // see if this is an included file (will start with [ and stop with ]) if ((substr($var, 0, 1) == '[') && (substr($var, strlen($var)-1, 1) == ']')) { // print the portion of the line up to this point echo substr( $line, $prev_endpos, (($pos-2)-$prev_endpos)) ; // welcome to the wonderful world of recursion :D display_template( substr($var, 1, strlen($var)-2), $variables) ; } // a normal variable else { $display_var = (isset($variables[$var])) ? $variables[$var] : '' ; echo substr( $line, $prev_endpos, (($pos-2)-$prev_endpos)) . $display_var ; } // get the next variable, if there is one $prev_endpos = $endpos+3 ; $pos = strpos( $line, '{{', $prev_endpos)+2 ; $endpos = strpos( $line, '}}', $pos)-1 ; } // display the rest of the line echo substr( $line, $prev_endpos) ; } // no template variable on this line, so just right it out else { echo $line ; } } // clean up ;-) fclose( $template) ; } // write the top of the page function page_header( $text, $simple=false) { global $lang, $easymod_install_version; $variables = array() ; $variables['TITLE'] = "Installing EasyMOD beta 1 ($easymod_install_version)" ; // hard coded $variables['BY'] = 'by Nuttzy' ; // hard coded $variables['TEXT'] = $text ; display_template( './templates/page_start.tpl', $variables) ; if (!$simple) { display_template( './templates/page_header.tpl', $variables) ; } } // write the footer HTML function page_footer() { global $install_step, $write, $move, $ftp_dir, $ftp_user, $ftp_pass, $ftp_host, $ftp_debug, $ftp_type, $lang, $phpEx ; ///////////////////////// ///////////////////////// ///////////////////////// what about ? and & ???? - i really think there is a better way to do this ///////////////////////// ///////////////////////// // we have to fix the password so it does not have a # in it or else the link won't work $ftp_pass = str_replace('#', '~pound~', $ftp_pass) ; $link = "easymod_install.$phpEx?mode=debug&install_step=$install_step&write=$write&move=$move&ftp_dir=$ftp_dir&ftp_user=$ftp_user&ftp_pass=$ftp_pass&ftp_host=$ftp_host&ftp_debug=$ftp_debug&ftp_type=$ftp_type" ; $variables = array() ; $variables['LINK'] = $link ; $variables['DEBUG'] = $lang['EM_debug_display'] ; display_template( './templates/page_footer.tpl', $variables) ; } // allow for the ability to pop open a sub window function helpwin( $width=400, $height=200) { $variables = array() ; $variables['WIDTH'] = $width ; $variables['HEIGHT'] = $height ; display_template( './templates/helpwin.tpl', $variables) ; } // the files access and ftp data form function form_settings( $hidden, $step, $main_button, $rescan) { global $phpEx, $lang ; $variables = array() ; $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['STEP'] = $step ; $variables['HIDDEN'] = $hidden ; $variables['MAIN'] = ($main_button == '') ? '' : '<input class="mainoption" type="submit" value="' . "$main_button\" /> " ; $variables['RESCAN'] = (!$rescan) ? '' : '<input class="mainoption" type="submit" value="' . $lang['Rescan'] . '" name="rescan"/>' ; display_template( './templates/form_settings.tpl', $variables) ; } // neatly format the debug info we've gathered function display_debug_html( $variables, $access, $values) { global $lang, $easymod_install_version, $install_step, $mode, $write, $move, $ftp_user, $ftp_pass, $ftp_host, $ftp_dir, $ftp_debug, $ftp_type, $ftp_cache ; // assign template data // $variables = array() ; $variables['EM_debug_info'] = $lang['EM_debug_info'] ; $variables['EM_debug_format'] = $lang['EM_debug_format'] ; $variables['EM_debug_installer'] = $lang['EM_debug_installer'] ; $variables['EM_phpBB_version'] = $lang['EM_phpBB_version'] ; $variables['EM_debug_work_dir'] = $lang['EM_debug_work_dir'] ; $variables['EM_debug_step'] = $lang['EM_debug_step'] ; $variables['EM_debug_mode'] = $lang['EM_debug_mode'] ; $variables['EM_debug_the_error'] = $lang['EM_debug_the_error'] ; $variables['EM_debug_permissions'] = $lang['EM_debug_permissions'] ; $variables['EM_debug_sys_errors'] = $lang['EM_debug_sys_errors'] ; $variables['EM_read_access'] = $lang['EM_read_access'] ; $variables['EM_write_access'] = $lang['EM_write_access'] ; $variables['EM_root_write'] = $lang['EM_root_write'] ; $variables['EM_chmod_access'] = $lang['EM_chmod_access'] ; $variables['EM_unlink_access'] = $lang['EM_unlink_access'] ; $variables['EM_mkdir_access'] = $lang['EM_mkdir_access'] ; $variables['EM_tmp_write'] = $lang['EM_tmp_write'] ; $variables['EM_ftp_ext'] = $lang['EM_ftp_ext'] ; $variables['EM_copy_access'] = $lang['EM_copy_access'] ; $variables['EM_debug_recommend'] = $lang['EM_debug_recommend'] ; $variables['EM_debug_write'] = $lang['EM_debug_write'] ; $variables['EM_debug_move'] = $lang['EM_debug_move'] ; $variables['EM_debug_selected'] = $lang['EM_debug_selected'] ; $variables['EM_debug_write'] = $lang['EM_debug_write'] ; $variables['EM_debug_move'] = $lang['EM_debug_move'] ; $variables['EM_debug_ftp_dir'] = $lang['EM_debug_ftp_dir'] ; $variables['EM_debug_ftp_host'] = 'ftp host' ; $variables['EM_debug_ftp_debug'] = $lang['EM_debug_ftp_debug'] ; $variables['EM_debug_ftp_ext'] = $lang['EM_debug_ftp_ext'] ; $variables['EM_debug_ftp_cache'] = 'ftp cache' ; $variables['EM_debug_listing'] = $lang['EM_debug_listing'] ; $variables['EM_VERSION'] = $easymod_install_version ; $variables['PHPBB_VERSION'] = get_phpbb_version() ; $variables['CWD'] = getcwd() ; $variables['STEP'] = $install_step ; $variables['MODE'] = $mode ; $variables['ERROR'] = $values['error'] ; $variables['WRITE_REC'] = $values['write_rec'] ; $variables['MOVE_REC'] = $values['move_rec'] ; $variables['WRITE_SEL'] = $write ; $variables['MOVE_SEL'] = $move ; $variables['FTP_DIR'] = $ftp_dir ; $variables['FTP_HOST'] = $ftp_host ; $variables['FTP_DEBUG'] = ($ftp_debug) ? 'true' : 'false' ; $variables['FTP_EXT'] = $ftp_type ; $variables['FTP_CACHE'] = ($ftp_cache) ? 'true' : 'false' ; $variables['FILE_LISTING'] = $values['file_listing'] ; display_template( './templates/display_debug.tpl', $variables) ; // check FTP compatiblity if (( $write == 'ftpb') || ($move == 'ftpa')) { // test the ftp connection if (test_ftp( $ftp_user, $ftp_pass, $ftp_dir, $ftp_host, true, $ftp_type)) { echo '<br>[b]<b>' . $lang['EM_debug_ftp_test'] . '</b>[/b] :: [b][color=green]<b class="ok">' . $lang['EM_debug_success']. "</b>[/color][/b]<br />\n" ; } } else { echo '<br><br>[b]<b>' . $lang['EM_debug_ftp_notest'] . "</b>[/b]<br>\n" ; } display_template( './templates/display_debug_footer.tpl', $variables) ; } // display the debug info; can be called from handle error or from any page just to get info function display_debug_info( $err_msg = '') { global $lang, $write, $move ; $values = array() ; if ($err_msg == '') { $values['error'] = '[color=green][b]' . $lang['EM_debug_no_error'] . '[/b][/color]' ; } else { $values['error'] = '[color=red]' . $err_msg . '[/color]' ; } $variables = array() ; $access = array() ; get_file_access_info( $variables, $access, true) ; // choose the best selection as default $can_write = (($access['write_access']) && ($access['mkdir_access'])) ? true : false ; $values['write_rec'] = ($can_write) ? $lang['EM_write_server'] : $lang['EM_write_ftp'] ; // choose the best selection as default if (($values['write_rec'] != $lang['EM_write_server']) && ($values['write_rec'] != $lang['EM_write_ftp'])) { // can't write on the server, so must manually move $values['move_rec'] = $lang['EM_move_manual'] ; } else { // either copy or suggest FTP; never suggest exec b/c i don't want to explain it tp dumbasses ;-) $values['move_rec'] = (($access['root_write']) && ($access['copy_access'])) ? $lang['EM_move_copy'] : $lang['EM_move_ftp'] ; } $values['file_listing'] = '' ; if ($dh = opendir('./')) { while (($file = readdir($dh)) !== false) { $values['file_listing'] .= mfunGetPerms(fileperms( $file)) . " $file <br>\n"; } closedir($dh); } display_debug_html( $variables, $access, $values) ; } // display the error message in a nicely formatted box function display_error( $error) { global $lang ; // assign template data $variables = array() ; $variables['EM_err_error'] = $lang['EM_err_error'] ; $variables['ERROR'] = $error ; display_template( './templates/display_error.tpl', $variables) ; } // used for error reporting on OPEN and FIND function handle_error($result, $file_list, $close_files, $error = '', $skip_debug = false) { // if we didn't get an OK, then we are automatically aborting if ( $result != OPEN_OK) { // close up files, just to be neat if ($close_files) { // don't worry if a problem with close since we are definitely bailing anyway complete_file_reproduction( $file_list) ; } // handle case where we are sending a non-file specific error if ($error != '') { display_error( $error) ; } // loop through all files; print errors for ($err=0; $err<count($file_list); $err++) { // if there is an error message for this file then print it if ($file_list[$err]->err_msg != '') { $error = $file_list[$err]->err_msg ; display_error( $error) ; } } // display debug info unless told otherwise if (!$skip_debug) { display_debug_info( $error) ; echo "<br>\n" ; } // no printing debug do print the footer else { page_footer() ; } // get us out of here! exit ; } } function get_install_info( &$variables, $prev_em_version) { global $phpEx, $lang, $easymod_install_version, $phpBB_version ; $variables['U_FORM'] = 'easymod_install.' . $phpEx ; $variables['EM_Install_Info'] = $lang['EM_Install_Info'] ; $variables['EM_Select_Language'] = $lang['EM_Select_Language'] ; $variables['EM_Database_type'] = $lang['EM_Database_type'] ; $variables['EM_phpBB_version'] = $lang['EM_phpBB_version'] ; $variables['EM_EasyMOD_version'] = $lang['EM_EasyMOD_version'] ; $variables['LANG_OPTIONS'] = '<option value="english" selected="selected">English</option>' ; // HARD CODED $variables['GO'] = 'Go' ; // HARD CODED $variables['SQL_LAYER'] = SQL_LAYER ; $variables['PHPBB_VERSION'] = $phpBB_version ; $variables['EM_VERSION'] = $easymod_install_version ; if ($prev_em_version == '') { $variables['L_EM_STATUS'] = $lang['EM_EM_status'] ; $variables['STATUS'] = $lang['EM_new_install'] ; } else { $variables['L_EM_STATUS'] = $lang['EM_update_from'] ; $variables['STATUS'] = $prev_em_version ; } } function get_file_access_info( &$variables, &$access, $bbcode=false) { global $lang ; // we'll handle our on errors $old_error_reporting = error_reporting(0) ; $access_msg = '' ; $read_failure = '' ; $ftp_msg = '' ; $safe_msg = '' ; $access = array( 'read_access', 'write_access', 'root_write', 'tmp_write', 'ftp_ext', 'copy_access', 'chmod_access', 'unlink_access', 'mkdir_access', 'safe_mode') ; $variables['EM_File_Access'] = ($bbcode) ? '' : $lang['EM_File_Access'] ; $variables['EM_no_problem'] = ($bbcode) ? '' : "Let's see what you have for file access. You do not need everything to read 'ok'.<br><br>" ; $variables['EM_read_access'] = $lang['EM_read_access'] ; $variables['EM_write_access'] = $lang['EM_write_access'] ; $variables['EM_root_write'] = $lang['EM_root_write'] ; $variables['EM_chmod_access'] = $lang['EM_chmod_access'] ; $variables['EM_unlink_access'] = $lang['EM_unlink_access'] ; $variables['EM_mkdir_access'] = $lang['EM_mkdir_access'] ; $variables['EM_tmp_write'] = $lang['EM_tmp_write'] ; $variables['EM_ftp_ext'] = $lang['EM_ftp_ext'] ; $variables['EM_safe_mode'] = 'Safe Mode' ; $variables['EM_copy_access'] = $lang['EM_copy_access'] ; // check for basic access permissions $access['read_access'] = check_access_read( $read_failure) ; $access['write_access'] = check_access_write( $access_msg) ; $access['root_write'] = check_access_write_root( $access_msg) ; $access['tmp_write'] = check_access_write_tmp( $access_msg) ; $access['ftp_ext'] = check_access_ftp_ext( $ftp_msg) ; $access['safe_mode'] = check_access_safe_mode( $safe_msg) ; $access['copy_access'] = check_access_copy( $access_msg) ; // get ready to display bbcode tags if desired if ($bbcode) { $ok_msg = '[b][color=green]<b class="ok">OK</b>[/b]' ; $okparms = '[b][color=green]<b class="ok">%s</b>[/b]' ; $no_msg = '[b]<b>' . $lang['EM_no'] . '</b>[/b]' ; $noparms = '[b]<b>%s</b>[/b]' ; } else { $ok_msg = '<b class="ok">OK</b>' ; $okparms = '<b class="ok">%s</b>' ; $no_msg = '<b>' . $lang['EM_no'] . '</b>' ; $noparms = '<b>%s</b>' ; } // define template variables $variables['ACCESS_READ'] = ($access['read_access']) ? $ok_msg : $no_msg ; $variables['ACCESS_WRITE'] = ($access['write_access']) ? $ok_msg : $no_msg ; $variables['ACCESS_ROOT'] = ($access['root_write']) ? $ok_msg : $no_msg ; $variables['ACCESS_TMP'] = ($access['tmp_write']) ? $ok_msg : $no_msg ; $variables['ACCESS_FTP'] = ($access['ftp_ext']) ? sprintf( $okparms, $ftp_msg) : sprintf( $noparms, $ftp_msg) ; $variables['ACCESS_SAFE'] = ($access['safe_mode']) ? sprintf( $okparms, $safe_msg) : sprintf( $noparms, $safe_msg) ; $variables['ACCESS_COPY'] = ($access['copy_access']) ? $ok_msg : $no_msg ; // don't even try chmod and unlink if we can't even write if (!$access['write_access']) { $access['chmod_access'] = false ; $access['unlink_access'] = false ; $access['mkdir_access'] = false ; $variables['ACCESS_CHMOD'] = $lang['EM_unattempted'] ; $variables['ACCESS_UNLINK'] = $lang['EM_unattempted'] ; $variables['ACCESS_MKDIR'] = $lang['EM_unattempted'] ; } // check for chmod, unlink, and mkdir access (if we have write access) else { // check for server chmod access $access['chmod_access'] = check_access_chmod( $access_msg) ; $variables['ACCESS_CHMOD'] = ($access['copy_access']) ? $ok_msg : $no_msg ; // check for server unlink access $access['unlink_access'] = check_access_unlink( $access_msg) ; $variables['ACCESS_UNLINK'] = ($access['copy_access']) ? $ok_msg : $no_msg ; // check for server mkdir access $access['mkdir_access'] = check_access_mkdir( $access_msg) ; $variables['ACCESS_MKDIR'] = ($access['copy_access']) ? $ok_msg : $no_msg ; } // restore error handling error_reporting($old_error_reporting); return $read_failure ; } function get_ftp_settings( &$variables, $access) { global $lang ; $variables['EM_ftp_title'] = $lang['EM_ftp_title'] ; $variables['EM_ftp_desc'] = $lang['EM_ftp_desc'] ; $variables['EM_ftp_dir'] = $lang['EM_ftp_dir'] ; $variables['DIR_EX'] = 'ex: public_html/phpBB2' ; // hard coded $variables['EM_ftp_user'] = $lang['EM_ftp_user'] ; $variables['EM_ftp_pass'] = $lang['EM_ftp_pass'] ; $variables['EM_ftp_host'] = $lang['EM_ftp_host'] ; $variables['EM_ftp_host_info'] = $lang['EM_ftp_host_info'] ; $variables['EM_ftp_debug'] = $lang['EM_ftp_debug'] ; $variables['EM_yes'] = $lang['EM_yes'] ; $variables['EM_no'] = $lang['EM_no'] ; $variables['EM_ftp_debug_not'] = $lang['EM_ftp_debug_not'] ; $variables['EM_ftp_use_ext'] = $lang['EM_ftp_use_ext'] ; $variables['EM_ftp_ext_not'] = $lang['EM_ftp_ext_not'] ; $ftp_ext_message = '' ; $ftp_ext_close = '' ; $ftp_cache_message = '' ; $ftp_cache_close = '' ; $ext_yes = '' ; $ext_no = 'checked="checked"' ; $cache_yes = '' ; $cache_no = 'checked="checked"' ; // we only want to display the FTP Ext option if their server can handle it if (!$access['ftp_ext']) { $ftp_ext_message = " " . $lang['EM_ftp_ext_noext'] . "\n<!-- \n" ; $ftp_ext_close = "-->\n" ; $ftp_cache_message = " " . $lang['EM_ftp_ext_noext'] . "\n<!-- \n" ; $ftp_cache_close = "-->\n" ; } else if (!$access['tmp_write']) { $cache_yes = 'checked="checked"' ; $cache_no = '' ; } else if (($access['ftp_ext']) && ($access['tmp_write'])) { $ext_yes = 'checked="checked"' ; $ext_no = '' ; } $variables['FTP_EXT_MSG'] = $ftp_ext_message ; $variables['FTP_EXT_CLOSE'] = $ftp_ext_close ; $variables['FTP_CACHE_MSG'] = $ftp_ext_message ; $variables['FTP_CACHE_CLOSE'] = $ftp_ext_close ; $variables['EXT_YES'] = $ext_yes ; $variables['EXT_NO'] = $ext_no ; $variables['CACHE_YES'] = $cache_yes ; $variables['CACHE_NO'] = $cache_no ; } function get_empw_settings( &$variables) { global $lang ; $variables['EM_password_title'] = $lang['EM_password_title'] ; $variables['EM_password_desc'] = $lang['EM_password_desc'] ; $variables['EM_password_set'] = $lang['EM_password_set'] ; $variables['EM_password_confirm'] = $lang['EM_password_confirm'] ; } function get_hidden_data( &$variables, $access) { global $language ; $variables['READ_ACCESS'] = $access['read_access'] ; $variables['WRITE_ACCESS'] = $access['write_access'] ; $variables['ROOT_WRITE'] = $access['root_write'] ; $variables['TMP_WRITE'] = $access['tmp_write'] ; $variables['CHMOD_ACCESS'] = $access['chmod_access'] ; $variables['UNLINK_ACCESS'] = $access['unlink_access'] ; $variables['MKDIR_ACCESS'] = $access['mkdir_access'] ; $variables['COPY_ACCESS'] = $access['copy_access'] ; $variables['LANGUAGE'] = $language ; } 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'] ) ; } //// //// make sure subsilver and english exists //// // make sure subsilver dir exists if (!file_exists('../../../templates/subSilver')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_no_subsilver'] ) ; } // make sure subSilver is installed in the DB // make sure SS is in the DB $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE template_name = 'subSilver'" ; if ( !($result = $db->sql_query($sql)) ) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, 'Could not get theme info.' ) ; } if ( !$db->sql_fetchrow($result) ) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_no_subsilver'] ) ; } // make sure english exists if (!file_exists('../../../language/lang_english')) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_no_english'] ) ; } // get the version of the previous EM install, if there is one $prev_em_version = '' ; $sql = "SELECT * FROM " . CONFIG_TABLE . " WHERE config_name = 'EM_version'" ; if ( !($result = $db->sql_query($sql)) ) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_info']) ; } if ( $row = $db->sql_fetchrow($result)) { $prev_em_version = $row['config_value'] ; } $db->sql_freeresult($result); // // the settings section // $variables['EM_Settings'] = $lang['EM_Settings'] ; // make sure this version of EM is not already installed // see if we have already made the EM entries $sql = "SELECT * FROM " . CONFIG_TABLE . " WHERE config_name = 'EM_version'" ; if ( !($result = $db->sql_query($sql)) ) { handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $lang['EM_err_config_info']) ; } if ( $row = $db->sql_fetchrow($result)) { // if this version matches the one in the DB, then throw an error if ( $row['config_value'] == $easymod_install_version) { $error_msg = '<b>' . $lang['EM_err_critical_error'] . ':</b> ' . $lang['EM_err_dupe_install'] ; $error_msg .= '<br><br>If you are trying to reinstall this version, change the EM version number from the Admin Control Panel under EasyMOD Settings. Or you could also use the EM Version Changer (by GPHemsley) found in the admin/mods/easymod/includes directory.' ; handle_error( OPEN_FAIL_CRITICAL, $file_list, false, $error_msg) ; } } $db->sql_freeresult($result); $read_failure = '' ; $read_access = check_access_read( $read_failure) ; ////////// ////////// no read access is going to be a major pain! but it would also be nice to read local anyway ////////// if ( !$read_access) { // ask them WTF?? handle_error( OPEN_FAIL_CRITICAL, $file_list, false, "No server read access. Check your permission settings. Read access from a local file not implemented in this version.<br><br>" . $read_failure ) ; } // return the previously installed EM version return $prev_em_version ; } // the "advanced mode" openning screen; it's pretty pathetic that this fairly simply form is being called "advanced mode" // but people really are that dumb! function display_step1_classic() { global $lang, $db, $easymod_install_version, $phpEx ; $variables = array() ; $access = array() ; // display header info, like the welcome message and pic page_header( $lang['EM_step1']) ; // add the helpwin javascript and then options form helpwin() ; // do the checks to make sure things are where we are expecting them $prev_em_version = check_installablity() ; // display install and file access info get_install_info( $variables, $prev_em_version) ; get_file_access_info( $variables, $access) ; // read selections (there is only one option ;-) ) $select_read = '<option value="server" selected="selected">' . $lang['EM_read_server'] . '</option>' ; // recommend FTP as default and then choose the best alternate selection $can_write = (($access['write_access']) && ($access['mkdir_access'])) ? true : false ; $write_rec = ($can_write) ? $lang['EM_write_server'] : $lang['EM_write_download'] ; // write selections $select_write = '<option value="server">' . $lang['EM_write_server'] . '</option>' ; $select_write .= '<option value="ftpb" selected="selected">' . $lang['EM_write_ftp'] . '</option>' ; $select_write .= '<option value="local">' . $lang['EM_write_download'] . '</option>' ; $select_write .= '<option value="screen">' . $lang['EM_write_screen'] . '</option>' ; // recommend FTP as default and then choose the best alternate selection if ($write_rec != $lang['EM_write_server']) { // can't write on the server, so must manually move $move_rec = $lang['EM_move_manual'] ; } else { // either copy or suggest FTP; never suggest exec b/c i don't want to explain it tp dumbasses ;-) $move_rec = (($access['root_write']) && ($access['copy_access'])) ? $lang['EM_move_copy'] : $lang['EM_move_manual'] ; } // write selections $select_move = '<option value="copy">' . $lang['EM_move_copy'] . '</option>' ; $select_move .= '<option value="ftpa" selected="selected">' . $lang['EM_move_ftp'] . '</option>' ; $select_move .= '<option value="exec">' . $lang['EM_move_exec'] . '</option>' ; $select_move .= '<option value="ftpm">' . $lang['EM_move_manual'] . '</option>' ; // assign template data $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; $variables['EM_file_title'] = $lang['EM_file_title'] ; $variables['EM_file_desc'] = $lang['EM_file_desc'] ; $variables['EM_file_alt'] = $lang['EM_file_alt'] ; $variables['EM_file_reading'] = $lang['EM_file_reading'] ; $variables['EM_file_writing'] = $lang['EM_file_writing'] ; $variables['EM_file_moving'] = $lang['EM_file_moving'] ; $variables['Submit'] = $lang['Submit'] ; $variables['Rescan'] = $lang['Rescan'] ; $variables['SELECT_READ'] = $select_read ; $variables['SELECT_WRITE'] = $select_write ; $variables['SELECT_MOVE'] = $select_move ; $variables['WRITE_REC'] = $write_rec ; $variables['MOVE_REC'] = $move_rec ; // fill the template info get_empw_settings( $variables) ; get_ftp_settings( $variables, $access) ; get_hidden_data( $variables, $access) ; // dispay the page and the footer display_template( './templates/step1_classic.tpl', $variables) ; page_footer() ; exit ; } // the unbelievably simple setup screen function display_step1_simple() { global $lang, $db, $easymod_install_version, $phpEx, $language ; $variables = array() ; // display header info, like the welcome message and pic page_header( '<b>Step 1 (gathering settings):</b> Welcome to the EasyMOD installer. EasyMOD will try to guide you every step of the way. First, we need to know a little about your server.') ; // do the checks to make sure things are where we are expecting them $prev_em_version = check_installablity() ; // display install info get_install_info( $variables, $prev_em_version) ; // assign template data $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; $variables['Submit'] = $lang['Submit'] ; $variables['LANGUAGE'] = $language ; // dispay the page and the footer display_template( './templates/step1_simple.tpl', $variables) ; page_footer() ; exit ; } function display_step1b_idunno() { global $lang, $db, $easymod_install_version, $phpEx ; $variables = array() ; $access = array() ; // file access info get_file_access_info( $variables, $access) ; // comment out all 3 sections and then we'll reanble the one we want; based of off the file acces info, // determine which form to display $variables['WRITE_COPY_START'] = '<!--' ; $variables['WRITE_COPY_END'] = '-->' ; $variables['WRITE_NOCOPY_START'] = '<!--' ; $variables['WRITE_NOCOPY_END'] = '-->' ; $variables['NOWRITE_NOCOPY_START'] = '<!--' ; $variables['NOWRITE_NOCOPY_END'] = '-->' ; // golden! complete automation if (( $access['write_access']) && ( $access['copy_access'])) { $variables['WRITE_COPY_START'] = '' ; $variables['WRITE_COPY_END'] = '' ; } // write only else if ( $access['write_access']) { $variables['WRITE_NOCOPY_START'] = '' ; $variables['WRITE_NOCOPY_END'] = '' ; } // nada else { $variables['NOWRITE_NOCOPY_START'] = '' ; $variables['NOWRITE_NOCOPY_END'] = '' ; } // display header info, like the welcome message and pic page_header( 'auto detection') ; // assign template data $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; $variables['Submit'] = $lang['Submit'] ; $variables['Rescan'] = $lang['Rescan'] ; // dispay the page and the footer display_template( './templates/step1b_simple.tpl', $variables) ; page_footer() ; exit ; } function display_step1b_ftp() { global $lang, $db, $easymod_install_version, $phpEx, $language ; $variables = array() ; $access = array() ; // display header info, like the welcome message and pic page_header( '<b>Step 1 (gathering settings):</b> You have specified that you have FTP access. Enter your FTP information below.') ; // display the file access info get_file_access_info( $variables, $access) ; // assign template data $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; $variables['Submit'] = $lang['Submit'] ; $variables['Rescan'] = $lang['Rescan'] ; $variables['SEL_READ'] = 'server' ; $variables['SEL_WRITE'] = 'ftpb' ; $variables['SEL_MOVE'] = 'ftpa' ; $variables['LANGUAGE'] = $language ; get_ftp_settings( $variables, $access) ; $variables['EM_ftp_desc'] = 'Enter the information you would normally need to access your phpBB files via FTP.' ; // dispay the page and the footer display_template( './templates/step1b_ftp.tpl', $variables) ; page_footer() ; exit ; } function display_step1c_empw() { global $lang, $db, $easymod_install_version, $phpEx ; global $read, $write, $move, $ftp_user, $ftp_pass, $ftp_host, $ftp_dir, $ftp_debug, $ftp_type, $ftp_cache; $variables = array() ; $access = array() ; // display header info, like the welcome message and pic page_header( '<b>Step 1 (gathering settings):</b> EasyMOD takes security very seriously. A password will further restict who has access. If you are using FTP, then a password is required so that your FTP information can safely be crypted into the database.') ; // file access info get_file_access_info( $variables, $access) ; // assign template data $variables['U_FORM'] = 'easymod_install.'.$phpEx ; $variables['EM_support'] = $lang['EM_support'] ; $variables['EM_Settings'] = $lang['EM_Settings'] ; $variables['Submit'] = $lang['Submit'] ; $variables['Rescan'] = $lang['Rescan'] ; $variables['SEL_READ'] = $read ; $variables['SEL_WRITE'] = $write ; $variables['SEL_MOVE'] = $move ; $variables['FTP_USER'] = $ftp_user ; $variables['FTP_PASS'] = $ftp_pass ; $variables['FTP_HOST'] = $ftp_host ; $variables['FTP_DIR'] = $ftp_dir ; $variables['FTP_DEBUG'] = $ftp_debug ; $variables['FTP_TYPE'] = $ftp_type ; $variables['FTP_CACHE'] = $ftp_cache ; // fill the template info get_empw_settings( $variables) ; get_hidden_data( $variables, $access) ; // dispay the page and the footer display_template( './templates/step1c_empw.tpl', $variables) ; page_footer() ; exit ; } ?> --- NEW FILE: lang_easymod.php --- <?php /*************************************************************************** * lang_easymod.php [English] * ------------------- * begin : Saturday, Mar 22 2003 * copyright : (C) 2002-2004 by Nuttzy - Craig Nuttall * email : nu...@bl... * * $Id: lang_easymod.php,v 1.1 2005/04/24 14:59:52 bkettle Exp $ * ****************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ // // EasyMOD // // EasyMOD alpha specific" ; //$lang['EM_SQL_Alpha2'] = '<b>NOTE:</b> SQL processing has been disabled in Alpha 3 and no alterations to your database will actually be preformed. It will be implemented in Beta 1. Press "Complete Installation" to continue.' ; // header $lang['EM_Title'] = 'EasyMOD - Automatic MOD Installer' ; // login $lang['EM_access_warning'] = 'A password is required to access the EasyMOD automatic MOD installer. Anyone with access could potentially access the database and FTP login information without the board owner knowing.' ; $lang['EM_password_title'] = 'Please enter the EasyMOD access password.' ; $lang['EM_password'] = 'Password' ; $lang['EM_access_EM'] = 'Access EasyMOD' ; // history (installed MODs) $lang['EM_Installed'] = 'Installed MODs' ; $lang['EM_installed_desc'] = 'All of these MODs have been installed at one time or another on your board. In later versions you will be able to get more details or uninstall the MODs from here.' ; $lang['EM_install_date'] = 'Installed' ; // settings $lang['EM_settings_pw'] = 'The EasyMOD password will allow you to restrict which admins can use EasyMOD. By having access to EasyMOD an admin could covertly obtain your database user/pass and FTP info. Leave both the password and the confirm password empty to have no password set. Leave the confirm empty to not change the password.' ; $lang['EM_read_server'] = 'server' ; $lang['EM_write_server'] = 'server' ; $lang['EM_write_ftp'] = 'buffer & ftp' ; $lang['EM_write_download'] = 'download' ; $lang['EM_write_screen'] = 'on screen' ; $lang['EM_move_copy'] = 'copy' ; $lang['EM_move_ftp'] = 'automated FTP' ; $lang['EM_move_exec'] = 'execute script' ; $lang['EM_move_manual'] = 'manually load' ; $lang['EM_settings'] = 'Settings'; $lang['EM_settings_desc'] = 'Set the settings here. <b>This page still needs work.</b> I do not validate what you enter yet so be careful not to mess it up!' ; $lang['EM_settings_update'] = 'Update Settings' ; $lang['EM_settings_success'] = 'Your EasyMOD settings have been updated successfully.' ; $lang['EM_pass_disabled'] = '(EM password disabled)' ; $lang['EM_pass_updated'] = '(EM password updated)' ; $lang['EM_pass_not_updated'] = '(EM password not updated)' ; // EasyMOD install $lang['EM_Intro'] = 'EasyMOD does in seconds what formally was a tedious process of manually editing files to install phpBB MODs. EasyMOD will attempt to install any phpBB MOD. However, approved EasyMOD Compliant MODs have the best chance to install successfully.' ; $lang['EM_none_installed'] = 'No MODs have been installed.' ; $lang['EM_All_Processed'] = 'All MODs have been processed.' ; $lang['EM_unprocessed_mods'] = 'These MODs appear in your MODs directory and have not been processed for your current version of phpBB. Clicking "Process" initiates a multi-step installation. Your current phpBB files will not be overwritten until the final step. MODs that are EasyMOD Compliant (EMC) are more likely to install than other MODs. More info on how to have EM install MODs is <a href="http://www.phpbb.com/phpBB/viewtopic.php?p=689082#689082">here</a>.' ; $lang['EM_Unprocessed'] = 'Unprocessed MODs' ; $lang['EM_process'] = 'Process' ; $lang['EM_support_thread'] = 'Support' ; $lang['EM_EMC'] = 'EMC' ; // Preview $lang['EM_preview'] = 'Preview' ; $lang['EM_preview_mode'] = 'Preview Mode' ; $lang['EM_preview_desc'] = 'The following is a list of files that the MOD specifies to be modified. Click "View" to view what changes will take place. The changes that EasyMOD will make to the files are bolded in red. Unfortunately, becasue of HTML formatting, some extra carriage returns are occasionally added, but they will not appear when the file is actually written.' ; $lang['EM_preview_filename'] = 'Filename' ; $lang['EM_preview_view'] = 'View' ; $lang['EM_preview_nofile'] = 'This MOD will not modify any files. Nothing to preview.' ; // History + Install $lang['EM_Mod'] = 'MOD' ; $lang['EM_File'] = 'File' ; $lang['EM_Version'] = 'Version' ; $lang['EM_Author'] = 'Author' ; $lang['EM_Description'] = 'Description' ; $lang['EM_phpBB_Version'] = 'phpBB ver' ; $lang['EM_Themes'] = 'Themes' ; $lang['EM_Languages'] = 'Languages' ; // process $lang['EM_proc_step1'] = 'Step 1 of 3' ; $lang['EM_proc_complete'] = 'Processing completed successfully!' ; $lang['EM_proc_desc'] = 'EasyMOD has completed processing of this MOD. Your original phpBB files remain unaltered. The next step will update your DB and replace your phpBB files with the newly altered ones. Your original phpBB files will automatically be backed up. However, <b>this is beta quality software and you are urged to make your own backups!!</b> Press the "Next Step" button to continue.' ; $lang['EM_unprocessed_commands'] = 'Unprocessed Commands' ; $lang['EM_unprocessed_desc'] = 'The following commands were not recognized by EasyMOD and were ignored. The MOD script line number is displayed.' ; $lang['EM_processed_commands'] = 'Commands Processed' ; $lang['EM_processed_desc'] = 'EasyMOD successfully processed the following commands:'; $lang['EM_proc_failed'] = 'Installation Failed' ; $lang['EM_proc_failed_desc'] = 'EasyMOD encountered the following error(s). A general error could be ABC. A critical error means D and you should do XYZ.' ; // process + post process $lang['EM_Mod_Data'] = 'MOD Data' ; $lang['EM_Mod_Title'] = 'MOD Title' ; $lang['EM_Proc_Themes'] = 'Processed Themes' ; $lang['EM_Proc_Languages'] = 'Processed Languages' ; $lang['EM_Files'] = 'Files Edited' ; // EasyMOD sql $lang['EM_sql_step2'] = 'Step 2 of 3' ; $lang['EM_SQL_Intro'] = '<b>Database Alterations</b> - DISABLED' ; $lang['EM_Alterations'] = 'Proposed Database Alterations' ; $lang['EM_Pseudo'] = 'Pseudo SQL' ; $lang['EM_Allow'] = 'Allow' ; $lang['EM_Perform'] = 'Perform DB alterations' ; $lang['EM_complete_install'] = 'Complete Installation' ; // post process $lang['EM_pp_step3'] = 'Step 3 of 3' ; $lang['EM_pp_install_comp'] = 'Installation Complete!' ; $lang['EM_pp_comp_desc'] = 'Installation of this MOD is now complete! You should verify that the MOD is now functioning properly for all installed themes and languages.' ; $lang['EM_pp_complete'] = 'completed' ; $lang['EM_pp_ready'] = 'ready' ; $lang['EM_pp_manual'] = 'MANUAL' ; $lang['EM_pp_from'] = 'Copy From [%s]' ; $lang['EM_pp_backups'] = 'Making Backups in [%s]' ; $lang['EM_pp_backup'] = 'Backup' ; $lang['EM_pp_download'] = 'Download' ; $lang['EM_pp_to'] = 'To' ; $lang['EM_pp_status'] = 'Status' ; // general use $lang['EM_next_step'] = 'Next Step' ; // // installer // // translate this and I'll hardcode the message into easymod_install.php $lang['EM_no_lang'] = '<b>CRITICAL ERROR:</b> the lang_easymod.$phpEx file could not be found in the easymod directory. EasyMOD cannot be installed without this file present.' ; // step 1 $lang['EM_step1'] = '<b>Step 1 (of 5):</b> Welcome to the EasyMOD installer. In this step EasyMOD has scanned the server to see what file access is available for the key steps of reading, writing, and moving files. EasyMOD has recommended what settings seem to best fit your configuration.' ; $lang['EM_Install_Info'] = 'Install Info' ; $lang['EM_Select_Language'] = 'Select Language' ; $lang['EM_Database_type'] = 'Database type' ; $lang['EM_phpBB_version'] = 'phpBB version' ; $lang['EM_EasyMOD_version'] = 'EasyMOD version' ; $lang['EM_EM_status'] = 'EM status' ; $lang['EM_new_install'] = 'New Install' ; $lang['EM_update_from'] = 'Update EM from' ; $lang['EM_File_Access'] = 'File Access Info' ; $lang['EM_failed'] = 'failed' ; $lang['EM_unattempted'] = 'unattempted' ; $lang['EM_no_module'] = 'module not loaded' ; $lang['EM_no_problem'] = 'NOTE: there is no problem if some items failed or were not attempted. This is normal.' ; $lang['EM_support'] = 'For support, visit <a href="http://area51.phpbb.com/phpBB22/viewforum.php?f=15" target="_blank">EasyMOD Central</a> over at Area51. No emails, IMs, or PMs please.' ; $lang['EM_read_access'] = 'read access' ; $lang['EM_write_access'] = 'write access' ; $lang['EM_root_write'] = 'root path write' ; $lang['EM_chmod_access'] = 'chmod access' ; $lang['EM_unlink_access'] = 'unlink access' ; $lang['EM_mkdir_access'] = 'mkdir access' ; $lang['EM_tmp_write'] = 'tmp path write' ; $lang['EM_ftp_ext'] = 'FTP extension' ; $lang['EM_copy_access'] = 'copy access' ; $lang['EM_Settings'] = 'Settings' ; $lang['EM_password_title'] = 'EasyMOD Password Protection' ; $lang['EM_password_desc'] = 'The EasyMOD password will allow you to restrict which admins can use EasyMOD. By having access to EasyMOD an admin could covertly obtain your database user/pass and FTP info.' ; $lang['EM_password_set'] = 'Set EM password' ; $lang['EM_password_confirm'] = 'Confirm EM password' ; $lang['EM_file_title'] = 'File Access' ; $lang['EM_file_desc'] = 'FTP access is the perferred method for file access. If you do not have FTP access, EasyMOD has recommended alternate settings.' ; $lang['EM_file_reading'] = 'Reading' ; $lang['EM_file_writing'] = 'Writing' ; $lang['EM_file_moving'] = 'Moving' ; $lang['EM_file_alt'] = 'alternate' ; $lang['EM_ftp_title'] = 'FTP Information' ; $lang['EM_ftp_desc'] = 'If you have FTP access to the web server, enter it below. The info will be stored fairly securely in the phpBB database. It will only be accessible through EasyMOD.' ; $lang['EM_ftp_dir'] = 'FTP path to phpBB2' ; $lang['EM_ftp_user'] = 'FTP Username' ; $lang['EM_ftp_pass'] = 'FTP Password' ; $lang['EM_ftp_host'] = 'FTP Server' ; $lang['EM_ftp_host_info'] = '(localhost should be fine)' ; $lang['EM_ftp_debug'] = 'FTP Debug Mode' ; $lang['EM_ftp_debug_not'] = '(only use if there is a problem)' ; $lang['EM_ftp_use_ext'] = 'PHP FTP Extension' ; $lang['EM_ftp_ext_not'] = '(only change if instructed to)' ; $lang['EM_ftp_ext_noext'] = 'Not an option. PHP FTP module not loaded.' ; $lang['EM_ftp_ext_notmp'] = 'Not an option. No /tmp write access.' ; $lang['EM_ftp_cache'] = 'Use FTP cache' ; $lang['EM_yes'] = 'Yes' ; $lang['EM_no'] = 'No' ; // step 2 $lang['EM_step2'] = '<b>Step 2 (of 5):</b> EasyMOD is now confirming your file access settings.' ; $lang['EM_test_write'] = 'Testing selected write method' ; $lang['EM_confirm_write'] = 'Write access method confirmed!'; $lang['EM_confirm_write_server'] = 'The modified files will be written on the server.' ; $lang['EM_confirm_write_ftp'] = "The modified files will be written to a buffer and then FTP'd into place." ; $lang['EM_confirm_write_local'] = 'The modified files will be downloaded locally through your web browser.' ; $lang['EM_confirm_write_screen'] = 'The modified file contents will be displayed on screen.' ; $lang['EM_test_move'] = 'Testing selected move method' ; $lang['EM_test_ftp1'] = '1) Logged in successfully' ; $lang['EM_test_ftp2'] = '2) CD to EasyMOD path successfully' ; $lang['EM_test_ftp3'] = '3) wrote to phpBB root successfully' ; $lang['EM_ftp_sync1'] = 'You have selected FTP for writing files but not for moving them. You must set both write and move to use FTP or else you cannot use FTP.' ; $lang['EM_ftp_sync2'] = 'You have selected FTP for moving files but not for writing them. You must set both write and move to use FTP or else you cannot use FTP.' ; $lang['EM_confirm_move'] = 'Move access method confirmed!' ; $lang['EM_confirm_move_ftp'] = 'The core phpBB files will automatically be replaced by modified files via FTP.' ; $lang['EM_confirm_move_copy'] = 'The core phpBB files will automatically be replaced by modified files using the copy function.' ; $lang['EM_confirm_move_exec'] = 'A script will be generated that you can execute to automatically replace the core phpBB files with the modified files.' ; $lang['EM_confirm_move_ftpm'] = 'You have selected to manually replace the core phpBB files with the modified files.' ; $lang['EM_install_EM'] = 'Install EasyMOD' ; $lang['EM_confirm_download'] = '<b>IMPORTANT:</b> To fully test the download method, make sure you can download this file. If it fails, you cannot use the "download" write method and should press "Rescan" to select another option.' ; // step 2 ftp test $lang['EM_ftp_testing'] = 'Testing FTP access...' ; $lang['EM_ftp_fail_conn'] = 'FTP ERROR: connection to %s failed.' ; $lang['EM_ftp_fail_conn_lh'] = "This error occurs frequently, particularly on hosts like Lycos. Back on step 1 you should try changing the FTP Server from 'localhost' to whatever hostname you typically use when you FTP." ; $lang['EM_ftp_fail_conn_invalid'] = "The connection failed because it appears you have provided an invalid FTP Server hostname. Hostnames cannot have slashes (/ or \\) or colons (:) in the name. Try reentering the FTP Server field." ; $lang['EM_fail_conn_info'] = 'The FTP Server you have specified could not be connected to. The following is recommended:'; $lang['EM_fail_conn_op1'] = 'Have you tried the default setting of <b>localhost</b>? This should be tried first.' ; $lang['EM_fail_conn_op2'] = 'Did you correctly enter the hostname? Try reentering.' ; $lang['EM_fail_conn_op3'] = 'Are you sure you have FTP access to the phpBB2 files? Obviously this is a requirement.' ; $lang['EM_fail_conn_op4'] = "Some servers have issues with the fsockopen method that EasyMOD attempts to use by default. If you have the PHP FTP extension loaded, then enable that option in step 1." ; $lang['EM_fail_login'] = 'FTP ERROR: login failed' ; $lang['EM_fail_login_info'] = 'The FTP Server was connected to, but the username and password were rejected. The following is recommended:' ; $lang['EM_fail_login_op1'] = 'Did you correctly type the username and password? Make sure your CAPS LOCK key is off and try again.' ; $lang['EM_fail_login_op2a'] = 'If you are 100% certain your user/pass is correct, then perhaps you are not connecting to the correct host. Try changing your FTP Server entry from localhost to the actual ftp host name.' ; $lang['EM_fail_login_op2b'] = 'Perhaps you are not connecting to the correct host. Try changing your FTP Server entry back to localhost or verify you have correctly entered the ftp host name.' ; $lang['EM_fail_pwd'] = 'FTP ERROR: pwd failed' ; $lang['EM_fail_pwd_info'] = 'You successfully logged into the server, but the pwd command (print working directory) failed.' ; $lang['EM_fail_cd'] = 'FTP ERROR: could not cd to %s' ; $lang['EM_fail_cd_info'] = 'You successfully logged into the server, but could not change direcory (CD) to the easymod directory. The following is recommended:' ; $lang['EM_fail_cd_op1'] = '<b>Important:</b> It appears you are including a domain name in the FTP Path setting. For most servers this is incorrect. Try reentering the FTP Path setting without the domain name included.' ; $lang['EM_fail_cd_op2'] = '<b>Important:</b> You have a slash (/) at the end of your FTP Path. Try removing this and retrying.' ; $lang['EM_fail_cd_op3'] = 'Are you sure you entered the correct path? Below is a directory listing of the files in the FTP root directory. The FTP root directory is simply the starting point when you connect. The path to the phpBB2 installation should begin with one of the directory names listed below.' ; $lang['EM_fail_cd_op4'] = 'Directory names are case sensitive. Be sure the easymod directory is all lowercase.' ; $lang['EM_fail_cd_op5'] = "In some *very rare* cases it's possible that you are not connecting to the proper FTP Server. Try specifying the hostname in the FTP Server field." ; $lang['EM_fail_cd_op6'] = "Some servers have issues with the passive mode that EasyMOD attempts to use by default. If you have the PHP FTP extension loaded, then enable that option in step 1." ; $lang['EM_fail_cd_pwd'] = 'FTP Error: Directory info could not be obtained. This usually indicates solution 4 listed above.' ; $lang['EM_fail_cd_nlist'] = 'FTP Error: A file listing could not be obtained. This usually indicates solution 4 listed above.' ; $lang['EM_fail_cd_nlist_no'] = 'No files to list.' ; $lang['EM_ftp_root'] = 'FTP root directory:' ; $lang['EM_dir_list'] = 'Directory listing:</b> your FTP Path should start with one of the directories listed below' ; $lang['EM_fail_pwd'] = 'FTP ERROR: could not pwd' ; $lang['EM_fail_put'] = 'FTP ERROR: could not write to phpBB root' ; $lang['EM_fail_put_info'] = 'EasyMOD requires that your <b>%s</b> account have write access on all directories and files in the phpBB directory. Please confirm all files and directories are set to at least 744 access.' ; $lang['EM_ftp_phpbb_root'] = 'phpBB root directory:' ; $lang['EM_fail_reput'] = 'FTP ERROR: could not overwrite phpBB root test file' ; $lang['EM_fail_delete'] = '<b>FTP WARNING:</b> could not remove test file (not critical)' ; // step 3 $lang['EM_step3'] = '<b>Step 3 (of 5):</b> EasyMOD is now installing itself as it would any MOD. There is a two step process of first creating the modified files and then moving them into place. The modified file(s) do no effect the core phpBB files in any way until the next step. Click the "Complete Processing" button to move the files into place.' ; $lang['EM_processing_files'] = 'Processing Files' ; $lang['EM_parsing'] = 'Parsing' ; $lang['EM_finding'] = 'Finding' ; $lang['EM_insert'] = 'Insert' ; $lang['EM_ifinding'] = 'In-line Finding' ; $lang['EM_iafter'] = 'In-line after, add' ; $lang['EM_before'] = 'before' ; $lang['EM_after'] = 'after' ; $lang['EM_build_post'] = 'Building Post Process Actions' ; $lang['EM_build_post_desc'] = 'The following actions will be executed in the final step' ; $lang['EM_complete_processing'] = 'Complete Processing' ; // step 4 $lang['EM_step4'] = '<b>Step 4 (of 5):</b> Depending on your selection, the modified files have been automatically moved into place or prepared for you to move them manually. If there are no errors, click the "Confirm" button to update your database and complete the installation process.' ; $lang['EM_add_db'] = 'Adding EasyMOD table to your database' ; $lang['EM_exec_sql'] = 'Executing SQL' ; $lang['EM_progress'] = 'Progress' ; $lang['EM_done'] = 'Done' ; $lang['EM_result'] = 'Result' ; $lang['EM_already_exist'] = 'The table was previously created' ; $lang['EM_failed_sql'] = 'Some queries failed, the statements and errors are listing below' ; $lang['EM_no_worry'] = 'This is probably nothing to worry about, install will continue. Should this fail to complete you may need to seek help at our development board.' ; $lang['EM_no_errors'] = 'No errors' ; $lang['EM_update_db'] = 'Updating EasyMOD table data' ; $lang['EM_store_entries'] = 'Storing config table entries' ; $lang['EM_do_worry'] = 'Could not successfully update table. Something is wrong and install cannot complete.' ; $lang['EM_complete_post'] = 'Completing Post-Process' ; $lang['EM_completed'] = 'Completed' ; $lang['EM_admin_panel'] = 'You can now proceed to the Admin Control Panel and select "Install MODs" under "MOD Center". You may install the included MODs if you desire. Return to <a href="../../../index.php">Forum Index</a>.' ; $lang['EM_confirm'] = 'Confirm' ; $lang['EM_move_files'] = '<b>IMPORTANT:</b> Before pressing confirm, move files into place.' ; // step 5 $lang['EM_step5'] = '<b>Final Step:</b> EasyMOD is now confirming all files have been correctly moved into place. If confirmed, then your database will be updated and installation will be complete!' ; $lang['EM_confirming_mod'] = 'Confirming Modifications' ; $lang['EM_confirmed'] = 'Confirmed!' ; $lang['EM_confirm_lang'] = 'lang_admin.php, looking for' ; $lang['EM_confirm_admin'] = 'admin_easymod.php, looking for' ; $lang['EM_confirm_exist'] = 'verifying existence' ; $lang['EM_confirm_failed'] = 'Install Failed' ; $lang['EM_confirm_fix'] = 'EM is not properly installed and you will need to fix the above error(s).' ; $lang['EM_install_completed'] = 'Installation Confirmed. EasyMOD is installed!' ; // debug info $lang['EM_debug_header'] = '<b>Debug Info:</b> The following information about your system config has been formatted for display in a forum post.' ; $lang['EM_debug_display'] = 'Display Debug Info' ; $lang['EM_debug_info'] = 'Expanded Debug Info' ; $lang['EM_debug_format'] = 'formatted for forum posting' ; $lang['EM_debug_installer'] = 'EM installer' ; $lang['EM_debug_work_dir'] = 'Working Dir' ; $lang['EM_debug_step'] = 'Install Step' ; $lang['EM_debug_mode'] = 'Mode' ; $lang['EM_debug_the_error'] = 'The Error' ; $lang['EM_debug_no_error'] = 'No error.' ; $lang['EM_debug_permissions'] = 'Permissions' ; $lang['EM_debug_sys_errors'] = 'including system errors' ; $lang['EM_debug_recommend'] = 'Recommendations' ; $lang['EM_debug_write'] = 'write' ; $lang['EM_debug_move'] = 'move' ; $lang['EM_debug_ftp_dir'] = 'ftp dir' ; $lang['EM_debug_ftp_debug'] = 'ftp debug' ; $lang['EM_debug_ftp_ext'] = 'ftp ext' ; $lang['EM_debug_ftp_notest'] = 'Not testing FTP since it is not being used.' ; $lang['EM_debug_selected'] = 'Selected settings' ; $lang['EM_debug_listing'] = 'CWD Listing' ; // cwd = current working directory $lang['EM_debug_ftp_test'] = 'FTP access test' ; $lang['EM_debug_success'] = 'successful' ; // forms $lang['Submit'] = 'Submit'; $lang['Rescan'] = 'Rescan'; // // errors // $lang['EM_err_warning'] = 'Warning' ; $lang['EM_err_error'] = 'Error' ; $lang['EM_err_critical_error'] = 'Critical Error' ; $lang['EM_err_secondary'] = 'Secondary Error - Critical' ; $lang['EM_err_cwd'] = 'Current working directory' ; $lang['EM_err_install_dir'] = '<b>Critical Error:</b> EasyMOD is not in the correct directory to be installed. It must be placed in a admin/mods/easymod off the phpBB root prior to installation.<br>' ; $lang['EM_err_no_subsilver'] = '<b>Critical Error:</b> EasyMOD cannot be installed. The subSilver template is not present in the templates directory. This template is required as the baseline template for MOD installations. The subSilver template is provided in the standard phpBB download at <a href="http://www.phpbb.com">www.phpbb.com</a>.' ; $lang['EM_err_no_english'] = '<b>Critical Error:</b> EasyMOD cannot be installed. The English language package is not present in the language directory. This language is required as the baseline language package for MOD installations. The English language package is provided in the standard phpBB download at <a href="http://www.phpbb.com">www.phpbb.com</a>.' ; $lang['EM_err_dupe_install'] = 'This version of EM has already been installed. Terminating to prevent reinstallation.' ; $lang['EM_err_pw_match'] = '<b>Error:</b> The EasyMOD passwords do not match. Please retry by pressing the "Rescan" button.' ; $lang['EM_err_acc_write'] = '<b>ACCESS ERROR:</b> phpBB does not have permission to write to the EasyMOD directory.' ; $lang['EM_err_acc_mkdir'] = '<b>ACCESS ERROR:</b> phpBB does not have permission to create new directories.' ; $lang['EM_err_copy'] = '<b>COPY ERROR:</b> You do not have copy access. Move method cannot be used.' ; $lang['EM_err_no_write'] = '<b>MOVE ERROR:</b> The write method you have selected does not create the files on there server. Therefore, using either automated FTP or the copy method is not permitted for the move method.' ; $lang['EM_err_config_table'] = 'Could not obtain Config Table list' ; $lang['EM_err_open_pp'] = '<b>Critical Error:</b> Cannot open post process file for writing.' ; $lang['EM_err_attempt_remainder'] = 'ATTEMPING REMAINDER OF POST PROCESS' ; $lang['EM_err_write_pp'] = '<b>Critical Error:</b> Unable to complete writing of post process file.' ; $lang['EM_err_no_step'] = '<b>Critical Error:</b> Undefinied install step.' ; $lang['EM_err_insert'] = 'Could not insert %s config information.' ; $lang['EM_err_update'] = 'Could not update %s config information.' ; $lang['EM_err_find'] = 'Could not find' ; $lang['EM_err_pw_fail'] = 'INVALID PASSWORD SUPPLIED' ; $lang['EM_err_find_fail'] = 'FIND FAILED: In file [%s] could not find' ; $lang['EM_err_ifind_fail'] = 'IN-LINE FIND FAILED: In file [%s] could not find' ; // admin_easymod errors $lang['EM_trace'] = 'Function Trace' ; $lang['EM_FAQ'] = 'FAQ' ; $lang['EM_report'] = 'Report' ; $lang['EM_error_detail'] = 'Error Detail' ; $lang['EM_line_num'] = 'MOD script line #' ; $lang['EM_err_config_info'] = 'Could not obtain Config information' ; $lang['EM_err_no_process_file'] = 'Critical Error: There is no filed specified to process.' ; $lang['EM_err_set_pw'] = 'The EasyMOD passwords do not match. Settings not updated.' ; $lang['EM_err_em_info'] = 'Could not obtain EasyMod information' ; $lang['EM_err_phpbb_ver'] = 'Could not obtain phpBB version info' ; $lang['EM_err_backup_open'] = 'Could not open [%s] for reading.' ; $lang['EM_err_no_find'] = 'FAILED: malformed script. A FIND was not previously performed.' ; $lang['EM_err_comm_open'] = 'OPEN FAILED: No file name supplied in MOD script' ; $lang['EM_err_comm_find'] = 'FIND FAILED: No target supplied for FIND command in MOD script' ; $lang['EM_err_inline_body'] = 'FAILED: Invalid command body supplied in MOD script' ; $lang['EM_err_no_ifind'] = 'FAILED: Malformed script. An IN-LINE FIND was not previously performed.' ; $lang['EM_err_comm_copy'] = 'COPY FAILED: The target file to be copied [%s%s] could not be found.' ; $lang['EM_err_modify'] = 'CRITICAL ERROR: Could not modify [%s]' ; $lang['EM_err_theme_info'] = 'Could not query database for theme info' ; $lang['EM_err_copy_format'] = 'Could not perform improperly formed COPY command.' ; // mod_io errors $lang['EM_modio_mkdir_chdir'] = 'FTP ERROR: could not change directory to [%s]<br>Current dir: [%s]' ; $lang['EM_modio_mkdir_mkdir'] = 'FTP ERROR: could not make directory [%s]<br>Current dir: [%s]' ; $lang['EM_modio_open_read'] = 'Could not open [%s] for reading.' ; $lang['EM_modio_open_write'] = 'Could not open [%s] for writing.' ; $lang['EM_modio_open_none'] = 'Write method not recognized.' ; $lang['EM_modio_close_chdir'] = 'FTP ERROR: could not change directory to [%s]' ; $lang['EM_modio_close_ftp'] = 'FTP ERROR: could not write file [%s]' ; $lang['EM_modio_prep_conn'] = 'FTP ERROR: could not connect to localhost' ; $lang['EM_modio_prep_login'] = 'FTP ERROR: login failed' ; $lang['EM_modio_prep_chdir'] = 'FTP ERROR: could not chdir to phpBB root directory' ; $lang['EM_modio_move_copy'] = 'COPY ERROR: could not move file [%s] to [%s]' ; $lang['EM_modio_move_ftpa'] = 'FTP ERROR: could not move file [%s] to [%s]' ; ?> --- NEW FILE: easymod_install.php --- <?php /*************************************************************************** * easymod_install.php * ------------------- * begin : Wednesday, March 15, 2002 * copyright : (C) 2002-2004 by Nuttzy - Craig Nuttall * email : nu...@bl... * * $Id: easymod_install.php,v 1.1 2005/04/24 14:59:52 bkettle Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * [...1828 lines suppressed...] // echo "<br>\n" ; echo "<br>\n" ; echo '<br><br><h2><span class="ok"><b>' . $lang['EM_install_completed'] . "</b></span></h2>\n" ; echo '<p>'... [truncated message content] |