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


PHP qa_user_permit_error函数代码示例

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


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

示例1: qa_wall_error_html

function qa_wall_error_html($fromuserid, $touserid, $touserflags)
{
    require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    if (!QA_FINAL_EXTERNAL_USERS && qa_opt('allow_user_walls')) {
        if ($touserflags & QA_USER_FLAGS_NO_WALL_POSTS && !(isset($fromuserid) && $fromuserid == $touserid)) {
            return qa_lang_html('profile/post_wall_blocked');
        } else {
            switch (qa_user_permit_error('permit_post_wall', QA_LIMIT_WALL_POSTS)) {
                case 'limit':
                    return qa_lang_html('profile/post_wall_limit');
                    break;
                case 'login':
                    return qa_insert_login_links(qa_lang_html('profile/post_wall_must_login'), qa_request());
                    break;
                case 'confirm':
                    return qa_insert_login_links(qa_lang_html('profile/post_wall_must_confirm'), qa_request());
                    break;
                case 'approve':
                    return qa_lang_html('profile/post_wall_must_be_approved');
                    break;
                case false:
                    return false;
                    break;
            }
        }
    }
    return qa_lang_html('users/no_permission');
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:32,代码来源:qa-app-messages.php

示例2: output_widget

 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     /*
     $requestparts=qa_request_parts();
     $requestlower=strtolower(qa_request());
     $firstlower=strtolower($requestparts[0]);
     $routing=qa_page_routing();
     // unanswered & questions pages may contain categories.
     unset($routing['activity/']);
     unset($routing['unanswered/']);
     unset($routing['questions/']);
     if ( (isset($routing[$requestlower])) or (isset($routing[$firstlower.'/'])) or (is_numeric($requestparts[0])) )
     	return;
     	
     $explicitqa=(strtolower($requestparts[0])=='qa' or strtolower($requestparts[0])=='unanswered' or strtolower($requestparts[0])=='questions' or strtolower($requestparts[0])=='activity');
     
     if ($explicitqa)
     	$slugs=array_slice($requestparts, 1);
     elseif (strlen($requestparts[0]))
     	$slugs=$requestparts;
     else
     	$slugs=array();
     */
     $slugs = useo_get_current_category_slug();
     $countslugs = count($slugs);
     list($categories, $categoryid) = qa_db_select_with_pending(qa_db_category_nav_selectspec($slugs, false, false, true), $countslugs ? qa_db_slugs_to_category_id_selectspec($slugs) : null);
     if ($countslugs && isset($categoryid)) {
         /*
         $categoryid is current categories ID
         $backpath = implode('/', array_reverse($slugs));
         echo "countslugs: <pre>"; var_dump($countslugs); echo "</pre>";
         $fullcategory=qa_db_select_with_pending(qa_db_full_category_selectspec($categoryid, true));
         echo "fullcategory: <pre>"; var_dump($fullcategory); echo "</pre>";
         
         echo "categoryid: <pre>"; var_dump($categoryid); echo "</pre>";
         echo "slugs: <pre>"; var_dump($slugs); echo "</pre>";
         echo "template: <pre>"; var_dump($template); echo "</pre>";
         echo "request: <pre>"; var_dump($request); echo "</pre>";
         */
         require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
         $description = qa_db_categorymeta_get($categoryid, 'useo_cat_description');
         if (!qa_opt('useo_cat_desc_format')) {
             $description = qa_html($description);
         }
         $editurlhtml = qa_path_html('category-edit/' . $categoryid);
         $allowediting = !qa_user_permit_error('useo_cat_desc_permit_edit');
         if (strlen($description)) {
             echo '<SPAN CLASS="entry-content qa-category-description">';
             echo $description;
             echo '</SPAN>';
             if ($allowediting) {
                 echo ' - <A HREF="' . $editurlhtml . '">edit</A>';
             }
         } elseif ($allowediting) {
             echo '<A HREF="' . $editurlhtml . '">' . qa_lang_html('useo/create_desc_link') . '</A>';
         }
     }
 }
开发者ID:Kailashaghera,项目名称:Q2A-Ultimate-SEO,代码行数:58,代码来源:category-widget.php

示例3: output_widget

 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     require_once QA_INCLUDE_DIR . 'qa-app-users.php';
     $allowEdit = !qa_user_permit_error('fb_share_permit_edit');
     $parts = explode('/', qa_self_html());
     if ($allowEdit && $parts[2] == qa_get_logged_in_handle()) {
         $appid = qa_opt('fb_app_id');
         $secret = qa_opt('fb_app_secret');
         $fb = new Facebook\Facebook(['app_id' => $appid, 'app_secret' => $secret, 'default_graph_version' => 'v2.4']);
         $helper = $fb->getRedirectLoginHelper();
         $permissions = ['email', 'publish_actions'];
         $callback = 'http://nathorr.com/qeta/fb-share/' . qa_get_logged_in_handle() . '/';
         $loginUrl = $helper->getLoginUrl($callback, $permissions);
         echo '<a href="' . $loginUrl . '"><img src="http://oi57.tinypic.com/f1xlbt.jpg"></a>';
     }
 }
开发者ID:Nathorr,项目名称:Q2A-Profile-Sharer,代码行数:16,代码来源:qa-profile-sharer-widget.php

示例4: doctype

 function doctype()
 {
     qa_html_theme_base::doctype();
     if (qa_opt('cp_enable') && ($this->template == 'ask' || isset($this->content['q_list']) || isset($this->content['q_view']))) {
         global $qa_request;
         global $wiki_enable;
         if ($this->template == 'ask' && !qa_user_permit_error('permit_post_q') && !qa_opt('site_maintenance') && qa_permit_check('permit_create_cp')) {
             $this->content['form']['tags'] .= ' onSubmit="pollSubmit(event)"';
             $this->content['form']['fields'][] = array('label' => qa_lang('cp/checkbox_text'), 'tags' => 'NAME="cp_community" ID="cp_community"', 'type' => 'checkbox', 'value' => qa_post_text('cp_community') ? 1 : 0);
         }
         if (isset($this->content['q_view'])) {
             $qid = $this->content['q_view']['raw']['postid'];
             $author = $this->content['q_view']['raw']['userid'];
             if (!isset($wiki_enable)) {
                 $result = qa_db_query_sub('SELECT * FROM ^postmeta WHERE meta_key=$ AND post_id=#', 'is_community', $qid);
                 $wiki_enable = $result->num_rows > 0;
             }
             if ($wiki_enable) {
                 // is a community post
                 $this->content['title'] .= ' ' . qa_lang('cp/question_title');
                 // $this->content['q_view']['content'] = @$this->content['q_view']['content'].'<div id="qa-wiki-div">'.$this->getPollDiv($qid,qa_get_logged_in_userid()).'</div>';
                 $this->content['q_view']['main_form_tags'] = @$this->content['q_view']['main_form_tags'] . ' class="qa-community-posts"';
                 // print_r($this->content['q_view']['form']['buttons']);
                 if (isset($this->content['q_view']['form']['buttons']['edit'])) {
                     $this->content['q_view']['form']['buttons']['edit']['label'] = qa_lang_html('cp/contribute');
                     $this->content['q_view']['form']['buttons']['edit']['popup'] = qa_lang_html('cp/contribute_description');
                 }
                 unset($this->content['q_view']['form']['buttons']['answer']);
                 unset($this->content['q_view']['form']['buttons']['comment']);
                 unset($this->content['a_form']);
                 unset($this->content['c_form']);
             }
         }
         if (isset($this->content['q_list'])) {
             $wiki_array = qa_db_read_all_assoc(qa_db_query_sub('SELECT * FROM ^postmeta WHERE meta_key=$', 'is_community'));
             foreach ($wiki_array as $q) {
                 $wiki[(int) $q['post_id']] = $q['meta_value'];
             }
             foreach ($this->content['q_list']['qs'] as $idx => $question) {
                 if (isset($wiki[$question['raw']['postid']])) {
                     $this->content['q_list']['qs'][$idx]['title'] .= ' ' . qa_lang('cp/question_title');
                 }
             }
         }
     }
 }
开发者ID:BrunoVandekerkhove,项目名称:q2a-community-posts,代码行数:46,代码来源:qa-cp-layer.php

示例5: output_widget

 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
     $parts = explode('/', $request);
     $tag = $parts[1];
     $description = qa_db_tagmeta_get($tag, 'description');
     if (!qa_opt('useo_tag_desc_sidebar_html')) {
         $description = qa_html($description);
     }
     $editurlhtml = qa_path_html('tag-edit/' . $tag);
     $allowediting = !qa_user_permit_error('useo_tag_desc_permit_edit');
     if (strlen($description)) {
         echo '<SPAN CLASS="entry-content qa-tag-description">';
         echo $description;
         echo '</SPAN>';
         if ($allowediting) {
             echo ' - <A HREF="' . $editurlhtml . '">edit</A>';
         }
     } elseif ($allowediting) {
         echo '<A HREF="' . $editurlhtml . '">' . qa_lang_html('useo/create_desc_link') . '</A>';
     }
 }
开发者ID:Kailashaghera,项目名称:Q2A-Ultimate-SEO,代码行数:22,代码来源:tag-widget.php

示例6: process_request

 function process_request($request)
 {
     $parts = explode('/', $request);
     $tag = $parts[1];
     $qa_content = qa_content_prepare();
     $qa_content['title'] = qa_lang_html_sub('useo/edit_desc_for_x', qa_html($tag));
     if (qa_user_permit_error('useo_tag_desc_permit_edit')) {
         $qa_content['error'] = qa_lang_html('users/no_permission');
         return $qa_content;
     }
     require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
     if (qa_clicked('dosave')) {
         require_once QA_INCLUDE_DIR . 'qa-util-string.php';
         $taglc = qa_strtolower($tag);
         qa_db_tagmeta_set($taglc, 'title', qa_post_text('tagtitle'));
         qa_db_tagmeta_set($taglc, 'description', qa_post_text('tagdesc'));
         qa_db_tagmeta_set($taglc, 'icon', qa_post_text('tagicon'));
         qa_redirect('tag/' . $tag);
     }
     $qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array(array('label' => 'Title:', 'type' => 'text', 'rows' => 2, 'tags' => 'NAME="tagtitle" ID="tagtitle"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'title'))), array('label' => 'Description:', 'type' => 'text', 'rows' => 4, 'tags' => 'NAME="tagdesc" ID="tagdesc"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'description'))), array('label' => 'Icon image:', 'type' => 'text', 'rows' => 1, 'tags' => 'NAME="tagicon" ID="tagicon"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'icon')))), 'buttons' => array(array('tags' => 'NAME="dosave"', 'label' => qa_lang_html('useo/save_desc_button'))));
     $qa_content['focusid'] = 'tagdesc';
     return $qa_content;
 }
开发者ID:Kailashaghera,项目名称:Q2A-Ultimate-SEO,代码行数:23,代码来源:tag-editor-page.php

示例7: process_request

 function process_request($request)
 {
     $parts = explode('/', $request);
     $categoryid = $parts[1];
     $fullcategory = qa_db_select_with_pending(qa_db_full_category_selectspec($categoryid, true));
     $slugs = explode('/', $fullcategory['backpath']);
     $new_request = implode('/', array_reverse($slugs));
     $qa_content = qa_content_prepare();
     $qa_content['title'] = qa_lang_html_sub('useo/edit_desc_for_x', qa_html($fullcategory['title']));
     if (qa_user_permit_error('useo_cat_desc_permit_edit')) {
         $qa_content['error'] = qa_lang_html('users/no_permission');
         return $qa_content;
     }
     require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
     if (qa_clicked('dosave')) {
         require_once QA_INCLUDE_DIR . 'qa-util-string.php';
         qa_db_categorymeta_set($categoryid, 'useo_cat_title', qa_post_text('useo_cat_title'));
         qa_db_categorymeta_set($categoryid, 'useo_cat_description', qa_post_text('useo_cat_description'));
         qa_redirect($new_request);
     }
     $qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array(array('label' => 'Link Title:', 'type' => 'text', 'rows' => 2, 'tags' => 'NAME="useo_cat_title" ID="useo_cat_title"', 'value' => qa_html(qa_db_categorymeta_get($categoryid, 'useo_cat_title'))), array('label' => 'Description:', 'type' => 'text', 'rows' => 4, 'tags' => 'NAME="useo_cat_description" ID="useo_cat_description"', 'value' => qa_html(qa_db_categorymeta_get($categoryid, 'useo_cat_description')))), 'buttons' => array(array('tags' => 'NAME="dosave"', 'label' => qa_lang_html('useo/save_desc_button'))));
     $qa_content['focusid'] = 'tagtitle';
     return $qa_content;
 }
开发者ID:Kailashaghera,项目名称:Q2A-Ultimate-SEO,代码行数:24,代码来源:category-editor-page.php

示例8: qa_get_logged_in_userid

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]);
        }
    }
}
//	Get information for users
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
//	Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/recent_approve_title');
$qa_content['error'] = isset($pageerror) ? $pageerror : qa_admin_page_error();
$qa_content['q_list'] = array('form' => array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('admin/click'))), 'qs' => array());
if (count($questions)) {
开发者ID:kosmoluna,项目名称:question2answer,代码行数:31,代码来源:admin-moderate.php

示例9: qa_db_user_set_flag

     }
 }
 if (qa_opt('allow_private_messages')) {
     qa_db_user_set_flag($userid, QA_USER_FLAGS_NO_MESSAGES, !$inmessages);
 }
 if (qa_opt('allow_user_walls')) {
     qa_db_user_set_flag($userid, QA_USER_FLAGS_NO_WALL_POSTS, !$inwallposts);
 }
 if (qa_opt('mailing_enabled')) {
     qa_db_user_set_flag($userid, QA_USER_FLAGS_NO_MAILINGS, !$inmailings);
 }
 qa_db_user_set_flag($userid, QA_USER_FLAGS_SHOW_AVATAR, $inavatar == 'uploaded');
 qa_db_user_set_flag($userid, QA_USER_FLAGS_SHOW_GRAVATAR, $inavatar == 'gravatar');
 if (is_array(@$_FILES['file']) && $_FILES['file']['size']) {
     require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
     switch (qa_user_permit_error(null, QA_LIMIT_UPLOADS)) {
         case 'limit':
             $errors['avatar'] = qa_lang('main/upload_limit');
             break;
         default:
             $errors['avatar'] = qa_lang('users/no_permission');
             break;
         case false:
             qa_limits_increment($userid, QA_LIMIT_UPLOADS);
             $toobig = qa_image_file_too_big($_FILES['file']['tmp_name'], qa_opt('avatar_store_size'));
             if ($toobig) {
                 $errors['avatar'] = qa_lang_sub('main/image_too_big_x_pc', (int) ($toobig * 100));
             } elseif (!qa_set_user_avatar($userid, file_get_contents($_FILES['file']['tmp_name']), $useraccount['avatarblobid'])) {
                 $errors['avatar'] = qa_lang_sub('main/image_not_read', implode(', ', qa_gd_image_formats()));
             }
             break;
开发者ID:netham91,项目名称:question2answer,代码行数:31,代码来源:qa-page-account.php

示例10: qa_wall_posts_add_rules

function qa_wall_posts_add_rules($usermessages, $start)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    $userid = qa_get_logged_in_userid();
    $userdeleteall = !(qa_user_permit_error('permit_hide_show') || qa_user_permit_error('permit_delete_hidden'));
    // reuse "Hiding or showing any post" and "Deleting hidden posts" permissions
    $userrecent = $start == 0 && isset($userid);
    // User can delete all of the recent messages they wrote on someone's wall...
    foreach ($usermessages as $key => $message) {
        if ($message['fromuserid'] != $userid) {
            $userrecent = false;
        }
        // ... until we come across one that they didn't write (which could be a reply)
        $usermessages[$key]['deleteable'] = $message['touserid'] == $userid || $userrecent && $message['fromuserid'] == $userid || $userdeleteall;
        // if the user has enough permissions  to delete from any wall
    }
    return $usermessages;
}
开发者ID:netham91,项目名称:question2answer,代码行数:21,代码来源:qa-app-messages.php

示例11: qa_redirect

    qa_redirect('users');
}
if (!isset($loginuserid)) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = qa_insert_login_links(qa_lang_html('misc/message_must_login'), qa_request());
    return $qa_content;
}
//	Find the user profile and questions and answers for this handle
list($toaccount, $torecent, $fromrecent) = qa_db_select_with_pending(qa_db_user_account_selectspec($handle, false), qa_db_recent_messages_selectspec($loginuserid, true, $handle, false), qa_db_recent_messages_selectspec($handle, false, $loginuserid, true));
//	Check the user exists and work out what can and can't be set (if not using single sign-on)
if (!qa_opt('allow_private_messages') || !is_array($toaccount) || $toaccount['flags'] & QA_USER_FLAGS_NO_MESSAGES) {
    return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
//	Check that we have permission and haven't reached the limit
$errorhtml = null;
switch (qa_user_permit_error(null, QA_LIMIT_MESSAGES)) {
    case 'limit':
        $errorhtml = qa_lang_html('misc/message_limit');
        break;
    case false:
        break;
    default:
        $errorhtml = qa_lang_html('users/no_permission');
        break;
}
if (isset($errorhtml)) {
    $qa_content = qa_content_prepare();
    $qa_content['error'] = $errorhtml;
    return $qa_content;
}
//	Process sending a message to user
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:31,代码来源:qa-page-message.php

示例12: array

             $qa_content['form_profile']['fields']['level']['type'] = 'select';
             $leveloptions = array(QA_USER_LEVEL_BASIC, QA_USER_LEVEL_EXPERT, QA_USER_LEVEL_EDITOR, QA_USER_LEVEL_MODERATOR, QA_USER_LEVEL_ADMIN, QA_USER_LEVEL_SUPER);
             foreach ($leveloptions as $leveloption) {
                 if ($leveloption <= $maxlevelassign) {
                     $qa_content['form_profile']['fields']['level']['options'][$leveloption] = qa_html(qa_user_level_string($leveloption));
                 }
             }
         }
         $qa_content['form_profile']['buttons'] = array('save' => array('tags' => 'onClick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('users/save_user')), 'cancel' => array('tags' => 'NAME="docancel"', 'label' => qa_lang_html('main/cancel_button')));
         $qa_content['form_profile']['hidden'] = array('dosave' => '1');
     } else {
         $qa_content['form_profile']['buttons'] = array('edit' => array('tags' => 'NAME="doedit"', 'label' => qa_lang_html('users/edit_user_button')));
         if (isset($maxlevelassign) && $useraccount['level'] < QA_USER_LEVEL_MODERATOR) {
             if ($useraccount['flags'] & QA_USER_FLAGS_USER_BLOCKED) {
                 $qa_content['form_profile']['buttons']['unblock'] = array('tags' => 'NAME="dounblock"', 'label' => qa_lang_html('users/unblock_user_button'));
                 if (count($questions) && !qa_user_permit_error('permit_hide_show')) {
                     $qa_content['form_profile']['buttons']['hideall'] = array('tags' => 'NAME="dohideall" onClick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('users/hide_all_user_button'));
                 }
                 if ($loginlevel >= QA_USER_LEVEL_ADMIN) {
                     $qa_content['form_profile']['buttons']['delete'] = array('tags' => 'NAME="dodelete" onClick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('users/delete_user_button'));
                 }
             } else {
                 $qa_content['form_profile']['buttons']['block'] = array('tags' => 'NAME="doblock"', 'label' => qa_lang_html('users/block_user_button'));
             }
         }
     }
 }
 if (!is_array($qa_content['form_profile']['fields']['removeavatar'])) {
     unset($qa_content['form_profile']['fields']['removeavatar']);
 }
 $qa_content['raw']['account'] = $useraccount;
开发者ID:ruuttt,项目名称:question2answer,代码行数:31,代码来源:qa-page-user.php

示例13: or

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	More about this license: http://www.question2answer.org/license.php
*/
require_once QA_INCLUDE_DIR . 'qa-app-users.php';
require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
//	First check whether the person has permission to do this
if (!qa_user_permit_error('permit_post_a', QA_LIMIT_ANSWERS)) {
    require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
    require_once QA_INCLUDE_DIR . 'qa-app-captcha.php';
    require_once QA_INCLUDE_DIR . 'qa-app-format.php';
    require_once QA_INCLUDE_DIR . 'qa-app-post-create.php';
    require_once QA_INCLUDE_DIR . 'qa-app-cookies.php';
    require_once QA_INCLUDE_DIR . 'qa-page-question-view.php';
    require_once QA_INCLUDE_DIR . 'qa-page-question-submit.php';
    //	Load relevant information about this question and check it exists
    $usecaptcha = qa_user_use_captcha();
    $questionid = qa_post_text('a_questionid');
    $userid = qa_get_logged_in_userid();
    list($question, $childposts) = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $questionid), qa_db_full_child_posts_selectspec($userid, $questionid));
    if (@$question['basetype'] == 'Q' && !isset($question['closedbyid'])) {
        $answers = qa_page_q_load_as($question, $childposts);
        //	Try to create the new answer
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:31,代码来源:qa-ajax-answer.php

示例14: qa_user_moderation_reason

function qa_user_moderation_reason($userlevel = null)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    $reason = false;
    if (!isset($userlevel)) {
        $userlevel = qa_get_logged_in_level();
    }
    if ($userlevel < QA_USER_LEVEL_EXPERT && qa_user_permit_error('permit_moderate')) {
        $userid = qa_get_logged_in_userid();
        if (isset($userid)) {
            if (qa_opt('moderate_users') && qa_opt('moderate_unapproved') && $userlevel < QA_USER_LEVEL_APPROVED) {
                $reason = 'approve';
            } elseif (qa_opt('confirm_user_emails') && qa_opt('moderate_unconfirmed') && !(qa_get_logged_in_flags() & QA_USER_FLAGS_EMAIL_CONFIRMED)) {
                $reason = 'confirm';
            } elseif (qa_opt('moderate_by_points') && qa_get_logged_in_points() < qa_opt('moderate_points_limit')) {
                $reason = 'points';
            }
        } elseif (qa_opt('moderate_anon_post')) {
            $reason = 'login';
        }
    }
    return $reason;
}
开发者ID:kosmoluna,项目名称:question2answer,代码行数:26,代码来源:users.php

示例15: qa_get_vote_view

function qa_get_vote_view($basetype, $full = false, $enabledif = true)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    $disabledsuffix = '';
    if ($basetype == 'Q') {
        $view = qa_opt('voting_on_qs');
        if (!($enabledif && ($full || !qa_opt('voting_on_q_page_only')))) {
            $disabledsuffix = '-disabled-page';
        } elseif (qa_user_permit_error('permit_vote_q') == 'level') {
            $disabledsuffix = '-disabled-level';
        } elseif (qa_user_permit_error('permit_vote_down') == 'level') {
            $disabledsuffix = '-uponly-level';
        }
    } elseif ($basetype == 'A') {
        $view = qa_opt('voting_on_as');
        if (!$enabledif) {
            $disabledsuffix = '-disabled-page';
        } elseif (qa_user_permit_error('permit_vote_a') == 'level') {
            $disabledsuffix = '-disabled-level';
        } elseif (qa_user_permit_error('permit_vote_down') == 'level') {
            $disabledsuffix = '-uponly-level';
        }
    } else {
        $view = false;
    }
    return $view ? (qa_opt('votes_separated') ? 'updown' : 'net') . $disabledsuffix : false;
}
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:30,代码来源:qa-app-options.php


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