diff options
| author | Maat <maat-pub@mageia.biz> | 2013-11-30 14:43:45 +0100 |
|---|---|---|
| committer | Maat <maat-pub@mageia.biz> | 2013-11-30 14:47:18 +0100 |
| commit | 33193de3c84f52917ba5c340591cc2d97dc42ebb (patch) | |
| tree | 4b6635e7e8e8b9e69a3e58689a6f9c1241dee8f3 /phpBB/includes/mcp/mcp_main.php | |
| parent | 41b19431251f19f607d192a555fdf1e57fb36643 (diff) | |
| parent | 446ea9928d8373cf7695d3adda6d5ee30d5f94b4 (diff) | |
| download | forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.gz forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.bz2 forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.tar.xz forums-33193de3c84f52917ba5c340591cc2d97dc42ebb.zip | |
Merge remote-tracking branch 'upstream/prep-release-3.0.12'
Diffstat (limited to 'phpBB/includes/mcp/mcp_main.php')
| -rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index ffede11d37..0cef8933fc 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -1231,6 +1231,7 @@ function mcp_fork_topic($topic_ids) } } + // Copy topic subscriptions to new topic $sql = 'SELECT user_id, notify_status FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . $topic_id; @@ -1251,6 +1252,27 @@ function mcp_fork_topic($topic_ids) { $db->sql_multi_insert(TOPICS_WATCH_TABLE, $sql_ary); } + + // Copy bookmarks to new topic + $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 |
