addBreadCrumb(['link' => ADMIN.'migrate.php'.fusion_get_aidlink(), 'title' => $locale['MIG_100']]); opentable($locale['MIG_100']); if (isset($_POST['migrate'])) { $user_primary_id = form_sanitizer($_POST['user_primary'], '', 'user_primary'); $user_temp_id = form_sanitizer($_POST['user_migrate'], '', 'user_migrate'); if ($user_primary_id == $user_temp_id || !isnum($user_primary_id) || !isnum($user_temp_id)) { \defender::stop(); addNotice('danger', $locale['MIG_101']); redirect(FUSION_REQUEST); } if (\defender::safe()) { $result = dbquery("SELECT user_id, user_name FROM ".DB_USERS." WHERE user_id=:userid", [':userid' => $user_primary_id]); if (dbrows($result) > 0) { $result2 = dbquery("SELECT user_id, user_name FROM ".DB_USERS." WHERE user_id=:userid", [':userid' => $user_temp_id]); if (dbrows($result2) > 0) { if (isset($_POST['forum']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_FORUM_THREAD_NOTIFY, 'notify_user', $locale['MIG_102']); user_posts_migrate($user_primary_id, $user_temp_id, DB_FORUM_THREADS, 'thread_author', $locale['MIG_103']); user_posts_migrate($user_primary_id, $user_temp_id, DB_FORUM_THREADS, 'thread_lastuser', $locale['MIG_104']); user_posts_migrate($user_primary_id, $user_temp_id, DB_FORUM_POSTS, 'post_author', $locale['MIG_105']); user_posts_migrate($user_primary_id, $user_temp_id, DB_FORUMS, 'forum_lastuser', $locale['MIG_106']); user_posts_migrate($user_primary_id, $user_temp_id, DB_FORUM_POLL_VOTERS, 'forum_vote_user_id', $locale['MIG_107']); user_posts_migrate($user_primary_id, $user_temp_id, DB_FORUM_VOTES, 'vote_user', $locale['MIG_108']); user_posts_migrate($user_primary_id, $user_temp_id, DB_USERS, 'user_reputation', $locale['MIG_109']); $posts = dbcount("(post_id)", DB_FORUM_POSTS, "post_author=:postauthor", [':postauthor' => $user_temp_id]); if ($posts > 0) { dbquery("UPDATE ".DB_USERS." SET user_posts=:userposts WHERE user_id=:userid", [':userposts' => $posts, ':userid' => $user_primary_id]); } } if (isset($_POST['comments']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_COMMENTS, 'comment_name', $locale['MIG_115']); } if (isset($_POST['ratings']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_RATINGS, 'rating_user', $locale['MIG_116']); } if (isset($_POST['messages']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_MESSAGES, 'message_to', $locale['MIG_117']); user_posts_migrate($user_primary_id, $user_temp_id, DB_MESSAGES, 'message_from', $locale['MIG_118']); user_posts_migrate($user_primary_id, $user_temp_id, DB_MESSAGES, 'message_user', $locale['MIG_119']); $result = dbquery("DELETE FROM ".DB_MESSAGES."_options WHERE user_id=:userid", [':userid' => $user_temp_id]); } if (isset($_POST['polls']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_POLL_VOTES, 'vote_user', $locale['MIG_120']); } if (isset($_POST['shoutbox']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_SHOUTBOX, 'shout_name', $locale['MIG_121']); } if (isset($_POST['articles']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_ARTICLES, 'article_name', $locale['MIG_122']); } if (isset($_POST['faq']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_FAQS, 'faq_name', $locale['MIG_123']); } if (isset($_POST['news']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_NEWS, 'news_name', $locale['MIG_124']); } if (isset($_POST['blog']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_BLOG, 'blog_name', $locale['MIG_125']); } if (isset($_POST['downloads']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_DOWNLOADS, 'download_user', $locale['MIG_126']); } if (isset($_POST['photos']) == '1') { user_posts_migrate($user_primary_id, $user_temp_id, DB_PHOTOS, 'photo_user', $locale['MIG_127']); } if (isset($_POST['user_level']) == '1') { user_rights_migrate($user_primary_id, $user_temp_id); } if (isset($_POST['del_user']) == '1') { $result = dbquery("DELETE FROM ".DB_USERS." WHERE user_id=:userid", [':userid' => $user_temp_id]); } else { require_once INCLUDES."suspend_include.php"; $result = dbquery("UPDATE ".DB_USERS." SET user_status=:status WHERE user_id=:userid", [':status' => '7', ':userid' => $user_temp_id]); suspend_log($user_temp_id, '7', $locale['MIG_130']); } } else { addNotice('danger', $locale['MIG_131']); } } else { addNotice('danger', $locale['MIG_132']); } } } else { user_posts_migrate_console(); } closetable(); function user_posts_migrate_console() { $locale = fusion_get_locale(); $chkbox = [ 'user_level' => [ 'value' => !empty($_POST['user_level']) ? $_POST['user_level'] : 0, 'text' => $locale['MIG_150'], 'active' => TRUE ], 'messages' => [ 'value' => !empty($_POST['messages']) ? $_POST['messages'] : 0, 'text' => $locale['MIG_151'], 'active' => TRUE ], 'comments' => [ 'value' => !empty($_POST['comments']) ? $_POST['comments'] : 0, 'text' => $locale['MIG_152'], 'active' => TRUE ], 'ratings' => [ 'value' => !empty($_POST['ratings']) ? $_POST['ratings'] : 0, 'text' => $locale['MIG_153'], 'active' => TRUE ], 'forum' => [ 'value' => !empty($_POST['forum']) ? $_POST['forum'] : 0, 'text' => $locale['MIG_154'], 'active' => defined('FORUM_EXIST') ? TRUE : FALSE ], 'articles' => [ 'value' => !empty($_POST['articles']) ? $_POST['articles'] : 0, 'text' => $locale['MIG_155'], 'active' => defined('ARTICLES_EXIST') ? TRUE : FALSE ], 'faq' => [ 'value' => !empty($_POST['faq']) ? $_POST['faq'] : 0, 'text' => $locale['MIG_156'], 'active' => defined('FAQ_EXIST') ? TRUE : FALSE ], 'polls' => [ 'value' => !empty($_POST['polls']) ? $_POST['polls'] : 0, 'text' => $locale['MIG_157'], 'active' => defined('MEMBER_POLL_PANEL_EXIST') ? TRUE : FALSE ], 'news' => [ 'value' => !empty($_POST['news']) ? $_POST['news'] : 0, 'text' => $locale['MIG_158'], 'active' => defined('NEWS_EXIST') ? TRUE : FALSE ], 'blog' => [ 'value' => !empty($_POST['blog']) ? $_POST['blog'] : 0, 'text' => $locale['MIG_159'], 'active' => defined('BLOG_EXIST') ? TRUE : FALSE ], 'downloads' => [ 'value' => !empty($_POST['downloads']) ? $_POST['downloads'] : 0, 'text' => $locale['MIG_160'], 'active' => defined('DOWNLOADS_EXIST') ? TRUE : FALSE ], 'photos' => [ 'value' => !empty($_POST['photos']) ? $_POST['photos'] : 0, 'text' => $locale['MIG_161'], 'active' => defined('GALLERY_EXIST') ? TRUE : FALSE ], 'shoutbox' => [ 'value' => !empty($_POST['shoutbox']) ? $_POST['shoutbox'] : 0, 'text' => $locale['MIG_162'], 'active' => defined('SHOUTBOX_PANEL_EXIST') ? TRUE : FALSE ], ]; echo openform('inputform', 'post', FUSION_REQUEST); echo "