I just wonder that over 3 years that I am using q2a non of the flag fields has changed in my setups, all are value 0.
Mostly I find the flags in table qa_users instead.
When checking the source code I found these functions that set/change the flags in qa_uservotes:
function qa_db_userflag_set($postid, $userid, $flag)
/* Set the flag for $userid on $postid to $flag (true or false) in the database
*/
{
$flag=$flag ? 1 : 0;
qa_db_query_sub(
'INSERT INTO ^uservotes (postid, userid, vote, flag) VALUES (#, #, 0, #) ON DUPLICATE KEY UPDATE flag=#',
$postid, $userid, $flag, $flag
);
}
function qa_db_userflags_clear_all($postid)
/* Clear all flags for $postid in the database
*/
{
qa_db_query_sub(
'UPDATE ^uservotes SET flag=0 WHERE postid=#',
$postid
);
}
It would be great to see a usage example.