diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2004-05-02 13:06:57 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-05-02 13:06:57 +0000 |
| commit | 729c3abd02fc564fb99be53ba5fba450a073197f (patch) | |
| tree | 625496783aefb4310826381bcb69aec6558858ad /phpBB/adm/admin_forums.php | |
| parent | 67d2ac36679f6c38fecaf157d2bc837daa237c41 (diff) | |
| download | forums-729c3abd02fc564fb99be53ba5fba450a073197f.tar forums-729c3abd02fc564fb99be53ba5fba450a073197f.tar.gz forums-729c3abd02fc564fb99be53ba5fba450a073197f.tar.bz2 forums-729c3abd02fc564fb99be53ba5fba450a073197f.tar.xz forums-729c3abd02fc564fb99be53ba5fba450a073197f.zip | |
fix some issues with oop, fixing small bugs and prepare the next steps...
NOTE TO DEVS: have a look at adm/admin_board.php (new config layout)
git-svn-id: file:///svn/phpbb/trunk@4883 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm/admin_forums.php')
| -rw-r--r-- | phpBB/adm/admin_forums.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php index 19cab76e6b..fb203999f5 100644 --- a/phpBB/adm/admin_forums.php +++ b/phpBB/adm/admin_forums.php @@ -1332,28 +1332,27 @@ function delete_forum_content($forum_id) // Use delete_attachments('topic', $ids, false) here... // Select then delete all attachments - $sql = 'SELECT a.physical_filename, a.thumbnail + $sql = 'SELECT a.topic_id FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a WHERE p.forum_id = $forum_id - AND a.post_id = p.post_id"; + AND a.in_message = 0 + AND a.topic_id = p.topic_id"; $result = $db->sql_query($sql); + $topic_ids = array(); while ($row = $db->sql_fetchrow($result)) { - phpbb_unlink($row['physical_filename'], 'file'); - if ($row['thumbnail']) - { - phpbb_unlink($row['physical_filename'], 'thumbnail'); - } + $topic_ids[] = $row['topic_id']; } $db->sql_freeresult($result); + + delete_attachments('topic', $topic_ids, false); // Delete everything else and thank MySQL for offering multi-table deletion $tables_ary = array( SEARCH_MATCH_TABLE => 'wm.post_id', RATINGS_TABLE => 'ra.post_id', REPORTS_TABLE => 're.post_id', - ATTACHMENTS_TABLE => 'a.post_id', TOPICS_WATCH_TABLE => 'tw.topic_id', TOPICS_TRACK_TABLE => 'tt.topic_id', POLL_OPTIONS_TABLE => 'po.post_id', @@ -1391,7 +1390,8 @@ function delete_forum_content($forum_id) $sql = 'SELECT a.attach_id, a.physical_filename, a.thumbnail FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_TABLE . " a WHERE p.forum_id = $forum_id - AND a.post_id = p.post_id"; + AND a.in_message = 0 + AND a.post_msg_id = p.post_id"; $result = $db->sql_query($sql); $attach_ids = array(); |
