function qa_db_get_pending_result($pendingid, $selectspec = null)
{
    global $qa_db_pending_selectspecs, $qa_db_pending_results;
    if (isset($selectspec)) {
        qa_db_queue_pending_select($pendingid, $selectspec);
    } elseif (!isset($qa_db_pending_selectspecs[$pendingid])) {
        qa_fatal_error('Pending query was never set up: ' . $pendingid);
    }
    if (!isset($qa_db_pending_results[$pendingid])) {
        qa_db_select_with_pending();
    }
    return $qa_db_pending_results[$pendingid];
}
Example #2
0
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('navpages', qa_db_pages_selectspec(array('B', 'M', 'O', 'F')));
    qa_db_queue_pending_select('widgets', qa_db_widgets_selectspec());
}
Example #3
0
function qa_preload_options()
{
    global $qa_options_loaded;
    if (!@$qa_options_loaded) {
        $selectspecs = array('options' => array('columns' => array('title', 'content'), 'source' => '^options', 'arraykey' => 'title', 'arrayvalue' => 'content'), 'time' => array('columns' => array('title' => "'db_time'", 'content' => 'UNIX_TIMESTAMP(NOW())'), 'arraykey' => 'title', 'arrayvalue' => 'content'));
        if (QA_OPTIMIZE_DISTANT_DB) {
            require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
            foreach ($selectspecs as $pendingid => $selectspec) {
                qa_db_queue_pending_select($pendingid, $selectspec);
            }
        } else {
            qa_load_options_results(qa_db_multi_select($selectspecs));
        }
    }
}