当前位置: 首页>>代码示例>>PHP>>正文


PHP qa_user_maximum_permit_error函数代码示例

本文整理汇总了PHP中qa_user_maximum_permit_error函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_user_maximum_permit_error函数的具体用法?PHP qa_user_maximum_permit_error怎么用?PHP qa_user_maximum_permit_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了qa_user_maximum_permit_error函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ami_dhp_delete_hidden_posts_process

 /**
  * Process the delete hidden posts request from the admin
  */
 function ami_dhp_delete_hidden_posts_process()
 {
     // load all required files if not loaded
     require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
     require_once QA_INCLUDE_DIR . 'qa-db-admin.php';
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     //	Check admin privileges
     if (qa_user_maximum_permit_error('permit_hide_show') && qa_user_maximum_permit_error('permit_delete_hidden')) {
         return false;
     }
     $userid = qa_get_logged_in_userid();
     //	Find recently hidden questions, answers, comments
     list($hiddenquestions, $hiddenanswers, $hiddencomments) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, null, 'Q_HIDDEN', true), qa_db_recent_a_qs_selectspec($userid, 0, null, null, 'A_HIDDEN', true), qa_db_recent_c_qs_selectspec($userid, 0, null, null, 'C_HIDDEN', true));
     // first delete all hidden posts
     if (count($hiddencomments)) {
         foreach ($hiddencomments as $hiddencomment) {
             ami_dhp_post_delete_recursive($hiddencomment['opostid']);
         }
     }
     // delete all the hidden answers
     if (count($hiddenanswers)) {
         foreach ($hiddenanswers as $hiddenanswer) {
             ami_dhp_post_delete_recursive($hiddenanswer['opostid']);
         }
     }
     // delete all the hidden questions
     if (count($hiddenquestions)) {
         foreach ($hiddenquestions as $hiddenquestion) {
             ami_dhp_post_delete_recursive($hiddenquestion['postid']);
         }
     }
 }
开发者ID:aunna77doe,项目名称:q2a-delete-hidden-posts,代码行数:36,代码来源:qa-dhp-utils.php

示例2: array

$in = array();
$followpostid = qa_get('follow');
$in['categoryid'] = qa_get_category_field_value('category');
if (!isset($in['categoryid'])) {
    $in['categoryid'] = qa_get('cat');
}
$userid = qa_get_logged_in_userid();
list($categories, $followanswer, $completetags) = qa_db_select_with_pending(qa_db_category_nav_selectspec($in['categoryid'], true), isset($followpostid) ? qa_db_full_post_selectspec($userid, $followpostid) : null, qa_db_popular_tags_selectspec(0, QA_DB_RETRIEVE_COMPLETE_TAGS));
if (!isset($categories[$in['categoryid']])) {
    $in['categoryid'] = null;
}
if (@$followanswer['basetype'] != 'A') {
    $followanswer = null;
}
//	Check for permission error
$permiterror = qa_user_maximum_permit_error('permit_post_q', QA_LIMIT_QUESTIONS);
if ($permiterror) {
    $qa_content = qa_content_prepare();
    // The 'approve', 'login', 'confirm', 'limit', 'userblock', 'ipblock' permission errors are reported to the user here
    // The other option ('level') prevents the menu option being shown, in qa_content_prepare(...)
    switch ($permiterror) {
        case 'login':
            $qa_content['error'] = qa_insert_login_links(qa_lang_html('question/ask_must_login'), qa_request(), isset($followpostid) ? array('follow' => $followpostid) : null);
            break;
        case 'confirm':
            $qa_content['error'] = qa_insert_login_links(qa_lang_html('question/ask_must_confirm'), qa_request(), isset($followpostid) ? array('follow' => $followpostid) : null);
            break;
        case 'limit':
            $qa_content['error'] = qa_lang_html('question/ask_limit');
            break;
        case 'approve':
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:31,代码来源:qa-page-ask.php

示例3: header

	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'app/admin.php';
require_once QA_INCLUDE_DIR . 'db/admin.php';
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'app/format.php';
//	Find recently hidden questions, answers, comments
$userid = qa_get_logged_in_userid();
list($hiddenquestions, $hiddenanswers, $hiddencomments) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, null, 'Q_HIDDEN', true), qa_db_recent_a_qs_selectspec($userid, 0, null, null, 'A_HIDDEN', true), qa_db_recent_c_qs_selectspec($userid, 0, null, null, 'C_HIDDEN', true));
//	Check admin privileges (do late to allow one DB query)
if (qa_user_maximum_permit_error('permit_hide_show') && qa_user_maximum_permit_error('permit_delete_hidden')) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_lang_html('users/no_permission');
    return $qa_content;
}
//	Check to see if any have been reshown or deleted
$pageerror = qa_admin_check_clicks();
//	Combine sets of questions and remove those this user has no permissions for
$questions = qa_any_sort_by_date(array_merge($hiddenquestions, $hiddenanswers, $hiddencomments));
if (qa_user_permit_error('permit_hide_show') && qa_user_permit_error('permit_delete_hidden')) {
    // not allowed to see all hidden posts
    foreach ($questions as $index => $question) {
        if (qa_user_post_permit_error('permit_hide_show', $question) && qa_user_post_permit_error('permit_delete_hidden', $question)) {
            unset($questions[$index]);
        }
    }
开发者ID:kosmoluna,项目名称:question2answer,代码行数:31,代码来源:admin-hidden.php

示例4: header

	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'app/admin.php';
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'app/format.php';
//	Find queued questions, answers, comments
$userid = qa_get_logged_in_userid();
list($queuedquestions, $queuedanswers, $queuedcomments) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, null, 'Q_QUEUED', true), qa_db_recent_a_qs_selectspec($userid, 0, null, null, 'A_QUEUED', true), qa_db_recent_c_qs_selectspec($userid, 0, null, null, 'C_QUEUED', true));
//	Check admin privileges (do late to allow one DB query)
if (qa_user_maximum_permit_error('permit_moderate')) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_lang_html('users/no_permission');
    return $qa_content;
}
//	Check to see if any were approved/rejected here
$pageerror = qa_admin_check_clicks();
//	Combine sets of questions and remove those this user has no permission to moderate
$questions = qa_any_sort_by_date(array_merge($queuedquestions, $queuedanswers, $queuedcomments));
if (qa_user_permit_error('permit_moderate')) {
    // if user not allowed to moderate all posts
    foreach ($questions as $index => $question) {
        if (qa_user_post_permit_error('permit_moderate', $question)) {
            unset($questions[$index]);
        }
    }
开发者ID:kosmoluna,项目名称:question2answer,代码行数:30,代码来源:admin-moderate.php

示例5: qa_lang_html_sub

$qa_content['title'] = qa_lang_html_sub('main/ip_address_x', qa_html($ip));
$qa_content['error'] = @$pageerror;
$qa_content['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'wide', 'fields' => array('host' => array('type' => 'static', 'label' => qa_lang_html('misc/host_name'), 'value' => qa_html($hostname))), 'hidden' => array('code' => qa_get_form_security_code('ip-' . $ip)));
if ($blockable) {
    require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
    $blockipclauses = qa_block_ips_explode(qa_opt('block_ips_write'));
    $matchclauses = array();
    foreach ($blockipclauses as $blockipclause) {
        if (qa_block_ip_match($ip, $blockipclause)) {
            $matchclauses[] = $blockipclause;
        }
    }
    if (count($matchclauses)) {
        $qa_content['form']['fields']['status'] = array('type' => 'static', 'label' => qa_lang_html('misc/matches_blocked_ips'), 'value' => qa_html(implode("\n", $matchclauses), true));
        $qa_content['form']['buttons']['unblock'] = array('tags' => 'name="dounblock"', 'label' => qa_lang_html('misc/unblock_ip_button'));
        if (count($questions) && !qa_user_maximum_permit_error('permit_hide_show')) {
            $qa_content['form']['buttons']['hideall'] = array('tags' => 'name="dohideall" onclick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('misc/hide_all_ip_button'));
        }
    } else {
        $qa_content['form']['buttons']['block'] = array('tags' => 'name="doblock"', 'label' => qa_lang_html('misc/block_ip_button'));
    }
}
$qa_content['q_list']['qs'] = array();
if (count($questions)) {
    $qa_content['q_list']['title'] = qa_lang_html_sub('misc/recent_activity_from_x', qa_html($ip));
    foreach ($questions as $question) {
        $htmloptions = qa_post_html_options($question);
        $htmloptions['tagsview'] = false;
        $htmloptions['voteview'] = false;
        $htmloptions['ipview'] = false;
        $htmloptions['answersview'] = false;
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:31,代码来源:qa-page-ip.php

示例6: qa_load_theme_class

function qa_load_theme_class($theme, $template, $content, $request)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    global $qa_layers;
    //	First load the default class
    require_once QA_INCLUDE_DIR . 'qa-theme-base.php';
    $classname = 'qa_html_theme_base';
    //	Then load the selected theme if valid, otherwise load the Classic theme
    if (!file_exists(QA_THEME_DIR . $theme . '/qa-styles.css')) {
        $theme = 'Classic';
    }
    $themeroothtml = qa_html(qa_path_to_root() . 'qa-theme/' . $theme . '/');
    if (file_exists(QA_THEME_DIR . $theme . '/qa-theme.php')) {
        require_once QA_THEME_DIR . $theme . '/qa-theme.php';
        if (class_exists('qa_html_theme')) {
            $classname = 'qa_html_theme';
        }
    }
    //	Create the list of layers to load
    $loadlayers = $qa_layers;
    if (!qa_user_maximum_permit_error('permit_view_voters_flaggers')) {
        $loadlayers[] = array('directory' => QA_INCLUDE_DIR . 'plugins/', 'include' => 'qa-layer-voters-flaggers.php', 'urltoroot' => null);
    }
    //	Then load any theme layers using some class-munging magic (substitute class names)
    $layerindex = 0;
    foreach ($loadlayers as $layer) {
        $filename = $layer['directory'] . $layer['include'];
        $layerphp = file_get_contents($filename);
        if (strlen($layerphp)) {
            $newclassname = 'qa_layer_' . ++$layerindex . '_from_' . preg_replace('/[^A-Za-z0-9_]+/', '_', basename($layer['include']));
            // include file name in layer class name to make debugging easier if there is an error
            if (preg_match('/\\s+class\\s+qa_html_theme_layer\\s+extends\\s+qa_html_theme_base\\s+/im', $layerphp) != 1) {
                qa_fatal_error('Class for layer must be declared as "class qa_html_theme_layer extends qa_html_theme_base" in ' . $layer['directory'] . $layer['include']);
            }
            $searchwordreplace = array('qa_html_theme_base::qa_html_theme_base' => $classname . '::__construct', 'parent::qa_html_theme_base' => 'parent::__construct', 'qa_html_theme_layer' => $newclassname, 'qa_html_theme_base' => $classname, 'QA_HTML_THEME_LAYER_DIRECTORY' => "'" . $layer['directory'] . "'", 'QA_HTML_THEME_LAYER_URLTOROOT' => "'" . qa_path_to_root() . $layer['urltoroot'] . "'");
            foreach ($searchwordreplace as $searchword => $replace) {
                if (preg_match_all('/\\W(' . preg_quote($searchword, '/') . ')\\W/im', $layerphp, $matches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE)) {
                    $searchmatches = array_reverse($matches[1]);
                    // don't use preg_replace due to complication of escaping replacement phrase
                    foreach ($searchmatches as $searchmatch) {
                        $layerphp = substr_replace($layerphp, $replace, $searchmatch[1], strlen($searchmatch[0]));
                    }
                }
            }
            //	echo '<pre style="text-align:left;">'.htmlspecialchars($layerphp).'</pre>'; // to debug munged code
            qa_eval_from_file($layerphp, $filename);
            $classname = $newclassname;
        }
    }
    //	Finally, instantiate the object
    $themeclass = new $classname($template, $content, $themeroothtml, $request);
    return $themeclass;
}
开发者ID:amiyasahu,项目名称:question2answer,代码行数:56,代码来源:format.php

示例7: qa_admin_sub_navigation

function qa_admin_sub_navigation()
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    $navigation = array();
    $level = qa_get_logged_in_level();
    if ($level >= QA_USER_LEVEL_ADMIN) {
        $navigation['admin/general'] = array('label' => qa_lang_html('admin/general_title'), 'url' => qa_path_html('admin/general'));
        $navigation['admin/emails'] = array('label' => qa_lang_html('admin/emails_title'), 'url' => qa_path_html('admin/emails'));
        $navigation['admin/users'] = array('label' => qa_lang_html('admin/users_title'), 'url' => qa_path_html('admin/users'), 'selected_on' => array('admin/users$', 'admin/userfields$', 'admin/usertitles$'));
        if ($level >= QA_USER_LEVEL_SUPER) {
            $navigation['admin/layout'] = array('label' => qa_lang_html('admin/layout_title'), 'url' => qa_path_html('admin/layout'));
        }
        $navigation['admin/posting'] = array('label' => qa_lang_html('admin/posting_title'), 'url' => qa_path_html('admin/posting'));
        $navigation['admin/viewing'] = array('label' => qa_lang_html('admin/viewing_title'), 'url' => qa_path_html('admin/viewing'));
        $navigation['admin/lists'] = array('label' => qa_lang_html('admin/lists_title'), 'url' => qa_path_html('admin/lists'));
        if (qa_using_categories()) {
            $navigation['admin/categories'] = array('label' => qa_lang_html('admin/categories_title'), 'url' => qa_path_html('admin/categories'));
        }
        $navigation['admin/permissions'] = array('label' => qa_lang_html('admin/permissions_title'), 'url' => qa_path_html('admin/permissions'));
        if ($level >= QA_USER_LEVEL_SUPER) {
            $navigation['admin/pages'] = array('label' => qa_lang_html('admin/pages_title'), 'url' => qa_path_html('admin/pages'));
        }
        $navigation['admin/feeds'] = array('label' => qa_lang_html('admin/feeds_title'), 'url' => qa_path_html('admin/feeds'));
        $navigation['admin/points'] = array('label' => qa_lang_html('admin/points_title'), 'url' => qa_path_html('admin/points'));
        $navigation['admin/spam'] = array('label' => qa_lang_html('admin/spam_title'), 'url' => qa_path_html('admin/spam'));
        if ($level >= QA_USER_LEVEL_SUPER) {
            $navigation['admin/stats'] = array('label' => qa_lang_html('admin/stats_title'), 'url' => qa_path_html('admin/stats'));
        }
        if (!QA_FINAL_EXTERNAL_USERS) {
            $navigation['admin/mailing'] = array('label' => qa_lang_html('admin/mailing_title'), 'url' => qa_path_html('admin/mailing'));
        }
        if ($level >= QA_USER_LEVEL_SUPER) {
            $navigation['admin/plugins'] = array('label' => qa_lang_html('admin/plugins_title'), 'url' => qa_path_html('admin/plugins'));
        }
    }
    if (!qa_user_maximum_permit_error('permit_moderate')) {
        $count = qa_user_permit_error('permit_moderate') ? null : qa_opt('cache_queuedcount');
        // if only in some categories don't show cached count
        $navigation['admin/moderate'] = array('label' => qa_lang_html('admin/moderate_title') . ($count ? ' (' . $count . ')' : ''), 'url' => qa_path_html('admin/moderate'));
    }
    if (qa_opt('flagging_of_posts') && !qa_user_maximum_permit_error('permit_hide_show')) {
        $count = qa_user_permit_error('permit_hide_show') ? null : qa_opt('cache_flaggedcount');
        // if only in some categories don't show cached count
        $navigation['admin/flagged'] = array('label' => qa_lang_html('admin/flagged_title') . ($count ? ' (' . $count . ')' : ''), 'url' => qa_path_html('admin/flagged'));
    }
    if (!qa_user_maximum_permit_error('permit_hide_show') || !qa_user_maximum_permit_error('permit_delete_hidden')) {
        $navigation['admin/hidden'] = array('label' => qa_lang_html('admin/hidden_title'), 'url' => qa_path_html('admin/hidden'));
    }
    if (!QA_FINAL_EXTERNAL_USERS && qa_opt('moderate_users') && $level >= QA_USER_LEVEL_MODERATOR) {
        $count = qa_opt('cache_uapprovecount');
        $navigation['admin/approve'] = array('label' => qa_lang_html('admin/approve_users_title') . ($count ? ' (' . $count . ')' : ''), 'url' => qa_path_html('admin/approve'));
    }
    return $navigation;
}
开发者ID:architbakliwal,项目名称:RapidInnovation,代码行数:57,代码来源:admin.php

示例8: 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
            }
        }
    }
//.........这里部分代码省略.........
开发者ID:Trideon,项目名称:gigolo,代码行数:101,代码来源:qa-page.php

示例9: header

	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
//	Find most flagged questions, answers, comments
$userid = qa_get_logged_in_userid();
$questions = qa_db_select_with_pending(qa_db_flagged_post_qs_selectspec($userid, 0, true));
//	Check admin privileges (do late to allow one DB query)
if (qa_user_maximum_permit_error('permit_hide_show')) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_lang_html('users/no_permission');
    return $qa_content;
}
//	Check to see if any were cleared or hidden here
$pageerror = qa_admin_check_clicks();
//	Remove questions the user has no permission to hide/show
if (qa_user_permit_error('permit_hide_show')) {
    // if user not allowed to show/hide all posts
    foreach ($questions as $index => $question) {
        if (qa_user_post_permit_error('permit_hide_show', $question)) {
            unset($questions[$index]);
        }
    }
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:30,代码来源:qa-page-admin-flagged.php


注:本文中的qa_user_maximum_permit_error函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。