function unsubscribe_topic_func($xmlrpc_params)
{
    global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups;
    $lang->load("usercp");
    $input = Tapatalk_Input::filterXmlInput(array('topic_id' => Tapatalk_Input::INT), $xmlrpc_params);
    $thread = get_thread($input['topic_id']);
    if (!$thread['tid']) {
        return xmlrespfalse($lang->error_invalidthread);
    }
    remove_subscribed_thread($thread['tid']);
    return xmlresptrue();
}
示例#2
0
        $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
        if (!$thread) {
            error($lang->error_invalidthread);
        }
        // Is the currently logged in user a moderator of this forum?
        if (is_moderator($thread['fid'])) {
            $ismod = true;
        } else {
            $ismod = false;
        }
        // Make sure we are looking at a real thread here.
        if ($thread['visible'] != 1 && $ismod == false || $thread['visible'] > 1 && $ismod == true) {
            error($lang->error_invalidthread);
        }
        $plugins->run_hooks("usercp2_removesubscription_thread");
        remove_subscribed_thread($thread['tid']);
        if ($server_http_referer) {
            $url = $server_http_referer;
        } else {
            $url = "usercp.php?action=subscriptions";
        }
        redirect($url, $lang->redirect_subscriptionremoved);
    }
} elseif ($mybb->get_input('action') == "removesubscriptions") {
    if ($mybb->get_input('type') == "forum") {
        $plugins->run_hooks("usercp2_removesubscriptions_forum");
        $db->delete_query("forumsubscriptions", "uid='" . $mybb->user['uid'] . "'");
        if ($server_http_referer) {
            $url = $server_http_referer;
        } else {
            $url = "usercp.php?action=forumsubscriptions";