Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
193 views
in Q2A Core by

1 Answer

0 votes
by
For this you need a custom plugin.

To make it smoothly working with q2a core point system, you can just give extra BONUS points to users when they answer unanswered questions. So, by answering questions they will simply get a certain points inline with q2a core point system. Plus, for answering unanswered questions they will get a certain extra bonus points with a custom plugin.
by
Can't we directly add points in this function itself?
Like if result==post id , add bonus points to user.
by
yes, you can do it. try this.

function is_unanswered ($postid,$userid) {
$result = qa_db_read_one_value(
    qa_db_query_sub(
        'SELECT postid
        FROM ^posts
        WHERE postid=$ AND acount = 0 AND type = 'Q',
        $postid
        ), true);

$add_amount = 15; //how much bonus you want to award

if ($result == $postid) {
            add_bonus ($userid, $add_amount);
        } else {
            return;             
        }
}

function add_bonus ($userid, $add_amount) {
    $current_bonus = qa_db_query_sub(
        'SELECT bonus
        FROM ^userpoints
        WHERE userid=$,
        $userid
        );
$new_bonus = $current_bonus +$add_amount;

qa_db_query_sub(
            "UPDATE ^userpoints
            SET bonus = $
            WHERE userid= #",
            $new_bonus ,$userid
        );
}
by
Sure I will try this. Thank you

If acount = 0 add amount= 15
If acount = 1 add amount = 5 etc can also be done.
Am I right?
by
If you do the function, yes you can.
...