aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2012-09-03 15:18:30 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2012-12-13 20:19:26 -0600
commit8dd2a151cc53a5482fcf462736cf5c2eabccf599 (patch)
tree21c4ce6891a4b50541d2d1c3df9fd4f8426914bb /phpBB/includes/mcp
parentabcc59fca6bd5d899adbec248ba60db6c013e6a2 (diff)
downloadforums-8dd2a151cc53a5482fcf462736cf5c2eabccf599.tar
forums-8dd2a151cc53a5482fcf462736cf5c2eabccf599.tar.gz
forums-8dd2a151cc53a5482fcf462736cf5c2eabccf599.tar.bz2
forums-8dd2a151cc53a5482fcf462736cf5c2eabccf599.tar.xz
forums-8dd2a151cc53a5482fcf462736cf5c2eabccf599.zip
[ticket/8610] Update Bookmarks when forking topics
Update bookmarks to the new topic when forking topics using the mcp_fork_topic function. PHPBB3-8610
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_main.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index ffede11d37..f7c49539ea 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -1251,6 +1251,26 @@ function mcp_fork_topic($topic_ids)
{
$db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary);
}
+
+ $sql = 'SELECT user_id
+ FROM ' . BOOKMARKS_TABLE . '
+ WHERE topic_id = ' . $topic_id;
+ $result = $db->sql_query($sql);
+
+ $sql_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql_ary[] = array(
+ 'topic_id' => (int) $new_topic_id,
+ 'user_id' => (int) $row['user_id'],
+ );
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($sql_ary))
+ {
+ $db->sql_multi_insert(BOOKMARKS_TABLE, $sql_ary);
+ }
}
// Sync new topics, parent forums and board stats
@@ -1314,4 +1334,4 @@ function mcp_fork_topic($topic_ids)
}
}
-?> \ No newline at end of file
+?>