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


PHP qa_is_logged_in函数代码示例

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


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

示例1: output_widget

    function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
    {
        $out = '';
        require_once QA_INCLUDE_DIR . 'qa-app-users.php';
        if (qa_is_logged_in()) {
            $out = '


			<button id="adchattoggle" class="adchattoggle">Show/Hide Chat </button>';
            $out .= '<div class="adchat" id="adchat" style="display:';
            if (@$_COOKIE['showadchat'] == 'block') {
                $out .= "block";
            } else {
                $out .= "none";
            }
            $out .= '">';
            $out .= '
	
				<iframe src="' . $this->urltoroot . 'chat/" style="border:0; width:100%; height:480px;"></iframe>
				 </div>';
        } else {
            $out = '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
				<ins class="adsbygoogle"
				style="display:block"
				data-ad-client="' . qa_html(qa_opt("adsense_publisher_id")) . '"
				data-ad-slot="' . qa_html(qa_opt("adsense_adunit_id")) . '"
				data-ad-format="auto"></ins>
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
			</script>';
        }
        $output = '<div class="adchat-widget-container">' . $out . '</div>';
        $themeobject->output($output);
    }
开发者ID:arjunsuresh,项目名称:chat,代码行数:34,代码来源:qa-adchat-widget.php

示例2: hw_init_current_userlogin

/**
 * init current user logined
 */
function hw_init_current_userlogin()
{
    global $iflychat_userinfo;
    //init user
    if (qa_is_logged_in()) {
        $handle = qa_get_logged_in_handle();
        //user name
        $userid = qa_get_logged_in_userid();
        //user id
        $user = qa_db_select_with_pending(qa_db_user_account_selectspec($handle, false));
        //get user avatar src
        $avatar_src = hw_get_user_avatar_src($user['flags'], $user['email'], $user['avatarblobid']);
        if (empty($avatar_src)) {
            $avatar_src = 'https://iflychat.com/sites/all/modules/drupalchat/themes/light/images/default_avatar.png';
        }
        //set detail current user to chat
        $iflychat_userinfo = new iFlyChatUserDetails($handle, $userid);
        $iflychat_userinfo->setIsAdmin(TRUE);
        $iflychat_userinfo->setAvatarUrl($avatar_src);
        $iflychat_userinfo->setProfileLink(qa_opt('site_url') . 'user/' . $handle);
        $iflychat_userinfo->setRoomRoles(array());
        $iflychat_userinfo->setRelationshipSet(FALSE);
        //$iflychat_userinfo->setAllRoles(array('1'=>'admin'));
    }
}
开发者ID:hoangsoft90,项目名称:q2a-hw-imgur-uploader,代码行数:28,代码来源:functions.php

示例3: match_request

 function match_request($request)
 {
     if (qa_is_logged_in() && $request == 'notifications') {
         return true;
     }
     return false;
 }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:7,代码来源:notification-page.php

示例4: logged_in

 function logged_in()
 {
     qa_html_theme_base::logged_in();
     if (qa_is_logged_in()) {
         $userpoints = qa_get_logged_in_points();
         $pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
         $this->output('<SPAN CLASS="qa-logged-in-points">', '(' . $pointshtml . ')', '</SPAN>');
     }
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:9,代码来源:qa-theme.php

示例5: logged_in

 function logged_in()
 {
     if (qa_is_logged_in()) {
         // output user avatar to login bar
         $this->output('<div class="qa-logged-in-avatar">', QA_FINAL_EXTERNAL_USERS ? qa_get_external_avatar_html(qa_get_logged_in_userid(), 24, true) : qa_get_user_avatar_html(qa_get_logged_in_flags(), qa_get_logged_in_email(), qa_get_logged_in_handle(), qa_get_logged_in_user_field('avatarblobid'), qa_get_logged_in_user_field('avatarwidth'), qa_get_logged_in_user_field('avatarheight'), 24, true), '</div>');
     }
     qa_html_theme_base::logged_in();
     if (qa_is_logged_in()) {
         // adds points count after logged in username
         $userpoints = qa_get_logged_in_points();
         $pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
         $this->output('<span class="qa-logged-in-points">', '(' . $pointshtml . ')', '</span>');
     }
 }
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:14,代码来源:qa-theme.php

示例6: 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;
}
开发者ID:BrunoVandekerkhove,项目名称:q2a-community-posts,代码行数:15,代码来源:qa-cp-overrides.php

示例7: qa_check_form_security_code

function qa_check_form_security_code($action, $value)
{
    if (qa_caching_main::now_caching()) {
        $reportproblems = array();
        $silentproblems = array();
        if (!isset($value)) {
            $silentproblems[] = 'code missing';
        } elseif (!strlen($value)) {
            $silentproblems[] = 'code empty';
        } else {
            $parts = explode('-', $value);
            if (count($parts) == 3) {
                $loggedin = $parts[0];
                $timestamp = $parts[1];
                $hash = $parts[2];
                $timenow = qa_opt('db_time');
                if ($loggedin != '0') {
                    $reportproblems[] = 'login status mismatch';
                }
                /*if ($timestamp>$timenow)
                      $reportproblems[]='time '.($timestamp-$timenow).'s in future';
                  else*/
                if ($timestamp < $timenow - QA_FORM_EXPIRY_SECS) {
                    $silentproblems[] = 'timeout after ' . ($timenow - $timestamp) . 's';
                }
                $key = @$_COOKIE['qa_key'];
                if (!isset($key)) {
                    $silentproblems[] = 'key cookie missing';
                } elseif (!strlen($key)) {
                    $silentproblems[] = 'key cookie empty';
                } elseif (strlen($key) != QA_FORM_KEY_LENGTH) {
                    $reportproblems[] = 'key cookie ' . $key . ' invalid';
                }
                if ($hash != $key) {
                    $reportproblems[] = 'key cookie mismatch';
                }
            } else {
                $reportproblems[] = 'code ' . $value . ' malformed';
            }
        }
        if (count($reportproblems)) {
            @error_log('PHP Question2Answer form security violation for ' . $action . ' by ' . (qa_is_logged_in() ? 'userid ' . qa_get_logged_in_userid() : 'anonymous') . ' (' . implode(', ', array_merge($reportproblems, $silentproblems)) . ')' . ' on ' . @$_SERVER['REQUEST_URI'] . ' via ' . @$_SERVER['HTTP_REFERER']);
        }
        return empty($silentproblems) && empty($reportproblems);
    } else {
        return qa_check_form_security_code_base($action, $value);
    }
}
开发者ID:amiyasahu,项目名称:q2a-caching,代码行数:48,代码来源:qa-caching-overrides.php

示例8: qa_admin_check_privileges

function qa_admin_check_privileges(&$qa_content)
{
    if (!qa_is_logged_in()) {
        require_once QA_INCLUDE_DIR . 'qa-app-format.php';
        $qa_content = qa_content_prepare();
        $qa_content['title'] = qa_lang_html('admin/admin_title');
        $qa_content['error'] = qa_insert_login_links(qa_lang_html('admin/not_logged_in'), qa_request());
        return false;
    } elseif (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
        $qa_content = qa_content_prepare();
        $qa_content['title'] = qa_lang_html('admin/admin_title');
        $qa_content['error'] = qa_lang_html('admin/no_privileges');
        return false;
    }
    return true;
}
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:16,代码来源:qa-app-admin.php

示例9: head_script

    function head_script()
    {
        qa_html_theme_base::head_script();
        // only load if enabled and user logged-in
        if (qa_opt('q2apro_onsitenotifications_enabled') && qa_is_logged_in()) {
            $this->output('<script type="text/javascript">
						var eventnotifyAjaxURL = "' . qa_path('eventnotify') . '";
					</script>');
            $this->output('<script type="text/javascript" src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'script.js"></script>');
            $this->output('<link rel="stylesheet" type="text/css" href="' . QA_HTML_THEME_LAYER_URLTOROOT . 'styles.css">');
            // hack for snow flat theme (q2a v1.7) to show the notification icon outside the user's drop down
            if (qa_opt('site_theme') == 'SnowFlat') {
                $this->output('
					<script type="text/javascript">
						$(document).ready(function(){
							// $("#osnbox").detach().appendTo(".qam-account-items-wrapper");
							var elem = $("#osnbox").detach();
							$(".qam-account-items-wrapper").prepend(elem);
						});
					</script>
					');
            }
            // hack for snow theme (q2a v1.6) to position the notification box more to the right
            if (qa_opt('site_theme') == 'Snow') {
                $this->output('
					<style type="text/css">
						#nfyWrap {
							left:-100px;
						}
					</style>
					');
            }
            // from q2a v1.7 we can use: $isRTL = $this->isRTL; but prior q2a versions can not, so we provide an admin option
            if (qa_opt('q2apro_onsitenotifications_rtl')) {
                $this->output('
					<style type="text/css">
						#nfyReadClose {
							float:left !important;
						}
						.nfyWrap .nfyTop {
							text-align:right;
						}
						.nfyContainer {
							direction: rtl !important;
							text-align: right !important;
						}
						.nfyWrap .nfyFooter {
							text-align:left;
						}
						.nfyIcon {
							float:right;
						}
						.nfyWrap .nfyItemLine {
							float:right;
							margin-right:5px;
						}
						/* Snow Flat hacks */
						.qam-account-items-wrapper #osnbox {
							float: right;
							margin-right:-30px;
						}
						.qam-account-items-wrapper .nfyWrap {
							top: 31px;
							left: 0;
						}
					</style>
					');
            }
        }
        // end enabled
    }
开发者ID:Kasparohub,项目名称:q2apro-on-site-notifications,代码行数:71,代码来源:q2apro-onsitenotifications-layer.php

示例10: post_avatar

 function post_avatar($post, $class, $prefix = null)
 {
     if (qa_opt('it_layout_lists') == 'qlist') {
         qa_html_theme_base::post_avatar($post, $class, $prefix = null);
         return;
     }
     // check if it's a question list or question item
     if ($class != 'qa-q-item') {
         //if (!( ($this->template=='qa') or ($this->template=='questions') ))
         qa_html_theme_base::post_avatar($post, $class, $prefix);
     } else {
         $qlink = qa_q_path($post['raw']['postid'], $post['raw']['title'], true);
         $this->output('<div class="q-item-meta">');
         // set avatar
         if (isset($post['avatar'])) {
             if (isset($prefix)) {
                 $this->output($prefix);
             }
             $this->output('<section class="' . $class . '-avatar">' . $post['avatar']);
             $this->output('<section class="popup-user-avatar">');
             qa_html_theme_base::post_meta_what($post, $class);
             qa_html_theme_base::post_meta_who($post, $class);
             $this->output('</section>');
             $this->output('</section>');
         }
         // set category
         if ($post["raw"]["categoryid"]) {
             require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
             $categoryid = $post["raw"]["categoryid"];
             $catname = $post["raw"]["categoryname"];
             $catbackpath = $post["raw"]["categorybackpath"];
             $et_category = json_decode(qa_db_categorymeta_get($categoryid, 'et_category'), true);
             $this->output('<section class="' . $class . '-category">');
             $categorypathprefix = 'questions/';
             $this->output('<a class="' . $class . '-category-link" title="' . $et_category['et_cat_title'] . '" href="' . qa_path_html($categorypathprefix . implode('/', array_reverse(explode('/', $catbackpath)))) . '">');
             if (!empty($et_category['et_cat_icon48'])) {
                 $this->output('<img class="qa-category-image" width="48" height="48" alt="' . $et_category['et_cat_desc'] . '" src="' . $et_category['et_cat_icon48'] . '">');
             } else {
                 $this->output(qa_html($catname));
             }
             $this->output('</a>');
             if (!empty($et_category['et_cat_desc'])) {
                 $this->output('<section class="' . $class . '-category-description">');
                 $this->output($et_category['et_cat_desc']);
                 $this->output('</section>');
             }
             $this->output('</section>');
         }
         $this->output('</div>');
         $this->output('<div class="qa-item-meta-bar">');
         // Voting
         $this->voting_inner_html($post);
         // favourites
         if (qa_is_logged_in()) {
             $favourited = $post['favourited'];
             $favorite = qa_favorite_form(QA_ENTITY_QUESTION, $post['raw']['postid'], $favourited, qa_lang($favourited ? 'question/remove_q_favorites' : 'question/add_q_favorites'));
             if (isset($favorite)) {
                 //$this->output('<form '.$favorite['form_tags'].'>');
                 $this->output('<div class="qa-favoriting qa-favoriting-' . $post['raw']['postid'] . '" ' . @$favorite['favorite_tags'] . '>');
                 $this->favorite_inner_html($favorite, $post['favourites']);
                 $this->output('</div>');
                 $this->output('<input type="hidden" id="fav_code_' . $post['raw']['postid'] . '" name="fav_code" value="' . @$favorite['form_hidden']['code'] . '"/>');
                 //$this->output('</form>');
             }
         } else {
             $this->output('<div class="qa-favoriting qa-favoriting-' . $post['raw']['postid'] . '" ' . @$favorite['favorite_tags'] . '>');
             $this->output('<button class="btn btn-default btn-xs fa fa-heart qa-favorite" type="button" onclick="return qa_favorite_click(this);" name="favorite-login_q' . $post['raw']['postid'] . '" title="Favourite">' . $post['favourites'] . '</button>');
             //<button class="btn btn-default btn-xs fa fa-heart qa-favorite" type="button" onclick="return qa_favorite_click(this);" name="favorite_Q_125_1" title="Add to my favorites">2</button>
             $this->output('</div>');
         }
         // discussions
         $this->output('<div class="qa-list-discussions">');
         $this->output('<a class="btn btn-default btn-xs fa fa-comment discussions-item-list" href="' . $qlink . '">' . ($post['comments'] + $post["answers_raw"]) . '</a>');
         $this->output('</div>');
         // Share
         $this->output('<div class="qa-list-share">');
         $this->output('<button type="button" class="btn btn-default btn-xs fa fa-share-alt share-item-list" data-share-link="' . $qlink . '" data-share-title="' . $post['raw']['title'] . '"></button>');
         $this->output('</div>');
         $this->output('</div>');
     }
     //qa_html_theme_base::voting_inner_html($post);
 }
开发者ID:swuit,项目名称:swuit-q2a,代码行数:82,代码来源:qa-layer-base.php

示例11: qa_content_prepare


//.........这里部分代码省略.........
    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
            }
        }
    }
    $logoshow = qa_opt('logo_show');
    $logourl = qa_opt('logo_url');
    $logowidth = qa_opt('logo_width');
    $logoheight = qa_opt('logo_height');
    if ($logoshow) {
        $qa_content['logo'] = '<a href="' . qa_path_html('') . '" class="qa-logo-link" title="' . qa_html(qa_opt('site_title')) . '">' . '<img src="' . qa_html(is_numeric(strpos($logourl, '://')) ? $logourl : qa_path_to_root() . $logourl) . '"' . ($logowidth ? ' width="' . $logowidth . '"' : '') . ($logoheight ? ' height="' . $logoheight . '"' : '') . ' border="0" alt="' . qa_html(qa_opt('site_title')) . '"/></a>';
    } else {
        $qa_content['logo'] = '<a href="' . qa_path_html('') . '" class="qa-logo-link">' . qa_html(qa_opt('site_title')) . '</a>';
    }
    $topath = qa_get('to');
    // lets user switch between login and register without losing destination page
    $userlinks = qa_get_login_links(qa_path_to_root(), isset($topath) ? $topath : qa_path($request, $_GET, ''));
    $qa_content['navigation']['user'] = array();
    if (qa_is_logged_in()) {
        $qa_content['loggedin'] = qa_lang_html_sub_split('main/logged_in_x', QA_FINAL_EXTERNAL_USERS ? qa_get_logged_in_user_html(qa_get_logged_in_user_cache(), qa_path_to_root(), false) : qa_get_one_user_html(qa_get_logged_in_handle(), false));
        $qa_content['navigation']['user']['updates'] = array('url' => qa_path_html('updates'), 'label' => qa_lang_html('main/nav_updates'));
        if (!empty($userlinks['logout'])) {
            $qa_content['navigation']['user']['logout'] = array('url' => qa_html(@$userlinks['logout']), 'label' => qa_lang_html('main/nav_logout'));
        }
        if (!QA_FINAL_EXTERNAL_USERS) {
            $source = qa_get_logged_in_source();
            if (strlen($source)) {
                $loginmodules = qa_load_modules_with('login', 'match_source');
                foreach ($loginmodules as $module) {
                    if ($module->match_source($source) && method_exists($module, 'logout_html')) {
                        ob_start();
                        $module->logout_html(qa_path('logout', array(), qa_opt('site_url')));
                        $qa_content['navigation']['user']['logout'] = array('label' => ob_get_clean());
                    }
                }
            }
        }
        $notices = qa_db_get_pending_result('notices');
        foreach ($notices as $notice) {
            $qa_content['notices'][] = qa_notice_form($notice['noticeid'], qa_viewer_html($notice['content'], $notice['format']), $notice);
        }
    } else {
        require_once QA_INCLUDE_DIR . 'util/string.php';
        if (!QA_FINAL_EXTERNAL_USERS) {
            $loginmodules = qa_load_modules_with('login', 'login_html');
            foreach ($loginmodules as $tryname => $module) {
                ob_start();
                $module->login_html(isset($topath) ? qa_opt('site_url') . $topath : qa_path($request, $_GET, qa_opt('site_url')), 'menu');
                $label = ob_get_clean();
                if (strlen($label)) {
                    $qa_content['navigation']['user'][implode('-', qa_string_to_words($tryname))] = array('label' => $label);
                }
            }
        }
        if (!empty($userlinks['login'])) {
            $qa_content['navigation']['user']['login'] = array('url' => qa_html(@$userlinks['login']), 'label' => qa_lang_html('main/nav_login'));
        }
        if (!empty($userlinks['register'])) {
            $qa_content['navigation']['user']['register'] = array('url' => qa_html(@$userlinks['register']), 'label' => qa_lang_html('main/nav_register'));
        }
    }
    if (QA_FINAL_EXTERNAL_USERS || !qa_is_logged_in()) {
        if (qa_opt('show_notice_visitor') && !isset($topath) && !isset($_COOKIE['qa_noticed'])) {
            $qa_content['notices'][] = qa_notice_form('visitor', qa_opt('notice_visitor'));
        }
    } else {
        setcookie('qa_noticed', 1, time() + 86400 * 3650, '/', QA_COOKIE_DOMAIN);
        // don't show first-time notice if a user has logged in
        if (qa_opt('show_notice_welcome') && qa_get_logged_in_flags() & QA_USER_FLAGS_WELCOME_NOTICE) {
            if ($requestlower != 'confirm' && $requestlower != 'account') {
                // let people finish registering in peace
                $qa_content['notices'][] = qa_notice_form('welcome', qa_opt('notice_welcome'));
            }
        }
    }
    $qa_content['script_rel'] = array('qa-content/jquery-1.11.2.min.js');
    $qa_content['script_rel'][] = 'qa-content/qa-page.js?' . QA_VERSION;
    if ($voting) {
        $qa_content['error'] = @$qa_page_error_html;
    }
    $qa_content['script_var'] = array('qa_root' => qa_path_to_root(), 'qa_request' => $request);
    return $qa_content;
}
开发者ID:Trideon,项目名称:gigolo,代码行数:101,代码来源:qa-page.php

示例12: voting_inner_html

 function voting_inner_html($post)
 {
     if (qw_hook_exist(__FUNCTION__)) {
         $args = func_get_args();
         array_unshift($args, $this);
         return qw_event_hook(__FUNCTION__, $args, NULL);
     }
     $up_tags = preg_replace('/onclick="([^"]+)"/', '', str_replace('name', 'data-id', @$post['vote_up_tags']));
     $down_tags = preg_replace('/onclick="([^"]+)"/', '', str_replace('name', 'data-id', @$post['vote_down_tags']));
     if (qa_is_logged_in()) {
         $user_point = qa_get_logged_in_points();
         if ($post['raw']['type'] == 'Q') {
             if (qa_opt('permit_vote_q') == '106') {
                 $need = qa_opt('permit_vote_q_points') - $user_point;
                 $up_tags = str_replace(qa_lang_html('main/vote_disabled_level'), 'You need ' . $need . ' more points to vote', $up_tags);
             }
             if (qa_opt('permit_vote_q') == '106' && qa_opt('permit_vote_down') == '106') {
                 $max = max(qa_opt('permit_vote_down_points'), qa_opt('permit_vote_q_points'));
                 $need = $max - $user_point;
                 $down_tags = preg_replace('/title="([^"]+)"/', 'title="You need ' . $need . ' more points to vote" ', $down_tags);
             } elseif (qa_opt('permit_vote_q') == '106') {
                 $need = qa_opt('permit_vote_q_points') - $user_point;
                 $down_tags = preg_replace('/title="([^"]+)"/', 'title="You need ' . $need . ' more points to vote" ', $down_tags);
             } elseif (qa_opt('permit_vote_down') == '106') {
                 $need = qa_opt('permit_vote_down_points') - $user_point;
                 $down_tags = preg_replace('/title="([^"]+)"/', 'title="You need ' . $need . ' more points to vote" ', $down_tags);
             }
         }
         if ($post['raw']['type'] == 'A') {
             if (qa_opt('permit_vote_a') == '106') {
                 $need = qa_opt('permit_vote_a_points') - $user_point;
                 $up_tags = str_replace(qa_lang_html('main/vote_disabled_level'), 'You need ' . $need . ' more points to vote', $up_tags);
             }
             if (qa_opt('permit_vote_a') == '106' && qa_opt('permit_vote_down') == '106') {
                 $max = max(qa_opt('permit_vote_down_points'), qa_opt('permit_vote_a_points'));
                 $need = $max - $user_point;
                 $down_tags = preg_replace('/title="([^"]+)"/', 'title="You need ' . $need . ' more points to vote" ', $down_tags);
             } elseif (qa_opt('permit_vote_a') == '106') {
                 $need = qa_opt('permit_vote_a_points') - $user_point;
                 $down_tags = preg_replace('/title="([^"]+)"/', 'title="You need ' . $need . ' more points to vote" ', $down_tags);
             } elseif (qa_opt('permit_vote_down') == '106') {
                 $need = qa_opt('permit_vote_down_points') - $user_point;
                 $down_tags = preg_replace('/title="([^"]+)"/', 'title="You need ' . $need . ' more points to vote" ', $down_tags);
             }
         }
     }
     $state = @$post['vote_state'];
     $code = qa_get_form_security_code('vote');
     $vote_text = $post['raw']['netvotes'] > 1 || $post['raw']['netvotes'] < -1 ? _ra_lang('votes') : _ra_lang('vote');
     $this->output('<p class="count">' . $post['raw']['netvotes'] . '<span>' . $vote_text . '</span></p>');
     if (isset($post['vote_up_tags'])) {
         $this->output('<a ' . @$up_tags . ' href="#" data-code="' . $code . '" class="icon-chevron-up enabled vote-up ' . $state . '"></a>');
     }
     if (isset($post['vote_down_tags'])) {
         $this->output('<a ' . @$down_tags . ' href="#" data-code="' . $code . '" class="icon-chevron-down enabled vote-down ' . $state . '"></a>');
     }
 }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:57,代码来源:blocks.php

示例13: logged_in

 function logged_in()
 {
     qa_html_theme_base::logged_in();
     if (qa_is_logged_in()) {
         $userpoints = qa_get_logged_in_points();
         $username = qa_html(qa_get_logged_in_handle());
         $userid = qa_get_logged_in_userid();
         $user = qa_db_select_with_pending(qa_db_user_rank_selectspec($userid));
         $userrank = '';
         if (is_array($user)) {
             if (array_key_exists('rank', $user)) {
                 $userrank = '(#' . number_format((int) $user['rank']) . ')';
             }
         }
         $pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
         $this->output('<SPAN><a CLASS="qa-logged-in-points" href="index.php?qa=user&qa_1=' . $username . '#activity">' . $pointshtml . $userrank . '</a></SPAN>');
     }
 }
开发者ID:ruuttt,项目名称:question2answer,代码行数:18,代码来源:qa-theme.php

示例14: qa_page_q_edit_c_form

function qa_page_q_edit_c_form(&$qa_content, $id, $comment, $in, $errors)
{
    $commentid = $comment['postid'];
    $prefix = 'c' . $commentid . '_';
    $content = isset($in['content']) ? $in['content'] : $comment['content'];
    $format = isset($in['format']) ? $in['format'] : $comment['format'];
    $editorname = isset($in['editor']) ? $in['editor'] : qa_opt('editor_for_cs');
    $editor = qa_load_editor($content, $format, $editorname);
    $form = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'id' => $id, 'title' => qa_lang_html('question/edit_c_title'), 'style' => 'tall', 'fields' => array('content' => array_merge(qa_editor_load_field($editor, $qa_content, $content, $format, $prefix . 'content', 4, true), array('error' => qa_html(@$errors['content'])))), 'buttons' => array('save' => array('tags' => 'onclick="qa_show_waiting_after(this, false); ' . (method_exists($editor, 'update_script') ? $editor->update_script($prefix . 'content') : '') . '"', 'label' => qa_lang_html('main/save_button')), 'cancel' => array('tags' => 'name="docancel"', 'label' => qa_lang_html('main/cancel_button'))), 'hidden' => array($prefix . 'editor' => qa_html($editorname), $prefix . 'dosave' => '1', $prefix . 'code' => qa_get_form_security_code('edit-' . $commentid)));
    if ($comment['isbyuser']) {
        if (!qa_is_logged_in()) {
            qa_set_up_name_field($qa_content, $form['fields'], isset($in['name']) ? $in['name'] : @$comment['name'], $prefix);
        }
        qa_set_up_notify_fields($qa_content, $form['fields'], 'C', qa_get_logged_in_email(), isset($in['notify']) ? $in['notify'] : !empty($comment['notify']), isset($in['email']) ? $in['email'] : @$comment['notify'], @$errors['email'], $prefix);
    }
    if (!qa_user_post_permit_error('permit_edit_silent', $comment)) {
        $form['fields']['silent'] = array('type' => 'checkbox', 'label' => qa_lang_html('question/save_silent_label'), 'tags' => 'name="' . $prefix . 'silent"', 'value' => qa_html(@$in['silent']));
    }
    return $form;
}
开发者ID:netham91,项目名称:question2answer,代码行数:20,代码来源:qa-page-question-post.php

示例15: mark_all_messages

 public function mark_all_messages()
 {
     if (qa_is_logged_in()) {
         qw_set_all_messages_as_read(qa_get_logged_in_userid());
     }
     die;
 }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:7,代码来源:addon.php


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