Пример #1
0
function mark_all_as_read_func($xmlrpc_params)
{
    global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups, $forum_cache;
    $input = Tapatalk_Input::filterXmlInput(array('forum_id' => Tapatalk_Input::INT), $xmlrpc_params);
    if (!empty($input['forum_id'])) {
        $validforum = get_forum($input['forum_id']);
        if (!$validforum) {
            return xmlrespfalse('Invalid forum');
        }
        require_once MYBB_ROOT . "/inc/functions_indicators.php";
        mark_forum_read($input['forum_id']);
    } else {
        require_once MYBB_ROOT . "/inc/functions_indicators.php";
        mark_all_forums_read();
    }
    return xmlresptrue();
}
Пример #2
0
                exit;
            }
        }
        require_once MYBB_ROOT . "/inc/functions_indicators.php";
        mark_forum_read($mybb->input['fid']);
        $plugins->run_hooks("misc_markread_forum");
        if (!isset($mybb->input['ajax'])) {
            redirect(get_forum_link($mybb->input['fid']), $lang->redirect_markforumread);
        } else {
            echo 1;
            exit;
        }
    } else {
        $plugins->run_hooks("misc_markread_end");
        require_once MYBB_ROOT . "/inc/functions_indicators.php";
        mark_all_forums_read();
        redirect("index.php", $lang->redirect_markforumsread);
    }
} elseif ($mybb->input['action'] == "clearpass") {
    $plugins->run_hooks("misc_clearpass");
    if (isset($mybb->input['fid'])) {
        if (!verify_post_check($mybb->get_input('my_post_key'))) {
            error($lang->invalid_post_code);
        }
        my_unsetcookie("forumpass[" . $mybb->get_input('fid', MyBB::INPUT_INT) . "]");
        redirect("index.php", $lang->redirect_forumpasscleared);
    }
} elseif ($mybb->input['action'] == "rules") {
    if (isset($mybb->input['fid'])) {
        $plugins->run_hooks("misc_rules_start");
        $fid = $mybb->input['fid'];
Пример #3
0
 /**
  * Marks one or more forums read
  *
  * @param integer $forum_id If Forum ID is set to 0 all forums will be marked as read
  * @param string $redirect_url If there should be a redirection afterwards, define the URL here
  * @return boolean Only returns false if it fails, otherwise, if it does not redirect, it returns true
  */
 function markRead($id = 0, $redirect_url = '')
 {
     // "Mark-Read" functions are located in inc/functions_indicators.php
     require_once MYBB_ROOT . "/inc/functions_indicators.php";
     // Make sure the ID is a number
     $id = intval($id);
     // If the given Forum ID is 0, it tells us that we shall mark all forums as read
     if ($id == 0) {
         mark_all_forums_read();
         // If we want to redirect to an url, we do so
         if ($redirect_url != '') {
             redirect($redirect_url, $this->lang->redirect_markforumsread);
         }
     } else {
         // Does the Forum exist?
         $validforum = $this->getForum($id);
         // If the forum is invalid, marking as read failed
         if (!$validforum) {
             return false;
         }
         // If we want to redirect to an url, we do so
         if ($redirect_url != '') {
             redirect($redirect_url, $this->lang->redirect_markforumsread);
         }
     }
     return true;
 }