Update the cached count in the database of the number of unanswered questions (excluding hidden/queued)
Update the cached count in the database of the number of unanswered questions (excluding hidden/queued)
*/
*/
{
{
if(qa_should_update_counts())
if(qa_should_update_counts()){
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND acount=0 AND closedbyid IS NULL");
qa_db_query_sub(
"INSERT INTO ^options (title, content) ".
"SELECT 'cache_unaqcount', COUNT(*) FROM ^posts ".
"WHERE type = 'Q' AND acount = 0 AND closedbyid IS NULL ".
Update the cached count in the database of the number of questions with no answer selected (excluding hidden/queued)
Update the cached count in the database of the number of questions with no answer selected (excluding hidden/queued)
*/
*/
{
{
if(qa_should_update_counts())
if(qa_should_update_counts()){
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unselqcount', COUNT(*) FROM ^posts WHERE type='Q' AND selchildid IS NULL AND closedbyid IS NULL");
qa_db_query_sub(
"INSERT INTO ^options (title, content) ".
"SELECT 'cache_unselqcount', COUNT(*) FROM ^posts ".
"WHERE type = 'Q' AND selchildid IS NULL AND closedbyid IS NULL ".
Update the cached count in the database of the number of questions with no upvoted answers (excluding hidden/queued)
Update the cached count in the database of the number of questions with no upvoted answers (excluding hidden/queued)
*/
*/
{
{
if(qa_should_update_counts())
if(qa_should_update_counts()){
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_unupaqcount', COUNT(*) FROM ^posts WHERE type='Q' AND amaxvote=0 AND closedbyid IS NULL");
qa_db_query_sub(
"INSERT INTO ^options (title, content) ".
"SELECT 'cache_unupaqcount', COUNT(*) FROM ^posts ".
"WHERE type = 'Q' AND amaxvote = 0 AND closedbyid IS NULL ".
Update the cached count in the database of the number of posts which are queued for moderation
Update the cached count in the database of the number of posts which are queued for moderation
*/
*/
{
{
if(qa_should_update_counts())
if(qa_should_update_counts()){
qa_db_query_sub("REPLACE ^options (title, content) SELECT 'cache_queuedcount', COUNT(*) FROM ^posts WHERE type IN ('Q_QUEUED', 'A_QUEUED', 'C_QUEUED')");
qa_db_query_sub(
"INSERT INTO ^options (title, content) ".
"SELECT 'cache_queuedcount', COUNT(*) FROM ^posts ".
"WHERE type IN ('Q_QUEUED', 'A_QUEUED', 'C_QUEUED') ".