Ejemplo n.º 1
0
function qa_flag_clear($post, $userid, $handle, $cookieid)
{
    require_once QA_INCLUDE_DIR . 'qa-db-votes.php';
    require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
    qa_db_userflag_set($post['postid'], $userid, false);
    qa_db_post_recount_flags($post['postid']);
    switch ($post['basetype']) {
        case 'Q':
            $action = 'q_unflag';
            break;
        case 'A':
            $action = 'a_unflag';
            break;
        case 'C':
            $action = 'c_unflag';
            break;
    }
    qa_report_write_action($userid, null, $action, $post['basetype'] == 'Q' ? $post['postid'] : null, $post['basetype'] == 'A' ? $post['postid'] : null, $post['basetype'] == 'C' ? $post['postid'] : null);
    qa_report_event($action, $userid, $handle, $cookieid, array('postid' => $post['postid']));
}
Ejemplo n.º 2
0
function qa_flag_clear($oldpost, $userid, $handle, $cookieid)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    require_once QA_INCLUDE_DIR . 'db/votes.php';
    require_once QA_INCLUDE_DIR . 'app/limits.php';
    require_once QA_INCLUDE_DIR . 'db/post-update.php';
    qa_db_userflag_set($oldpost['postid'], $userid, false);
    qa_db_post_recount_flags($oldpost['postid']);
    qa_db_flaggedcount_update();
    switch ($oldpost['basetype']) {
        case 'Q':
            $event = 'q_unflag';
            break;
        case 'A':
            $event = 'a_unflag';
            break;
        case 'C':
            $event = 'c_unflag';
            break;
    }
    qa_report_event($event, $userid, $handle, $cookieid, array('postid' => $oldpost['postid'], 'oldpost' => $oldpost));
}