Removed useless unlink()

Added missing delete for old data when converting & missing vars
Added missing language variables to English language files
This commit is contained in:
Marc Alexander
2011-05-10 22:15:47 +02:00
parent 8c0f6c1bfc
commit 8946ead961
4 changed files with 14 additions and 3 deletions

View File

@@ -51,7 +51,7 @@
<td><strong>{new_files.SOURCE}<!-- IF new_files.S_MISSING_FILE -->&nbsp;&nbsp;&nbsp;<strong><font color="red">({L_FILE_MISSING})</font><!-- ENDIF --></strong></td> <td><strong>{new_files.SOURCE}<!-- IF new_files.S_MISSING_FILE -->&nbsp;&nbsp;&nbsp;<strong><font color="red">({L_FILE_MISSING})</font><!-- ENDIF --></strong></td>
<td>{new_files.TARGET}</td> <td>{new_files.TARGET}</td>
<!-- IF S_INSTALL --> <!-- IF S_INSTALL -->
<td><!-- IF new_files.S_SUCCESS --><font color="green">{L_PORTAL_MODULE_SUCCESS}</font><!-- ELSE --><font color="red">{L_PORTAL_MODULE_ERROR}</font><!-- ENDIF --></td> <td style="<!-- IF new_files.S_SUCCESS -->color: green;">{L_PORTAL_MODULE_SUCCESS}<!-- ELSE -->color: red;">{L_PORTAL_MODULE_ERROR}<!-- ENDIF --></td>
<!-- ENDIF --> <!-- ENDIF -->
</tr> </tr>
<!-- END new_files --> <!-- END new_files -->

View File

@@ -112,6 +112,12 @@ $lang = array_merge($lang, array(
'MODULE_UPLOAD_MKDIR_FAILURE' => 'Unable to create a folder.', 'MODULE_UPLOAD_MKDIR_FAILURE' => 'Unable to create a folder.',
'MODULE_COPY_FAILURE' => 'Unable to copy the following file: %1$s', 'MODULE_COPY_FAILURE' => 'Unable to copy the following file: %1$s',
'MODULE_CORRUPTED' => 'The module you are trying to upload seems to be corrupted.', 'MODULE_CORRUPTED' => 'The module you are trying to upload seems to be corrupted.',
'PORTAL_NEW_FILES' => 'New files',
'PORTAL_MODULE_SOURCE' => 'Source',
'PORTAL_MODULE_TARGET' => 'Target',
'PORTAL_MODULE_STATUS' => 'Status',
'PORTAL_MODULE_SUCCESS' => 'Success',
'PORTAL_MODULE_ERROR' => 'Error',
// Install // Install
'PORTAL_BASIC_INSTALL' => 'Adding basic set of modules', 'PORTAL_BASIC_INSTALL' => 'Adding basic set of modules',

View File

@@ -1039,6 +1039,7 @@ function board3_basic_install($mode = 'install', $purge_modules = true, $u_actio
set_config('board3_max_topics_' . $row['module_id'], $portal_config['portal_max_topics']); set_config('board3_max_topics_' . $row['module_id'], $portal_config['portal_max_topics']);
set_config('board3_recent_title_limit_' . $row['module_id'], $portal_config['portal_recent_title_limit']); set_config('board3_recent_title_limit_' . $row['module_id'], $portal_config['portal_recent_title_limit']);
set_config('board3_recent_forum_' . $row['module_id'], $portal_config['portal_recent_forum']); set_config('board3_recent_forum_' . $row['module_id'], $portal_config['portal_recent_forum']);
set_config('board3_recent_exclude_forums_' . $row['module_id'], $portal_config['portal_exclude_forums']);
break; break;
case 'topposters': case 'topposters':
@@ -1053,6 +1054,11 @@ function board3_basic_install($mode = 'install', $purge_modules = true, $u_actio
// do nothing // do nothing
} }
} }
// Now that we are done, delete all data that seems useless to us
$sql = 'DELETE FROM ' . PORTAL_CONFIG_TABLE . '
WHERE config_name ' . $db->sql_like_expression(utf8_clean_string('portal_') . $db->any_char);
$db->sql_query($sql);
} }
return $user->lang['PORTAL_CONVERT_SUCCESS']; return $user->lang['PORTAL_CONVERT_SUCCESS'];
} }
@@ -1075,7 +1081,7 @@ function board3_basic_install($mode = 'install', $purge_modules = true, $u_actio
'board3_phpbb_menu', 'board3_phpbb_menu',
'board3_display_jumpbox', 'board3_display_jumpbox',
); );
$sql = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE config_name ' . str_replace('\\', '', $db->sql_like_expression('board3_%')) . ' $sql = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE config_name ' . $db->sql_like_expression(utf8_clean_string('board3_') . $db->any_char) . '
AND ' . $db->sql_in_set('config_name', $skip_entries, true); AND ' . $db->sql_in_set('config_name', $skip_entries, true);
$db->sql_query($sql); $db->sql_query($sql);

View File

@@ -300,7 +300,6 @@ class portal_upload
} }
rename($to, $to . '.bak'); rename($to, $to . '.bak');
phpbb_chmod($to, CHMOD_ALL); phpbb_chmod($to, CHMOD_ALL);
unlink($to);
} }
if (!@copy($from, $to)) if (!@copy($from, $to))