aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-02 01:05:41 +0100
committerNils Adermann <naderman@naderman.de>2010-03-02 01:05:41 +0100
commit6ebc26e330d5e204eab0ac9061bb5817534047fe (patch)
tree417aa508a0b4282ec0ae1834ea02032e7e033d5f /phpBB/includes/mcp
parentf0eb18fffd11a97383c8ccf2ae7d2838939f09e2 (diff)
parent8d12b40fc4fdf50517e9584d14a5edd311953e7c (diff)
downloadforums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar
forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar.gz
forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar.bz2
forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar.xz
forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.zip
Merge commit 'release-3.0.6-RC3'
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_forum.php3
-rw-r--r--phpBB/includes/mcp/mcp_main.php12
-rw-r--r--phpBB/includes/mcp/mcp_topic.php87
3 files changed, 10 insertions, 92 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index acb7aa4ac0..b70601b479 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -416,14 +416,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
// If the topic no longer exist, we will update the topic watch table.
// To not let it error out on users watching both topics, we just return on an error...
- // Same for Bookmarks
$db->sql_return_on_error(true);
$db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
- $db->sql_query('UPDATE ' . BOOKMARKS_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
$db->sql_return_on_error(false);
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
- $db->sql_query('DELETE FROM ' . BOOKMARKS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids));
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 6c2ac0b521..50b05e989f 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -813,7 +813,14 @@ function mcp_delete_topic($topic_ids)
foreach ($data as $topic_id => $row)
{
- add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_' . ($row['topic_moved_id'] ? 'SHADOW_' : '') . 'TOPIC', $row['topic_title']);
+ if ($row['topic_moved_id'])
+ {
+ add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']);
+ }
+ else
+ {
+ add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
+ }
}
$return = delete_topics('topic_id', $topic_ids);
@@ -897,7 +904,8 @@ function mcp_delete_post($post_ids)
foreach ($post_data as $id => $row)
{
- add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject']);
+ $post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
+ add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username);
}
// Now delete the posts, topics and forums are automatically resync'ed
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index eb3d6d3970..abdb839e7b 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -504,45 +504,6 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
// Update forum statistics
set_config_count('num_topics', 1, true);
- // Add new topic to bookmarks
- $bookmarks = array();
- $sql = 'SELECT user_id
- FROM ' . BOOKMARKS_TABLE . '
- WHERE topic_id = ' . $topic_id;
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $bookmarks[] = array(
- 'user_id' => (int) $row['user_id'],
- 'topic_id' => $to_topic_id,
- );
- }
- $db->sql_freeresult($result);
- if (sizeof($bookmarks))
- {
- $db->sql_multi_insert(BOOKMARKS_TABLE, $bookmarks);
- }
-
- // Add new topic to watch-list
- $notifications = array();
- $sql = 'SELECT user_id, notify_status
- FROM ' . TOPICS_WATCH_TABLE . '
- WHERE topic_id = ' . $topic_id;
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $notifications[] = array(
- 'user_id' => (int) $row['user_id'],
- 'topic_id' => $to_topic_id,
- 'notify_status' => (int) $row['notify_status'],
- );
- }
- $db->sql_freeresult($result);
- if (sizeof($notifications))
- {
- $db->sql_multi_insert(TOPICS_WATCH_TABLE, $notifications);
- }
-
// Link back to both topics
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
}
@@ -636,65 +597,17 @@ function merge_posts($topic_id, $to_topic_id)
if ($row)
{
- // Add new topic to bookmarks
- $bookmarks = array();
- $sql = 'SELECT user_id
- FROM ' . BOOKMARKS_TABLE . '
- WHERE topic_id = ' . (int) $topic_id;
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $bookmarks[] = array(
- 'user_id' => (int) $row['user_id'],
- 'topic_id' => (int) $to_topic_id,
- );
- }
- $db->sql_freeresult($result);
- if (sizeof($bookmarks))
- {
- // To not let it error out on users, who already bookmarked the topic, we just return on an error...
- $db->sql_return_on_error(true);
- $db->sql_multi_insert(BOOKMARKS_TABLE, $bookmarks);
- $db->sql_return_on_error(false);
- }
-
- // Add new topic to notifications
- $notifications = array();
- $sql = 'SELECT user_id, notify_status
- FROM ' . TOPICS_WATCH_TABLE . '
- WHERE topic_id = ' . (int) $topic_id;
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $notifications[] = array(
- 'user_id' => (int) $row['user_id'],
- 'topic_id' => (int) $to_topic_id,
- 'notify_status' => (int) $row['notify_status'],
- );
- }
- $db->sql_freeresult($result);
- if (sizeof($notifications))
- {
- // To not let it error out on users, who already watch the topic, we just return on an error...
- $db->sql_return_on_error(true);
- $db->sql_multi_insert(TOPICS_WATCH_TABLE, $notifications);
- $db->sql_return_on_error(false);
- }
-
$return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
}
else
{
// If the topic no longer exist, we will update the topic watch table.
// To not let it error out on users watching both topics, we just return on an error...
- // Same for bookmarks
$db->sql_return_on_error(true);
$db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE topic_id = ' . (int) $topic_id);
- $db->sql_query('UPDATE ' . BOOKMARKS_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE topic_id = ' . (int) $topic_id);
$db->sql_return_on_error(false);
$db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $topic_id);
- $db->sql_query('DELETE FROM ' . BOOKMARKS_TABLE . ' WHERE topic_id = ' . (int) $topic_id);
}
// Link to the new topic