Hello, this change working good, but it's updating qa_catpoints ONLY points column, NO updates for netvotes, aselecteds. Maybe there is some bug in query? Can You check this, please? :)
Maybe this will help You: when I commented query 1 to run:
// qa_db_query_raw(str_replace('~', "='".qa_db_escape_string($userid)."'", qa_db_apply_sub($query1, array($userid))));
and uncomment query2 with same code, it's working correctly. So this code need some fix, to run all queries in one run, not only first :)