Commit 9aed0ff9 by Scott

Coding style (misc voting code)

parent f54156e6
...@@ -33,8 +33,9 @@ if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) { ...@@ -33,8 +33,9 @@ if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) {
$state = qa_post_text('state'); $state = qa_post_text('state');
$stoptime = time() + 3; $stoptime = time() + 3;
while (qa_recalc_perform_step($state) && time() < $stoptime) while (qa_recalc_perform_step($state) && time() < $stoptime) {
; // wait
}
$message = qa_recalc_get_message($state); $message = qa_recalc_get_message($state);
} }
......
...@@ -35,10 +35,9 @@ $code = qa_post_text('code'); ...@@ -35,10 +35,9 @@ $code = qa_post_text('code');
$userid = qa_get_logged_in_userid(); $userid = qa_get_logged_in_userid();
$cookieid = qa_cookie_get(); $cookieid = qa_cookie_get();
if (!qa_check_form_security_code('vote', $code)) if (!qa_check_form_security_code('vote', $code)) {
$voteerror = qa_lang_html('misc/form_security_reload'); $voteerror = qa_lang_html('misc/form_security_reload');
} else {
else {
$post = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $postid)); $post = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $postid));
$voteerror = qa_vote_error_html($post, $vote, $userid, qa_request()); $voteerror = qa_vote_error_html($post, $vote, $userid, qa_request());
} }
......
...@@ -100,8 +100,9 @@ function qa_recalc_perform_step(&$state) ...@@ -100,8 +100,9 @@ function qa_recalc_perform_step(&$state)
foreach ($pages as $pageid => $page) { foreach ($pages as $pageid => $page) {
if (!($page['flags'] & QA_PAGE_FLAGS_EXTERNAL)) { if (!($page['flags'] & QA_PAGE_FLAGS_EXTERNAL)) {
$searchmodules = qa_load_modules_with('search', 'unindex_page'); $searchmodules = qa_load_modules_with('search', 'unindex_page');
foreach ($searchmodules as $searchmodule) foreach ($searchmodules as $searchmodule) {
$searchmodule->unindex_page($pageid); $searchmodule->unindex_page($pageid);
}
$searchmodules = qa_load_modules_with('search', 'index_page'); $searchmodules = qa_load_modules_with('search', 'index_page');
if (count($searchmodules)) { if (count($searchmodules)) {
...@@ -117,8 +118,9 @@ function qa_recalc_perform_step(&$state) ...@@ -117,8 +118,9 @@ function qa_recalc_perform_step(&$state)
$done += count($pages); $done += count($pages);
$continue = true; $continue = true;
} else } else {
qa_recalc_transition($state, 'doreindexcontent_postcount'); qa_recalc_transition($state, 'doreindexcontent_postcount');
}
break; break;
case 'doreindexcontent_postcount': case 'doreindexcontent_postcount':
...@@ -200,8 +202,9 @@ function qa_recalc_perform_step(&$state) ...@@ -200,8 +202,9 @@ function qa_recalc_perform_step(&$state)
$done += count($postids); $done += count($postids);
$continue = true; $continue = true;
} else } else {
qa_recalc_transition($state, 'dorecountposts_acount'); qa_recalc_transition($state, 'dorecountposts_acount');
}
break; break;
case 'dorecountposts_acount': case 'dorecountposts_acount':
...@@ -243,13 +246,13 @@ function qa_recalc_perform_step(&$state) ...@@ -243,13 +246,13 @@ function qa_recalc_perform_step(&$state)
qa_db_users_recalc_points($next, $lastuserid); qa_db_users_recalc_points($next, $lastuserid);
$done += $recalccount; $done += $recalccount;
} else } else {
$lastuserid = $next; // for truncation $lastuserid = $next; // for truncation
}
if ($gotcount > $recalccount) { // more left to do if ($gotcount > $recalccount) { // more left to do
$next = $userids[$recalccount]; // start next round at first one not recalculated $next = $userids[$recalccount]; // start next round at first one not recalculated
$continue = true; $continue = true;
} else { } else {
qa_db_truncate_userpoints($lastuserid); qa_db_truncate_userpoints($lastuserid);
qa_db_userpointscount_update(); // quick so just do it here qa_db_userpointscount_update(); // quick so just do it here
...@@ -289,31 +292,35 @@ function qa_recalc_perform_step(&$state) ...@@ -289,31 +292,35 @@ function qa_recalc_perform_step(&$state)
$posts = array($questionid => $question); $posts = array($questionid => $question);
foreach ($childposts as $postid => $post) foreach ($childposts as $postid => $post) {
$posts[$postid] = $post; $posts[$postid] = $post;
}
foreach ($achildposts as $postid => $post) foreach ($achildposts as $postid => $post) {
$posts[$postid] = $post; $posts[$postid] = $post;
}
// Creation and editing of each post // Creation and editing of each post
foreach ($posts as $postid => $post) { foreach ($posts as $postid => $post) {
$followonq = ($post['basetype'] == 'Q') && ($postid != $questionid); $followonq = ($post['basetype'] == 'Q') && ($postid != $questionid);
if ($followonq) if ($followonq) {
$updatetype = QA_UPDATE_FOLLOWS; $updatetype = QA_UPDATE_FOLLOWS;
elseif ($post['basetype'] == 'C' && @$posts[$post['parentid']]['basetype'] == 'Q') } elseif ($post['basetype'] == 'C' && @$posts[$post['parentid']]['basetype'] == 'Q') {
$updatetype = QA_UPDATE_C_FOR_Q; $updatetype = QA_UPDATE_C_FOR_Q;
elseif ($post['basetype'] == 'C' && @$posts[$post['parentid']]['basetype'] == 'A') } elseif ($post['basetype'] == 'C' && @$posts[$post['parentid']]['basetype'] == 'A') {
$updatetype = QA_UPDATE_C_FOR_A; $updatetype = QA_UPDATE_C_FOR_A;
else } else {
$updatetype = null; $updatetype = null;
}
qa_create_event_for_q_user($questionid, $postid, $updatetype, $post['userid'], @$posts[$post['parentid']]['userid'], $post['created']); qa_create_event_for_q_user($questionid, $postid, $updatetype, $post['userid'], @$posts[$post['parentid']]['userid'], $post['created']);
if (isset($post['updated']) && !$followonq) if (isset($post['updated']) && !$followonq) {
qa_create_event_for_q_user($questionid, $postid, $post['updatetype'], $post['lastuserid'], $post['userid'], $post['updated']); qa_create_event_for_q_user($questionid, $postid, $post['updatetype'], $post['lastuserid'], $post['userid'], $post['updated']);
} }
}
// Tags and categories of question // Tags and categories of question
...@@ -324,9 +331,11 @@ function qa_recalc_perform_step(&$state) ...@@ -324,9 +331,11 @@ function qa_recalc_perform_step(&$state)
$parentidcomments = array(); $parentidcomments = array();
foreach ($posts as $postid => $post) foreach ($posts as $postid => $post) {
if ($post['basetype'] == 'C') if ($post['basetype'] == 'C') {
$parentidcomments[$post['parentid']][$postid] = $post; $parentidcomments[$post['parentid']][$postid] = $post;
}
}
// For each comment thread, notify all previous comment authors of each comment in the thread (could get slow) // For each comment thread, notify all previous comment authors of each comment in the thread (could get slow)
...@@ -342,18 +351,20 @@ function qa_recalc_perform_step(&$state) ...@@ -342,18 +351,20 @@ function qa_recalc_perform_step(&$state)
} }
} }
if (isset($comment['userid'])) if (isset($comment['userid'])) {
$keyuserids[$comment['userid']] = true; $keyuserids[$comment['userid']] = true;
} }
} }
} }
}
$next = 1 + $lastquestionid; $next = 1 + $lastquestionid;
$done += count($questionids); $done += count($questionids);
$continue = true; $continue = true;
} else } else {
qa_recalc_transition($state, 'dorefillevents_complete'); qa_recalc_transition($state, 'dorefillevents_complete');
}
break; break;
case 'dorecalccategories': case 'dorecalccategories':
...@@ -379,7 +390,6 @@ function qa_recalc_perform_step(&$state) ...@@ -379,7 +390,6 @@ function qa_recalc_perform_step(&$state)
$next = 1 + $lastpostid; $next = 1 + $lastpostid;
$done += count($postids); $done += count($postids);
$continue = true; $continue = true;
} else { } else {
qa_recalc_transition($state, 'dorecalccategories_recount'); qa_recalc_transition($state, 'dorecalccategories_recount');
} }
...@@ -391,13 +401,13 @@ function qa_recalc_perform_step(&$state) ...@@ -391,13 +401,13 @@ function qa_recalc_perform_step(&$state)
if (count($categoryids)) { if (count($categoryids)) {
$lastcategoryid = max($categoryids); $lastcategoryid = max($categoryids);
foreach ($categoryids as $categoryid) foreach ($categoryids as $categoryid) {
qa_db_ifcategory_qcount_update($categoryid); qa_db_ifcategory_qcount_update($categoryid);
}
$next = 1 + $lastcategoryid; $next = 1 + $lastcategoryid;
$done += count($categoryids); $done += count($categoryids);
$continue = true; $continue = true;
} else { } else {
qa_recalc_transition($state, 'dorecalccategories_backpaths'); qa_recalc_transition($state, 'dorecalccategories_backpaths');
} }
...@@ -431,15 +441,14 @@ function qa_recalc_perform_step(&$state) ...@@ -431,15 +441,14 @@ function qa_recalc_perform_step(&$state)
require_once QA_INCLUDE_DIR . 'app/posts.php'; require_once QA_INCLUDE_DIR . 'app/posts.php';
$postid = $posts[0]; $postid = $posts[0];
qa_post_delete($postid); qa_post_delete($postid);
$next = 1 + $postid; $next = 1 + $postid;
$done++; $done++;
$continue = true; $continue = true;
} else {
} else
qa_recalc_transition($state, 'dodeletehidden_answers'); qa_recalc_transition($state, 'dodeletehidden_answers');
}
break; break;
case 'dodeletehidden_answers': case 'dodeletehidden_answers':
...@@ -449,15 +458,15 @@ function qa_recalc_perform_step(&$state) ...@@ -449,15 +458,15 @@ function qa_recalc_perform_step(&$state)
require_once QA_INCLUDE_DIR . 'app/posts.php'; require_once QA_INCLUDE_DIR . 'app/posts.php';
$postid = $posts[0]; $postid = $posts[0];
qa_post_delete($postid); qa_post_delete($postid);
$next = 1 + $postid; $next = 1 + $postid;
$done++; $done++;
$continue = true; $continue = true;
} else } else {
qa_recalc_transition($state, 'dodeletehidden_questions'); qa_recalc_transition($state, 'dodeletehidden_questions');
}
break; break;
case 'dodeletehidden_questions': case 'dodeletehidden_questions':
...@@ -467,15 +476,15 @@ function qa_recalc_perform_step(&$state) ...@@ -467,15 +476,15 @@ function qa_recalc_perform_step(&$state)
require_once QA_INCLUDE_DIR . 'app/posts.php'; require_once QA_INCLUDE_DIR . 'app/posts.php';
$postid = $posts[0]; $postid = $posts[0];
qa_post_delete($postid); qa_post_delete($postid);
$next = 1 + $postid; $next = 1 + $postid;
$done++; $done++;
$continue = true; $continue = true;
} else } else {
qa_recalc_transition($state, 'dodeletehidden_complete'); qa_recalc_transition($state, 'dodeletehidden_complete');
}
break; break;
case 'doblobstodisk': case 'doblobstodisk':
...@@ -489,15 +498,16 @@ function qa_recalc_perform_step(&$state) ...@@ -489,15 +498,16 @@ function qa_recalc_perform_step(&$state)
require_once QA_INCLUDE_DIR . 'app/blobs.php'; require_once QA_INCLUDE_DIR . 'app/blobs.php';
require_once QA_INCLUDE_DIR . 'db/blobs.php'; require_once QA_INCLUDE_DIR . 'db/blobs.php';
if (qa_write_blob_file($blob['blobid'], $blob['content'], $blob['format'])) if (qa_write_blob_file($blob['blobid'], $blob['content'], $blob['format'])) {
qa_db_blob_set_content($blob['blobid'], null); qa_db_blob_set_content($blob['blobid'], null);
}
$next = 1 + $blob['blobid']; $next = 1 + $blob['blobid'];
$done++; $done++;
$continue = true; $continue = true;
} else {
} else
qa_recalc_transition($state, 'doblobstodisk_complete'); qa_recalc_transition($state, 'doblobstodisk_complete');
}
break; break;
case 'doblobstodb': case 'doblobstodb':
...@@ -518,9 +528,9 @@ function qa_recalc_perform_step(&$state) ...@@ -518,9 +528,9 @@ function qa_recalc_perform_step(&$state)
$next = 1 + $blob['blobid']; $next = 1 + $blob['blobid'];
$done++; $done++;
$continue = true; $continue = true;
} else {
} else
qa_recalc_transition($state, 'doblobstodb_complete'); qa_recalc_transition($state, 'doblobstodb_complete');
}
break; break;
case 'docachetrim': case 'docachetrim':
...@@ -551,8 +561,9 @@ function qa_recalc_perform_step(&$state) ...@@ -551,8 +561,9 @@ function qa_recalc_perform_step(&$state)
break; break;
} }
if ($continue) if ($continue) {
$state = $operation . "\t" . $length . "\t" . $next . "\t" . $done; $state = $operation . "\t" . $length . "\t" . $next . "\t" . $done;
}
return $continue && $done < $length; return $continue && $done < $length;
} }
...@@ -678,8 +689,8 @@ function qa_recalc_get_message($state) ...@@ -678,8 +689,8 @@ function qa_recalc_get_message($state)
@list($operation, $length, $next, $done) = explode("\t", $state); @list($operation, $length, $next, $done) = explode("\t", $state);
$done = (int)$done; $done = (int) $done;
$length = (int)$length; $length = (int) $length;
switch ($operation) { switch ($operation) {
case 'doreindexcontent_postcount': case 'doreindexcontent_postcount':
......
...@@ -143,25 +143,29 @@ function qa_vote_set($post, $userid, $handle, $cookieid, $vote) ...@@ -143,25 +143,29 @@ function qa_vote_set($post, $userid, $handle, $cookieid, $vote)
$columns = array(); $columns = array();
if ($vote > 0 || $oldvote > 0) if ($vote > 0 || $oldvote > 0) {
$columns[] = $prefix . 'upvotes'; $columns[] = $prefix . 'upvotes';
}
if ($vote < 0 || $oldvote < 0) if ($vote < 0 || $oldvote < 0) {
$columns[] = $prefix . 'downvotes'; $columns[] = $prefix . 'downvotes';
}
qa_db_points_update_ifuser($userid, $columns); qa_db_points_update_ifuser($userid, $columns);
qa_db_points_update_ifuser($post['userid'], array($prefix . 'voteds', 'upvoteds', 'downvoteds')); qa_db_points_update_ifuser($post['userid'], array($prefix . 'voteds', 'upvoteds', 'downvoteds'));
if ($prefix === 'q') if ($prefix === 'q') {
qa_db_hotness_update($post['postid']); qa_db_hotness_update($post['postid']);
}
if ($vote < 0) if ($vote < 0) {
$event = $prefix . '_vote_down'; $event = $prefix . '_vote_down';
elseif ($vote > 0) } elseif ($vote > 0) {
$event = $prefix . '_vote_up'; $event = $prefix . '_vote_up';
else } else {
$event = $prefix . '_vote_nil'; $event = $prefix . '_vote_nil';
}
qa_report_event($event, $userid, $handle, $cookieid, array( qa_report_event($event, $userid, $handle, $cookieid, array(
'postid' => $post['postid'], 'postid' => $post['postid'],
...@@ -215,9 +219,9 @@ function qa_flag_error_html($post, $userid, $topage) ...@@ -215,9 +219,9 @@ function qa_flag_error_html($post, $userid, $topage)
case false: case false:
return false; return false;
} }
} else {
} else
return qa_lang_html('question/flag_not_allowed'); // flagging option should not have been presented return qa_lang_html('question/flag_not_allowed'); // flagging option should not have been presented
}
} }
......
...@@ -173,14 +173,15 @@ function qa_db_points_update_ifuser($userid, $columns) ...@@ -173,14 +173,15 @@ function qa_db_points_update_ifuser($userid, $columns)
$calculations = qa_db_points_calculations(); $calculations = qa_db_points_calculations();
if ($columns === true) if ($columns === true) {
$keycolumns = $calculations; $keycolumns = $calculations;
elseif (empty($columns)) } elseif (empty($columns)) {
$keycolumns = array(); $keycolumns = array();
elseif (is_array($columns)) } elseif (is_array($columns)) {
$keycolumns = array_flip($columns); $keycolumns = array_flip($columns);
else } else {
$keycolumns = array($columns => true); $keycolumns = array($columns => true);
}
$insertfields = 'userid, '; $insertfields = 'userid, ';
$insertvalues = '$, '; $insertvalues = '$, ';
...@@ -208,9 +209,10 @@ function qa_db_points_update_ifuser($userid, $columns) ...@@ -208,9 +209,10 @@ function qa_db_points_update_ifuser($userid, $columns)
// build like this so that a #, $ or ^ character in the $userid (if external integration) isn't substituted // build like this so that a #, $ or ^ character in the $userid (if external integration) isn't substituted
qa_db_query_raw(str_replace('~', "='" . qa_db_escape_string($userid) . "'", qa_db_apply_sub($query, array($userid)))); qa_db_query_raw(str_replace('~', "='" . qa_db_escape_string($userid) . "'", qa_db_apply_sub($query, array($userid))));
if (qa_db_insert_on_duplicate_inserted()) if (qa_db_insert_on_duplicate_inserted()) {
qa_db_userpointscount_update(); qa_db_userpointscount_update();
} }
}
} }
......
...@@ -252,16 +252,17 @@ function qa_db_posts_answers_recount($firstpostid, $lastpostid) ...@@ -252,16 +252,17 @@ function qa_db_posts_answers_recount($firstpostid, $lastpostid)
*/ */
function qa_db_users_get_for_recalc_points($startuserid, $count) function qa_db_users_get_for_recalc_points($startuserid, $count)
{ {
if (QA_FINAL_EXTERNAL_USERS) if (QA_FINAL_EXTERNAL_USERS) {
return qa_db_read_all_values(qa_db_query_sub( return qa_db_read_all_values(qa_db_query_sub(
'SELECT userid FROM ((SELECT DISTINCT userid FROM ^posts WHERE userid>=# ORDER BY userid LIMIT #) UNION (SELECT DISTINCT userid FROM ^uservotes WHERE userid>=# ORDER BY userid LIMIT #)) x ORDER BY userid LIMIT #', 'SELECT userid FROM ((SELECT DISTINCT userid FROM ^posts WHERE userid>=# ORDER BY userid LIMIT #) UNION (SELECT DISTINCT userid FROM ^uservotes WHERE userid>=# ORDER BY userid LIMIT #)) x ORDER BY userid LIMIT #',
$startuserid, $count, $startuserid, $count, $count $startuserid, $count, $startuserid, $count, $count
)); ));
else } else {
return qa_db_read_all_values(qa_db_query_sub( return qa_db_read_all_values(qa_db_query_sub(
'SELECT DISTINCT userid FROM ^users WHERE userid>=# ORDER BY userid LIMIT #', 'SELECT DISTINCT userid FROM ^users WHERE userid>=# ORDER BY userid LIMIT #',
$startuserid, $count $startuserid, $count
)); ));
}
} }
......
...@@ -94,11 +94,12 @@ function qa_db_userflags_clear_all($postid) ...@@ -94,11 +94,12 @@ function qa_db_userflags_clear_all($postid)
*/ */
function qa_db_post_recount_votes($postid) function qa_db_post_recount_votes($postid)
{ {
if (qa_should_update_counts()) if (qa_should_update_counts()) {
qa_db_query_sub( qa_db_query_sub(
'UPDATE ^posts AS x, (SELECT COALESCE(SUM(GREATEST(0,vote)),0) AS upvotes, -COALESCE(SUM(LEAST(0,vote)),0) AS downvotes FROM ^uservotes WHERE postid=#) AS a SET x.upvotes=a.upvotes, x.downvotes=a.downvotes, x.netvotes=a.upvotes-a.downvotes WHERE x.postid=#', 'UPDATE ^posts AS x, (SELECT COALESCE(SUM(GREATEST(0,vote)),0) AS upvotes, -COALESCE(SUM(LEAST(0,vote)),0) AS downvotes FROM ^uservotes WHERE postid=#) AS a SET x.upvotes=a.upvotes, x.downvotes=a.downvotes, x.netvotes=a.upvotes-a.downvotes WHERE x.postid=#',
$postid, $postid $postid, $postid
); );
}
} }
...@@ -108,11 +109,12 @@ function qa_db_post_recount_votes($postid) ...@@ -108,11 +109,12 @@ function qa_db_post_recount_votes($postid)
*/ */
function qa_db_post_recount_flags($postid) function qa_db_post_recount_flags($postid)
{ {
if (qa_should_update_counts()) if (qa_should_update_counts()) {
qa_db_query_sub( qa_db_query_sub(
'UPDATE ^posts AS x, (SELECT COALESCE(SUM(IF(flag, 1, 0)),0) AS flagcount FROM ^uservotes WHERE postid=#) AS a SET x.flagcount=a.flagcount WHERE x.postid=#', 'UPDATE ^posts AS x, (SELECT COALESCE(SUM(IF(flag, 1, 0)),0) AS flagcount FROM ^uservotes WHERE postid=#) AS a SET x.flagcount=a.flagcount WHERE x.postid=#',
$postid, $postid $postid, $postid
); );
}
} }
......
...@@ -34,8 +34,9 @@ require_once QA_INCLUDE_DIR . 'util/sort.php'; ...@@ -34,8 +34,9 @@ require_once QA_INCLUDE_DIR . 'util/sort.php';
// Check admin privileges // Check admin privileges
if (!qa_admin_check_privileges($qa_content)) if (!qa_admin_check_privileges($qa_content)) {
return $qa_content; return $qa_content;
}
// Process user actions // Process user actions
...@@ -47,27 +48,25 @@ $optionnames = qa_db_points_option_names(); ...@@ -47,27 +48,25 @@ $optionnames = qa_db_points_option_names();
if (qa_clicked('doshowdefaults')) { if (qa_clicked('doshowdefaults')) {
$options = array(); $options = array();
foreach ($optionnames as $optionname) foreach ($optionnames as $optionname) {
$options[$optionname] = qa_default_option($optionname); $options[$optionname] = qa_default_option($optionname);
}
} else { } else {
if (qa_clicked('docancel')) if (qa_clicked('dosaverecalc')) {
; if (!qa_check_form_security_code('admin/points', qa_post_text('code'))) {
elseif (qa_clicked('dosaverecalc')) {
if (!qa_check_form_security_code('admin/points', qa_post_text('code')))
$securityexpired = true; $securityexpired = true;
} else {
else { foreach ($optionnames as $optionname) {
foreach ($optionnames as $optionname)
qa_set_option($optionname, (int)qa_post_text('option_' . $optionname)); qa_set_option($optionname, (int)qa_post_text('option_' . $optionname));
}
if (!qa_post_text('has_js')) if (!qa_post_text('has_js')) {
qa_redirect('admin/recalc', array('dorecalcpoints' => 1)); qa_redirect('admin/recalc', array('dorecalcpoints' => 1));
else } else {
$recalculate = true; $recalculate = true;
} }
} }
}
$options = qa_get_options($optionnames); $options = qa_get_options($optionnames);
} }
...@@ -107,7 +106,6 @@ if (qa_clicked('doshowdefaults')) { ...@@ -107,7 +106,6 @@ if (qa_clicked('doshowdefaults')) {
'tags' => 'name="docancel"', 'tags' => 'name="docancel"',
'label' => qa_lang_html('main/cancel_button'), 'label' => qa_lang_html('main/cancel_button'),
); );
} else { } else {
if ($recalculate) { if ($recalculate) {
$qa_content['form']['ok'] = '<span id="recalc_ok"></span>'; $qa_content['form']['ok'] = '<span id="recalc_ok"></span>';
......
...@@ -27,8 +27,9 @@ class qa_event_limits ...@@ -27,8 +27,9 @@ class qa_event_limits
// Don't increment limits or report user actions for events that were delayed. For example, a 'q_post' // Don't increment limits or report user actions for events that were delayed. For example, a 'q_post'
// event sent when a post is approved by the admin, for which a 'q_queue' event was already sent. // event sent when a post is approved by the admin, for which a 'q_queue' event was already sent.
if (isset($params['delayed'])) if (isset($params['delayed'])) {
return; return;
}
require_once QA_INCLUDE_DIR . 'app/limits.php'; require_once QA_INCLUDE_DIR . 'app/limits.php';
...@@ -92,12 +93,10 @@ class qa_event_limits ...@@ -92,12 +93,10 @@ class qa_event_limits
) { ) {
if (isset($userid)) { if (isset($userid)) {
require_once QA_INCLUDE_DIR . 'app/users.php'; require_once QA_INCLUDE_DIR . 'app/users.php';
qa_user_report_action($userid, $event); qa_user_report_action($userid, $event);
} elseif (isset($cookieid)) { } elseif (isset($cookieid)) {
require_once QA_INCLUDE_DIR . 'app/cookies.php'; require_once QA_INCLUDE_DIR . 'app/cookies.php';
qa_cookie_report_action($cookieid, $event); qa_cookie_report_action($cookieid, $event);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment