Пример #1
0
function m_merge_post_func($xmlrpc_params)
{
    global $input, $post, $thread, $forum, $pid, $tid, $fid, $modlogdata, $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups, $moderation, $parser;
    $input = Tapatalk_Input::filterXmlInput(array('post_ids' => Tapatalk_Input::STRING, 'post_id' => Tapatalk_Input::STRING), $xmlrpc_params);
    $post = get_post($input['post_id']);
    $tid = $post['tid'];
    $post_ids = explode(',', $input['post_ids']);
    mod_setup();
    array_push($post_ids, $input['post_id']);
    $postlist = array_unique($post_ids);
    if (count($postlist) <= 1) {
        error($lang->error_nomergeposts);
    }
    if (!is_moderator_by_pids($postlist, "canmanagethreads")) {
        error_no_permission();
    }
    foreach ($postlist as $pid) {
        $pid = intval($pid);
        $plist[] = $pid;
    }
    $masterpid = $moderation->merge_posts($plist, $tid, 'hr');
    mark_reports($plist, "posts");
    log_moderator_action($modlogdata, $lang->merged_selective_posts);
    $response = new xmlrpcval(array('result' => new xmlrpcval(true, 'boolean'), 'is_login_mod' => new xmlrpcval(true, 'boolean'), 'result_text' => new xmlrpcval("", 'base64')), 'struct');
    return new xmlrpcresp($response);
}
         moderation_redirect(get_forum_link($fid), $lang->redirect_customtool_forum);
     } else {
         $lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
         moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_customtool_thread);
     }
     break;
 } elseif ($tool['type'] == 'p' && $mybb->input['modtype'] == 'inlinepost') {
     if ($mybb->input['inlinetype'] == 'search') {
         $pids = getids($mybb->input['searchid'], 'search');
     } else {
         $pids = getids($tid, 'thread');
     }
     if (count($pids) < 1) {
         error($lang->error_inline_nopostsselected);
     }
     if (!is_moderator_by_pids($pids)) {
         error_no_permission();
     }
     // Get threads which are associated with the posts
     $tids = array();
     $options = array('order_by' => 'dateline', 'order_dir' => 'asc');
     $query = $db->simple_select("posts", "DISTINCT tid", "pid IN (" . implode(',', $pids) . ")", $options);
     while ($row = $db->fetch_array($query)) {
         $tids[] = $row['tid'];
     }
     $ret = $custommod->execute(intval($mybb->input['action']), $tids, $pids);
     $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']);
     log_moderator_action($modlogdata, $lang->custom_tool);
     if ($mybb->input['inlinetype'] == 'search') {
         clearinline($mybb->input['searchid'], 'search');
         $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);
Пример #3
0
         moderation_redirect(get_forum_link($fid), $lang->redirect_customtool_forum);
     } else {
         $lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
         moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_customtool_thread);
     }
     break;
 } elseif ($tool['type'] == 'p' && $mybb->get_input('modtype') == 'inlinepost') {
     if ($mybb->get_input('inlinetype') == 'search') {
         $pids = getids($mybb->get_input('searchid'), 'search');
     } else {
         $pids = getids($tid, 'thread');
     }
     if (count($pids) < 1) {
         error($lang->error_inline_nopostsselected);
     }
     if (!is_moderator_by_pids($pids, "canusecustomtools")) {
         error_no_permission();
     }
     // Get threads which are associated with the posts
     $tids = array();
     $options = array('order_by' => 'dateline', 'order_dir' => 'asc');
     $query = $db->simple_select("posts", "DISTINCT tid", "pid IN (" . implode(',', $pids) . ")", $options);
     while ($row = $db->fetch_array($query)) {
         $tids[] = $row['tid'];
     }
     $ret = $custommod->execute($mybb->get_input('action', MyBB::INPUT_INT), $tids, $pids);
     $lang->custom_tool = $lang->sprintf($lang->custom_tool, $tool['name']);
     log_moderator_action($modlogdata, $lang->custom_tool);
     if ($mybb->get_input('inlinetype') == 'search') {
         clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
         $lang->redirect_customtool_search = $lang->sprintf($lang->redirect_customtool_search, $tool['name']);