本文整理汇总了PHP中qa_db_get_pending_result函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_db_get_pending_result函数的具体用法?PHP qa_db_get_pending_result怎么用?PHP qa_db_get_pending_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qa_db_get_pending_result函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: qa_get_options
function qa_get_options($names)
{
global $qa_options_cache, $qa_options_loaded;
// If any options not cached, retrieve them from database via standard pending mechanism
if (!$qa_options_loaded) {
qa_preload_options();
}
if (!$qa_options_loaded) {
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
qa_load_options_results(array(qa_db_get_pending_result('options'), qa_db_get_pending_result('time')));
}
// Pull out the options specifically requested here, and assign defaults
$options = array();
foreach ($names as $name) {
if (!isset($qa_options_cache[$name])) {
$todatabase = true;
switch ($name) {
// don't write default to database if option was deprecated, or depends on site language (which could be changed)
case 'custom_sidebar':
case 'site_title':
case 'email_privacy':
case 'answer_needs_login':
case 'ask_needs_login':
case 'comment_needs_login':
case 'db_time':
$todatabase = false;
break;
}
qa_set_option($name, qa_default_option($name), $todatabase);
}
$options[$name] = $qa_options_cache[$name];
}
return $options;
}
示例2: qa_get_logged_in_levels
function qa_get_logged_in_levels()
{
require_once QA_INCLUDE_DIR . 'db/selects.php';
return qa_db_get_pending_result('userlevels', qa_db_user_levels_selectspec(qa_get_logged_in_userid(), true));
}
示例3: qa_get_favorite_non_qs_map
function qa_get_favorite_non_qs_map()
{
global $qa_favorite_non_qs_map;
if (!isset($qa_favorite_non_qs_map)) {
$qa_favorite_non_qs_map = array();
$loginuserid = qa_get_logged_in_userid();
if (isset($loginuserid)) {
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'util/string.php';
$favoritenonqs = qa_db_get_pending_result('favoritenonqs', qa_db_user_favorite_non_qs_selectspec($loginuserid));
foreach ($favoritenonqs as $favorite) {
switch ($favorite['type']) {
case QA_ENTITY_USER:
$qa_favorite_non_qs_map['user'][$favorite['userid']] = true;
break;
case QA_ENTITY_TAG:
$qa_favorite_non_qs_map['tag'][qa_strtolower($favorite['tags'])] = true;
break;
case QA_ENTITY_CATEGORY:
$qa_favorite_non_qs_map['category'][$favorite['categorybackpath']] = true;
break;
}
}
}
}
return $qa_favorite_non_qs_map;
}
示例4: qa_get_logged_in_user_field
function qa_get_logged_in_user_field($field)
{
if (qa_to_override(__FUNCTION__)) {
$args = func_get_args();
return qa_call_override(__FUNCTION__, $args);
}
global $qa_cached_logged_in_user;
$userid = qa_get_logged_in_userid();
if (isset($userid) && !isset($qa_cached_logged_in_user)) {
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
$qa_cached_logged_in_user = qa_db_get_pending_result('loggedinuser', qa_db_user_account_selectspec($userid, true));
if (!isset($qa_cached_logged_in_user)) {
// the user can no longer be found (should be because they're deleted)
qa_clear_session_user();
qa_fatal_error('The logged in user cannot be found');
// it's too late here to proceed because the caller may already be branching based on whether someone is logged in
}
}
return @$qa_cached_logged_in_user[$field];
}
示例5: qa_content_prepare
function qa_content_prepare($voting = false, $categoryids = null)
{
if (qa_to_override(__FUNCTION__)) {
$args = func_get_args();
return qa_call_override(__FUNCTION__, $args);
}
global $qa_template, $qa_page_error_html;
if (QA_DEBUG_PERFORMANCE) {
global $qa_usage;
$qa_usage->mark('control');
}
$request = qa_request();
$requestlower = qa_request();
$navpages = qa_db_get_pending_result('navpages');
$widgets = qa_db_get_pending_result('widgets');
if (isset($categoryids) && !is_array($categoryids)) {
// accept old-style parameter
$categoryids = array($categoryids);
}
$lastcategoryid = count($categoryids) ? end($categoryids) : null;
$charset = 'utf-8';
$qa_content = array('content_type' => 'text/html; charset=' . $charset, 'charset' => $charset, 'direction' => qa_opt('site_text_direction'), 'site_title' => qa_html(qa_opt('site_title')), 'head_lines' => array(), 'navigation' => array('user' => array(), 'main' => array(), 'footer' => array('feedback' => array('url' => qa_path_html('feedback'), 'label' => qa_lang_html('main/nav_feedback')))), 'sidebar' => qa_opt('show_custom_sidebar') ? qa_opt('custom_sidebar') : null, 'sidepanel' => qa_opt('show_custom_sidepanel') ? qa_opt('custom_sidepanel') : null, 'widgets' => array());
if (qa_opt('show_custom_in_head')) {
$qa_content['head_lines'][] = qa_opt('custom_in_head');
}
if (qa_opt('show_custom_header')) {
$qa_content['body_header'] = qa_opt('custom_header');
}
if (qa_opt('show_custom_footer')) {
$qa_content['body_footer'] = qa_opt('custom_footer');
}
if (isset($categoryids)) {
$qa_content['categoryids'] = $categoryids;
}
foreach ($navpages as $page) {
if ($page['nav'] == 'B') {
qa_navigation_add_page($qa_content['navigation']['main'], $page);
}
}
if (qa_opt('nav_home') && qa_opt('show_custom_home')) {
$qa_content['navigation']['main']['$'] = array('url' => qa_path_html(''), 'label' => qa_lang_html('main/nav_home'));
}
if (qa_opt('nav_activity')) {
$qa_content['navigation']['main']['activity'] = array('url' => qa_path_html('activity'), 'label' => qa_lang_html('main/nav_activity'));
}
$hascustomhome = qa_has_custom_home();
if (qa_opt($hascustomhome ? 'nav_qa_not_home' : 'nav_qa_is_home')) {
$qa_content['navigation']['main'][$hascustomhome ? 'qa' : '$'] = array('url' => qa_path_html($hascustomhome ? 'qa' : ''), 'label' => qa_lang_html('main/nav_qa'));
}
if (qa_opt('nav_questions')) {
$qa_content['navigation']['main']['questions'] = array('url' => qa_path_html('questions'), 'label' => qa_lang_html('main/nav_qs'));
}
if (qa_opt('nav_hot')) {
$qa_content['navigation']['main']['hot'] = array('url' => qa_path_html('hot'), 'label' => qa_lang_html('main/nav_hot'));
}
if (qa_opt('nav_unanswered')) {
$qa_content['navigation']['main']['unanswered'] = array('url' => qa_path_html('unanswered'), 'label' => qa_lang_html('main/nav_unanswered'));
}
if (qa_using_tags() && qa_opt('nav_tags')) {
$qa_content['navigation']['main']['tag'] = array('url' => qa_path_html('tags'), 'label' => qa_lang_html('main/nav_tags'), 'selected_on' => array('tags$', 'tag/'));
}
if (qa_using_categories() && qa_opt('nav_categories')) {
$qa_content['navigation']['main']['categories'] = array('url' => qa_path_html('categories'), 'label' => qa_lang_html('main/nav_categories'), 'selected_on' => array('categories$', 'categories/'));
}
if (qa_opt('nav_users')) {
$qa_content['navigation']['main']['user'] = array('url' => qa_path_html('users'), 'label' => qa_lang_html('main/nav_users'), 'selected_on' => array('users$', 'users/', 'user/'));
}
// Only the 'level' permission error prevents the menu option being shown - others reported on qa-page-ask.php
if (qa_opt('nav_ask') && qa_user_maximum_permit_error('permit_post_q') != 'level') {
$qa_content['navigation']['main']['ask'] = array('url' => qa_path_html('ask', qa_using_categories() && strlen($lastcategoryid) ? array('cat' => $lastcategoryid) : null), 'label' => qa_lang_html('main/nav_ask'));
}
if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN || !qa_user_maximum_permit_error('permit_moderate') || !qa_user_maximum_permit_error('permit_hide_show') || !qa_user_maximum_permit_error('permit_delete_hidden')) {
$qa_content['navigation']['main']['admin'] = array('url' => qa_path_html('admin'), 'label' => qa_lang_html('main/nav_admin'), 'selected_on' => array('admin/'));
}
$qa_content['search'] = array('form_tags' => 'method="get" action="' . qa_path_html('search') . '"', 'form_extra' => qa_path_form_html('search'), 'title' => qa_lang_html('main/search_title'), 'field_tags' => 'name="q"', 'button_label' => qa_lang_html('main/search_button'));
if (!qa_opt('feedback_enabled')) {
unset($qa_content['navigation']['footer']['feedback']);
}
foreach ($navpages as $page) {
if ($page['nav'] == 'M' || $page['nav'] == 'O' || $page['nav'] == 'F') {
qa_navigation_add_page($qa_content['navigation'][$page['nav'] == 'F' ? 'footer' : 'main'], $page);
}
}
$regioncodes = array('F' => 'full', 'M' => 'main', 'S' => 'side');
$placecodes = array('T' => 'top', 'H' => 'high', 'L' => 'low', 'B' => 'bottom');
foreach ($widgets as $widget) {
if (is_numeric(strpos(',' . $widget['tags'] . ',', ',' . $qa_template . ',')) || is_numeric(strpos(',' . $widget['tags'] . ',', ',all,'))) {
// see if it has been selected for display on this template
$region = @$regioncodes[substr($widget['place'], 0, 1)];
$place = @$placecodes[substr($widget['place'], 1, 2)];
if (isset($region) && isset($place)) {
// check region/place codes recognized
$module = qa_load_module('widget', $widget['title']);
if (isset($module) && method_exists($module, 'allow_template') && $module->allow_template(substr($qa_template, 0, 7) == 'custom-' ? 'custom' : $qa_template) && method_exists($module, 'allow_region') && $module->allow_region($region) && method_exists($module, 'output_widget')) {
$qa_content['widgets'][$region][$place][] = $module;
}
// if module loaded and happy to be displayed here, tell theme about it
}
}
}
//.........这里部分代码省略.........
示例6: qa_user_limits_remaining
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]);
}