function qa_page_queue_pending() { if (qa_to_override(__FUNCTION__)) { $args = func_get_args(); return qa_call_override(__FUNCTION__, $args); } qa_preload_options(); $loginuserid = qa_get_logged_in_userid(); if (isset($loginuserid)) { if (!QA_FINAL_EXTERNAL_USERS) { qa_db_queue_pending_select('loggedinuser', qa_db_user_account_selectspec($loginuserid, true)); } qa_db_queue_pending_select('notices', qa_db_user_notices_selectspec($loginuserid)); qa_db_queue_pending_select('favoritenonqs', qa_db_user_favorite_non_qs_selectspec($loginuserid)); qa_db_queue_pending_select('userlimits', qa_db_user_limits_selectspec($loginuserid)); qa_db_queue_pending_select('userlevels', qa_db_user_levels_selectspec($loginuserid, true)); } qa_db_queue_pending_select('iplimits', qa_db_ip_limits_selectspec(qa_remote_ip_address())); qa_db_queue_pending_select('navpages', qa_db_pages_selectspec(array('B', 'M', 'O', 'F'))); qa_db_queue_pending_select('widgets', qa_db_widgets_selectspec()); }
function qa_user_limits_remaining($action) { $userlimits = qa_db_get_pending_result('userlimits', qa_db_user_limits_selectspec(qa_get_logged_in_userid())); $iplimits = qa_db_get_pending_result('iplimits', qa_db_ip_limits_selectspec(qa_remote_ip_address())); return qa_limits_calc_remaining($action, @$userlimits[$action], @$iplimits[$action]); }