diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2003-10-12 09:11:33 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2003-10-12 09:11:33 +0000 |
commit | 7924d903b08967428656b2b53557063e55a15735 (patch) | |
tree | 747e05e7ffd26e89189ee50fdfd13c132b6b1d85 /phpBB/includes/functions_admin.php | |
parent | 32683fda12560c778a0d622d36e575db27cbb75a (diff) | |
download | forums-7924d903b08967428656b2b53557063e55a15735.tar forums-7924d903b08967428656b2b53557063e55a15735.tar.gz forums-7924d903b08967428656b2b53557063e55a15735.tar.bz2 forums-7924d903b08967428656b2b53557063e55a15735.tar.xz forums-7924d903b08967428656b2b53557063e55a15735.zip |
comment out optimize block (Ashe, please review)
moved phpbb_unlink to functions_admin (used in more than one script)
git-svn-id: file:///svn/phpbb/trunk@4572 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 52b50b7077..bffe9451a8 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -342,6 +342,8 @@ function delete_topics($where_type, $where_ids, $auto_sync = TRUE) sync('topic_reported', $where_type, $where_ids); } + // Not an option here, deleting one post takes > 200 seconds for me (only this query) +/* // Optimize/vacuum tables switch (SQL_LAYER) { @@ -358,6 +360,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = TRUE) $db->sql_query('VACUUM'); break; } +*/ return $return; } @@ -418,6 +421,8 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE) sync('forum', 'forum_id', $forum_ids, TRUE); } + // Not an option here, deleting one post takes > 200 seconds for me (only this query) +/* // Optimize/vacuum tables switch (SQL_LAYER) { @@ -434,6 +439,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE) $db->sql_query('VACUUM'); break; } +*/ return count($post_ids); } @@ -693,6 +699,32 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE) } } +// Delete File +function phpbb_unlink($filename, $mode = 'file') +{ + global $config, $user; + + $filename = ($mode == 'thumbnail') ? $config['upload_dir'] . '/thumbs/t_' . $filename : $config['upload_dir'] . '/' . $filename; + $deleted = @unlink($filename); + + if (file_exists($filename)) + { + $filesys = str_replace('/','\\', $filename); + $deleted = @system("del $filesys"); + + if (file_exists($filename)) + { + @chmod($filename, 0777); + if (!($deleted = @unlink($filename))) + { + $deleted = @system("del $filename"); + } + } + } + + return $deleted; +} + // All-encompasing sync function // // Usage: |