本文整理汇总了PHP中qa_request_part函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_request_part函数的具体用法?PHP qa_request_part怎么用?PHP qa_request_part使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qa_request_part函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doctype
function doctype()
{
parent::doctype();
if (QA_FINAL_EXTERNAL_USERS) {
return;
}
// check if logged in
$handle = qa_get_logged_in_handle();
if (isset($handle)) {
if (qa_request() == '' && count($_GET) > 0) {
// Check if we need to associate another provider
$this->process_login();
}
// see if the account pages are accessed
$tmpl = array('account', 'favorites');
$user_pages = array('user', 'user-wall', 'user-activity', 'user-questions', 'user-answers');
$logins_page = qa_request() == 'logins' && !qa_get('confirm');
$urlhandle = qa_request_part(1);
if (in_array($this->template, $tmpl) || $logins_page || in_array($this->template, $user_pages) && $handle == $urlhandle) {
// add a navigation item
$this->content['navigation']['sub']['logins'] = array('label' => qa_lang_html('plugin_open/my_logins_nav'), 'url' => qa_path_html('logins'), 'selected' => $logins_page);
return;
}
} else {
$title = qa_lang_html('plugin_open/login_title');
$descr = qa_lang_html('plugin_open/login_description');
// hide login/register links from navigation on any page
if (qa_opt('open_login_hideform') == '1') {
unset($this->content['navigation']['user']['login']);
unset($this->content['navigation']['user']['register']);
}
// then check if login/register pages are accessed
$tmpl = array('register', 'login');
if (!in_array($this->template, $tmpl)) {
return;
}
// hide regular login/register form on those pages only
if (qa_opt('open_login_hideform') == '1') {
$this->content['title'] = $title;
$this->content['form'] = null;
}
// add some custom text
if (!empty($this->content['custom'])) {
$content = str_ireplace('<BR>', '', $this->content['custom']);
$this->content['custom'] = "<div><p>{$descr}</p>{$content}</div>";
if ($this->content['form'] != null) {
$this->content['custom'] = "<br /><br /><h1>{$title}</h1>{$this->content['custom']}";
}
}
}
}
示例2: qa_user_permit_error
function qa_user_permit_error($permitoption = null, $limitaction = null, $userlevel = null, $checkblocks = true)
{
global $wiki_enable;
$permit_error = qa_user_permit_error_base($permitoption, $limitaction, $userlevel, $checkblocks);
if ($permitoption == 'permit_edit_q' && $permit_error == 'level' && qa_is_logged_in()) {
if (!isset($wiki_enable)) {
$result = qa_db_query_sub('SELECT * FROM ^postmeta WHERE meta_key=$ AND post_id=#', 'is_community', qa_request_part(0));
$wiki_enable = $result->num_rows > 0;
}
if ($wiki_enable) {
return false;
}
}
return $permit_error;
}
示例3: nav
function nav($navtype, $level = null)
{
if (qa_opt(self::ENABLE) && qa_opt(self::REQUEST) != '') {
if ($navtype == 'sub') {
$request = strtolower(qa_request_part(0));
if ($request == 'account' || $request == 'favorites' || $request == qa_opt(self::REQUEST)) {
//$this->content['suggest_next']=qa_lang_html_sub('misc/suggest_favorites_add', '<SPAN CLASS="qa-favorite-image"> </SPAN>');
if (!QA_FINAL_EXTERNAL_USERS) {
$this->content['navigation']['sub'] = qa_account_sub_navigation();
$this->content['navigation']['sub'][qa_opt(self::REQUEST)] = array('label' => qa_lang_html(self::PLUGIN . '/' . self::PAGE_NAVI), 'url' => qa_path_html(qa_opt(self::REQUEST)));
}
}
}
}
qa_html_theme_base::nav($navtype, $level = null);
}
示例4: logged_in
function logged_in()
{
if (qa_get_logged_in_userid()) {
if ($this->template == "question") {
$qnum = qa_request_part("0");
qa_db_query_sub("UPDATE ^userevents SET lastview = NOW() WHERE questionid = {$qnum} AND userid = " . qa_get_logged_in_userid());
}
$questions = qa_db_read_all_assoc(qa_db_query_sub("SELECT DISTINCT(questionid), lastpostid FROM ^userevents WHERE lastview < updated OR lastview IS NULL"));
$count = count($questions);
$notifyclass = "qa-notification-none";
if ($count > 0) {
$notifyclass = "qa-notification-new";
}
$this->output('
<span class="qa-notification-counter ' . $notifyclass . '">' . $count . '</span>
');
$this->output('<div class="qa-notification-dialog">');
foreach ($questions as $question) {
$q = qa_post_get_full($question["questionid"]);
$post = qa_post_get_full($question["lastpostid"]);
$type = "";
if ($post["type"] == "A") {
$type = "answer";
} else {
if ($post["type"] == "C") {
$type = "comment";
}
}
if ($post["userid"] == NULL) {
$user = "anonymous";
} else {
$user = qa_userids_to_handles(array($post["userid"]));
$user = $user[$post["userid"]];
}
$this->output('<div class="qa-notification-dialog-entry">', '<a href="' . qa_q_path($question["questionid"], $q["title"]) . '">' . $q["title"] . '</a>', '<div>New ' . $type . ' by ' . $user . ': "' . substr($post["content"], 0, 100) . '"</div>', '</div>');
}
$this->output('</div>');
}
qa_html_theme_base::logged_in();
}
示例5: init_page
/**
* save category meta data if category is updated
*/
function init_page()
{
if (qa_clicked('dosavecategory') && !qa_clicked('docancel')) {
require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
$categoryid = qa_post_text('edit');
if (!empty($categoryid)) {
// update admin/category form to save form's category meta data
$et_category['et_cat_title'] = qa_post_text('et_category_link_title');
if (!isset($et_category['et_cat_title'])) {
$et_category['et_cat_title'] = '';
}
$et_category['et_cat_desc'] = qa_post_text('et_category_description');
if (!isset($et_category['et_cat_desc'])) {
$et_category['et_cat_desc'] = '';
}
$et_category['et_cat_icon48'] = qa_post_text('et_category_icon_48');
if (!isset($et_category['et_cat_icon48'])) {
$et_category['et_cat_icon48'] = '';
}
$et_category['et_cat_icon64'] = qa_post_text('et_category_icon_64');
if (!isset($et_category['et_cat_icon64'])) {
$et_category['et_cat_icon64'] = '';
}
qa_db_categorymeta_set($categoryid, 'et_category', json_encode($et_category));
}
}
// when loading question page after edit if category is updated, Q2A will attempt to Re-Update question category based on "q_category_X" field.
// this happens when category already exists, and we attempt to change it while editing question.
// here we will set category id to "q_category_1" field, so it wont change it to null after question is updated
$questionid = qa_request_part(0);
$num_questionid = (int) $questionid;
if (qa_clicked('q_dosave') && $questionid == $num_questionid) {
$result = qa_db_read_one_assoc(qa_db_query_sub('SELECT categoryid FROM ^posts WHERE postid=$', $num_questionid), true);
$_POST['q_category_1'] = $result['categoryid'];
}
}
示例6: header
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
*/
if (!defined('QA_VERSION')) {
// don't allow this page to be requested directly from browser
header('Location: ../');
exit;
}
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-users.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
$handle = qa_request_part(1);
$loginuserid = qa_get_logged_in_userid();
// Check we have a handle, we're not using Q2A's single-sign on integration and that we're logged in
if (QA_FINAL_EXTERNAL_USERS) {
qa_fatal_error('User accounts are handled by external code');
}
if (!strlen($handle)) {
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));
示例7: header
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
*/
if (!defined('QA_VERSION')) {
// don't allow this page to be requested directly from browser
header('Location: ../');
exit;
}
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$ip = qa_request_part(1);
// picked up from qa-page.php
if (long2ip(ip2long($ip)) !== $ip) {
return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
// Find recently (hidden, queued or not) questions, answers, comments and edits for this IP
$userid = qa_get_logged_in_userid();
list($qs, $qs_queued, $qs_hidden, $a_qs, $a_queued_qs, $a_hidden_qs, $c_qs, $c_queued_qs, $c_hidden_qs, $edit_qs) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, null, $ip, false), qa_db_qs_selectspec($userid, 'created', 0, null, $ip, 'Q_QUEUED'), qa_db_qs_selectspec($userid, 'created', 0, null, $ip, 'Q_HIDDEN', true), qa_db_recent_a_qs_selectspec($userid, 0, null, $ip, false), qa_db_recent_a_qs_selectspec($userid, 0, null, $ip, 'A_QUEUED'), qa_db_recent_a_qs_selectspec($userid, 0, null, $ip, 'A_HIDDEN', true), qa_db_recent_c_qs_selectspec($userid, 0, null, $ip, false), qa_db_recent_c_qs_selectspec($userid, 0, null, $ip, 'C_QUEUED'), qa_db_recent_c_qs_selectspec($userid, 0, null, $ip, 'C_HIDDEN', true), qa_db_recent_edit_qs_selectspec($userid, 0, null, $ip, false));
// Check we have permission to view this page, and whether we can block or unblock IPs
if (qa_user_maximum_permit_error('permit_anon_view_ips')) {
$qa_content = qa_content_prepare();
$qa_content['error'] = qa_lang_html('users/no_permission');
return $qa_content;
}
$blockable = qa_user_level_maximum() >= QA_USER_LEVEL_MODERATOR;
// allow moderator in one category to block across all categories
示例8: header
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
*/
if (!defined('QA_VERSION')) {
// don't allow this page to be requested directly from browser
header('Location: ../');
exit;
}
require_once QA_INCLUDE_DIR . 'qa-db-admin.php';
require_once QA_INCLUDE_DIR . 'qa-db-maxima.php';
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-options.php';
require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
$adminsection = strtolower(qa_request_part(1));
// Get list of categories and all options
$categories = qa_db_select_with_pending(qa_db_category_nav_selectspec(null, true));
// See if we need to redirect
if (empty($adminsection)) {
$subnav = qa_admin_sub_navigation();
if (isset($subnav[@$_COOKIE['qa_admin_last']])) {
qa_redirect($_COOKIE['qa_admin_last']);
} elseif (count($subnav)) {
reset($subnav);
qa_redirect(key($subnav));
}
}
// Check admin privileges (do late to allow one DB query)
if (!qa_admin_check_privileges($qa_content)) {
return $qa_content;
示例9: head_inline_css
/**
* Dynamic <code>CSS</code> based on options and other interaction with Q2A.
*
* @since Snow 1.4
* @version 1.0
* @return string The CSS code
*/
private function head_inline_css()
{
$css = array('<style>');
if (!qa_is_logged_in()) {
$css[] = '.qa-nav-user { margin: 0 !important; }';
}
if (qa_request_part(1) !== qa_get_logged_in_handle()) {
$css[] = '@media (max-width: 979px) {';
$css[] = ' body.qa-template-user.fixed, body[class*="qa-template-user-"].fixed { padding-top: 118px !important; }';
$css[] = ' body.qa-template-users.fixed { padding-top: 95px !important; }';
$css[] = '}';
$css[] = '@media (min-width: 980px) {';
$css[] = ' body.qa-template-users.fixed { padding-top: 105px !important;}';
$css[] = '}';
}
$css[] = '</style>';
$this->output_array($css);
}
示例10: header
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
*/
if (!defined('QA_VERSION')) {
// don't allow this page to be requested directly from browser
header('Location: ../');
exit;
}
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
require_once QA_INCLUDE_DIR . 'qa-app-updates.php';
$tag = qa_request_part(1);
// picked up from qa-page.php
$start = qa_get_start();
$userid = qa_get_logged_in_userid();
// Find the questions with this tag
if (!strlen($tag)) {
qa_redirect('tags');
}
list($questions, $tagword) = qa_db_select_with_pending(qa_db_tag_recent_qs_selectspec($userid, $tag, $start, false, qa_opt_if_loaded('page_size_tag_qs')), qa_db_tag_word_selectspec($tag));
$pagesize = qa_opt('page_size_tag_qs');
$questions = array_slice($questions, 0, $pagesize);
$usershtml = qa_userids_handles_html($questions);
// Prepare content for theme
$qa_content = qa_content_prepare(true);
$qa_content['title'] = qa_lang_html_sub('main/questions_tagged_x', qa_html($tag));
if (isset($userid) && isset($tagword)) {
示例11: head_inline_css
/**
* Dynamic <code>CSS</code> based on options and other interaction with Q2A.
*
* @since Snow 1.4
* @version 1.0
* @return string The CSS code
*/
private function head_inline_css()
{
$css = array('<style>');
if (!qa_is_logged_in()) {
$css[] = '.qa-nav-user { margin: 0 !important; }';
}
if (qa_request_part(1) !== qa_get_logged_in_handle()) {
$css[] = '@media (max-width: 979px) {';
$css[] = ' body.qa-template-user.fixed, body[class*="qa-template-user-"].fixed { padding-top: 118px !important; }';
$css[] = ' body.qa-template-users.fixed { padding-top: 95px !important; }';
$css[] = '}';
$css[] = '@media (min-width: 980px) {';
$css[] = ' body.qa-template-users.fixed { padding-top: 105px !important;}';
$css[] = '}';
}
// sidebar styles for desktop (must use server-side UA detection, not media queries)
if (!qa_is_mobile_probably()) {
$css[] = '.qa-sidepanel { width: 25%; padding: 0px; float: right; overflow: hidden; *zoom: 1; }';
}
$css[] = '</style>';
$this->output_array($css);
}
示例12: 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/cookies.php';
require_once QA_INCLUDE_DIR . 'app/format.php';
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'util/sort.php';
require_once QA_INCLUDE_DIR . 'util/string.php';
require_once QA_INCLUDE_DIR . 'app/captcha.php';
require_once QA_INCLUDE_DIR . 'pages/question-view.php';
require_once QA_INCLUDE_DIR . 'app/updates.php';
$questionid = qa_request_part(0);
$userid = qa_get_logged_in_userid();
$cookieid = qa_cookie_get();
// Get information about this question
list($question, $childposts, $achildposts, $parentquestion, $closepost, $extravalue, $categories, $favorite) = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $questionid), qa_db_full_child_posts_selectspec($userid, $questionid), qa_db_full_a_child_posts_selectspec($userid, $questionid), qa_db_post_parent_q_selectspec($questionid), qa_db_post_close_post_selectspec($questionid), qa_db_post_meta_selectspec($questionid, 'qa_q_extra'), qa_db_category_nav_selectspec($questionid, true, true, true), isset($userid) ? qa_db_is_favorite_selectspec($userid, QA_ENTITY_QUESTION, $questionid) : null);
if ($question['basetype'] != 'Q') {
// don't allow direct viewing of other types of post
$question = null;
}
if (isset($question)) {
$question['extra'] = $extravalue;
$answers = qa_page_q_load_as($question, $childposts);
$commentsfollows = qa_page_q_load_c_follows($question, $childposts, $achildposts);
$question = $question + qa_page_q_post_rules($question, null, null, $childposts);
// array union
if ($question['selchildid'] && @$answers[$question['selchildid']]['type'] != 'A') {
示例13: doctype
function doctype()
{
if (strpos($this->request, 'user/') !== false && strpos($this->request, 'articles') !== false) {
$this->request = 'user-articles';
}
/*
ADAPT USER PAGES AND SUBPAGES
*/
if ($this->template == 'user' || $this->template == 'user-wall' || $this->template == 'user-activity' || $this->template == 'user-questions' || $this->template == 'user-answers' || $this->request == 'user-articles') {
$handle = qa_request_part(1);
if (!strlen($handle)) {
$handle = qa_get_logged_in_handle();
qa_redirect(isset($handle) ? 'user/' . $handle : 'users');
}
$identifier = QA_FINAL_EXTERNAL_USERS ? $userid : $handle;
list($useraccount, $userprofile, $userfields, $usermessages, $userpoints, $userlevels, $navcategories, $userrank) = qa_db_select_with_pending(QA_FINAL_EXTERNAL_USERS ? null : qa_db_user_account_selectspec($handle, false), QA_FINAL_EXTERNAL_USERS ? null : qa_db_user_profile_selectspec($handle, false), QA_FINAL_EXTERNAL_USERS ? null : qa_db_userfields_selectspec(), QA_FINAL_EXTERNAL_USERS ? null : qa_db_recent_messages_selectspec(null, null, $handle, false, qa_opt_if_loaded('page_size_wall')), qa_db_user_points_selectspec($identifier), qa_db_user_levels_selectspec($identifier, QA_FINAL_EXTERNAL_USERS, true), qa_db_category_nav_selectspec(null, true), qa_db_user_rank_selectspec($identifier));
$userid = $useraccount['userid'];
$loginuserid = qa_get_logged_in_userid();
if ($this->template == 'user') {
// ADAPT FORM CONTENTS
/*$this->content['form_activity']['fields']['activity'] = array('type'=>'static',
'label'=>'Recent Activity',
'value'=>'<a href="'.$handle.'/activity">show</a>');*/
// ADD PRIVATE MESSAGE LINK AFTER MEMBERSHIP DURATION
if (qa_opt('allow_private_messages') && isset($loginuserid) && $loginuserid != $userid && !($useraccount['flags'] & QA_USER_FLAGS_NO_MESSAGES)) {
$this->content['form_profile']['fields']['duration']['value'] .= strtr(qa_lang_html('profile/send_private_message'), array('^1' => '<a href="' . qa_path_html('message/' . $handle) . '">', '^2' => '</a>'));
}
}
$site_url = qa_opt('site_url');
// RENEW THE SUB-NAVIGATION
unset($this->content['navigation']['sub']);
$this->content['navigation']['sub']['account'] = array('label' => 'User ' . $handle, 'url' => $site_url . '/user/' . $handle, 'selected' => $this->template == 'user' ? 1 : 0);
$this->content['navigation']['sub']['wall'] = array('label' => $handle . '\'s Wall', 'url' => $site_url . '/user/' . $handle . '/wall', 'selected' => $this->template == 'user-wall' ? 1 : 0);
$this->content['navigation']['sub']['activity'] = array('label' => qa_lang('qa_blog_lang/nav_activity'), 'url' => $site_url . '/user/' . $handle . '/activity', 'selected' => $this->template == 'user-activity' ? 1 : 0);
$this->content['navigation']['sub']['questions'] = array('label' => qa_lang('qa_blog_lang/nav_questions'), 'url' => $site_url . '/user/' . $handle . '/questions', 'selected' => $this->template == 'user-questions' ? 1 : 0);
$this->content['navigation']['sub']['answers'] = array('label' => qa_lang('qa_blog_lang/nav_answers'), 'url' => $site_url . '/user/' . $handle . '/answers', 'selected' => $this->template == 'user-answers' ? 1 : 0);
$this->content['navigation']['sub']['articles'] = array('label' => qa_lang('qa_blog_lang/nav_articles'), 'url' => $site_url . '/user/' . $handle . '/articles', 'selected' => $this->request == 'user-articles' ? 1 : 0);
$this->content['navigation']['sub']['newarticles'] = array('label' => qa_lang('qa_blog_lang/new_articles'), 'url' => $site_url . '/articles', 'selected' => $this->request == 'articles' ? 1 : 0);
if ($this->request == 'user-articles') {
unset($this->content['title']);
$this->content['title'] = qa_lang('qa_blog_lang/title_recent') . " {$handle}";
unset($this->content['suggest_next']);
unset($this->content['error']);
if ($this->request == 'user-articles') {
$qa_content['custom'] = "";
$html = "";
$result = qa_db_query_sub("SELECT * FROM ^blog_posts WHERE userid = '{$userid}' ORDER BY posted DESC");
$i = 0;
while ($article = mysqli_fetch_array($result)) {
$i++;
$html .= article_item($article['title'], $site_url . '/blog/' . $article['postid'] . '/' . seoUrl2($article['title']) . '/', $article['posted'], $article['views']);
}
if ($i == 0) {
$html = "<h3>" . qa_lang('qa_blog_lang/oops') . " {$handle} " . qa_lang('qa_blog_lang/no_post') . "</h3>";
}
$this->content['custom'] = $html;
}
}
} else {
if ($this->template == 'account' || $this->template == 'favorites' || $this->template == 'updates' || $this->request == 'gallery' || $this->request == 'articles') {
// ADAPT FORM FOR DETAILS SUBPAGE
// RENEW THE SUB-NAVIGATION
unset($this->content['navigation']['sub']);
$this->content['navigation']['sub']['account'] = array('label' => 'My Details', 'url' => './account', 'selected' => $this->template == 'account' ? 1 : 0);
$this->content['navigation']['sub']['favorites'] = array('label' => 'My Favorites', 'url' => './favorites', 'selected' => $this->template == 'favorites' ? 1 : 0);
$this->content['navigation']['sub']['updates'] = array('label' => 'My Updates', 'url' => './updates', 'selected' => $this->template == 'updates' ? 1 : 0);
$this->content['navigation']['sub']['articles'] = array('label' => 'My Articles', 'url' => './articles', 'selected' => $this->request == 'articles' ? 1 : 0);
} else {
if ($this->template == 'users') {
require_once QA_INCLUDE_DIR . 'qa-db-users.php';
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$start = qa_get_start();
$users = qa_db_select_with_pending(qa_db_top_users_selectspec($start, qa_opt_if_loaded('page_size_users')));
$usercount = qa_opt('cache_userpointscount');
$pagesize = qa_opt('page_size_users');
$users = array_slice($users, 0, $pagesize);
$usershtml = qa_userids_handles_html($users);
// CHANGE TITLE
$this->content['title'] = 'Users';
$this->content['ranking'] = array('items' => array(), 'rows' => ceil($pagesize / qa_opt('columns_users')), 'type' => 'users');
if (count($users)) {
foreach ($users as $userid => $user) {
$this->content['ranking']['items'][] = array('label' => (QA_FINAL_EXTERNAL_USERS ? qa_get_external_avatar_html($user['userid'], qa_opt('avatar_users_size'), true) : qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'], $user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true)) . ' ' . $usershtml[$user['userid']], 'score' => qa_html(number_format($user['points'])));
}
} else {
$this->content['title'] = qa_lang_html('main/no_active_users');
}
$this->content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $usercount, qa_opt('pages_prev_next'));
// EMPTY SUB-NAVIGATION
$this->content['navigation']['sub'] = null;
}
}
}
if ($this->template == 'questions') {
unset($this->content['navigation']['sub']);
$this->content['navigation']['sub']['account'] = array('label' => 'My Details', 'url' => './account', 'selected' => 0);
//print_r ($this->content['navigation']);
}
if ($this->request == 'login') {
//.........这里部分代码省略.........
示例14: navigation
public function navigation($themeclass)
{
$link = array('label' => qa_lang_html('notification/notf_settings_user_nav'), 'url' => qa_path_html('notification-settings'), 'icon' => 'icon-cog');
if (qa_is_logged_in()) {
$themeclass['navigation']['user']['notification-settings'] = $link;
if (qa_request_part(0) == 'notification-settings') {
$themeclass['navigation']['user']['notification-settings']['selected'] = true;
}
}
$handle = qa_request_part(1);
if (qa_is_logged_in() && ($handle === qa_get_logged_in_handle() || qa_request_part(0) == 'notification-settings')) {
$themeclass['navigation']['sub']['notification-settings'] = $link;
if (qa_request_part(0) == 'notification-settings') {
$themeclass['navigation']['sub']['notification-settings']['selected'] = true;
}
}
return $themeclass;
}
示例15: main
function main()
{
$content = $this->content;
$class = 'main';
if ($this->template == 'admin' && qa_opt('cs_nav_position') == 'top') {
$this->nav('sub');
}
$this->output('<div class="clearfix qa-main' . (@$this->content['hidden'] ? ' qa-main-hidden' : '') . '">');
$col_width = $this->cs_position_active('Right') && $this->template != 'question';
$this->output('<div class="col-sm-' . ($col_width ? '8' : '12') . ' list-c">');
if ($this->template != 'user-answers' && $this->template != 'user-questions' && $this->template != 'user-activity' && $this->template != 'user-wall' && $this->template != 'question' && $this->template != 'user' && !strlen(qa_request(1)) == 0 && !empty($this->content['title'])) {
$this->output('<h1 class="page-title">', $this->content['title']);
$this->feed();
$this->favorite();
$this->output('</h1>');
}
if ($this->cs_position_active('Header')) {
$this->output('<div class="header-position-c clearfix">');
$this->output('<h1 class="intro-title"> ' . qa_lang_html('cleanstrap/got_questions') . '</h1>');
if ($this->cs_position_active('Header Left')) {
$this->output('<div class="col-md-' . $class . '">');
$this->cs_position('Header Left');
$this->output('</div>');
}
if ($this->cs_position_active('Header')) {
$this->output('<div class="col-md-' . (12 - @$class) . '">');
$this->cs_position('Header');
$this->output('</div>');
}
if ($this->cs_position_active('Header Right')) {
$this->output('<div class="col-md-' . $class . '">');
$this->cs_position('Header Right');
$this->output('</div>');
}
$this->output('</div>');
}
if ($this->template != 'question') {
$this->cs_position('Content Top');
}
if (isset($this->content['error'])) {
$this->error(@$this->content['error']);
}
if ($this->template == 'user' && !(isset($_REQUEST['state']) && $_REQUEST['state'] == 'edit')) {
$this->profile_page();
} elseif (strlen(qa_request(1)) == 0) {
$this->home($content);
} elseif ($this->template == 'question') {
$this->question_view($content);
} elseif ($this->template == 'user-wall') {
$handle = qa_request_part(1);
$this->output('<section id="content" class="content-sidebar user-cols">');
$this->cs_user_nav($handle);
$this->output('<div class="messages">');
$this->message_list_and_form($this->content['message_list']);
$this->output('</div></section>');
} elseif ($this->template == 'user' && (isset($_REQUEST['state']) && $_REQUEST['state'] == 'edit')) {
$handle = qa_request_part(1);
if (!strlen($handle)) {
$handle = qa_get_logged_in_handle();
}
$this->output('<section id="content" class="content-sidebar user-cols">');
$this->cs_user_nav($handle);
$this->main_parts($content);
$this->output('</section>');
} elseif ($this->template == 'account' || $this->template == 'favorites' || $this->template == 'user-activity' || $this->template == 'user-questions' || $this->template == 'user-answers') {
$handle = qa_request_part(1);
if (!strlen($handle)) {
$handle = qa_get_logged_in_handle();
}
$this->output('<section id="content" class="content-sidebar user-cols">');
$this->cs_user_nav($handle);
$this->main_parts($content);
$this->output('</section>');
} else {
if ($this->template != 'admin') {
$this->nav('sub');
}
$this->main_parts($content);
if ($this->template != 'question') {
$this->page_links();
}
$this->suggest_next();
}
$this->cs_position('Content Bottom');
$this->output('</div>');
if ($col_width) {
$this->sidepanel();
}
$this->output('</div>');
$this->cs_position('Bottom');
$this->footer();
}