• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP qa_get_logged_in_handle函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: head_custom

    function head_custom()
    {
        qa_html_theme_base::head_custom();
        if (qa_opt('priv_active') && qa_opt('priv_check') && qa_get_logged_in_handle()) {
            $userid = qa_get_logged_in_userid();
            $notices = qa_db_read_one_value(qa_db_query_sub('SELECT meta_value FROM ^usermeta WHERE user_id=# AND meta_key=$ ', $userid, 'priv_notify'), true);
            if ($notices) {
                $all = explode('^', $notices);
                if (!$all[1]) {
                    // no new
                    return;
                }
                $n = explode(',', $all[1]);
                $this->notify = '<div class="notify-container">';
                $text = count($n) > 1 ? str_replace('#', count($n), qa_opt('priv_notify_text_multi')) : str_replace('^privilege', qa_lang('profile/' . $n[0]), qa_opt('priv_notify_text'));
                $text = str_replace('^profile', qa_path_html('user/' . qa_get_logged_in_handle(), array('tab' => 'privileges'), qa_opt('site_url')), $text);
                $this->notify .= '<div class="priv-notify notify">' . $text . '<div class="notify-close" onclick="jQuery(this).parent().sildeUp(\'fast\')">x</div></div>';
                $this->notify .= '</div>';
                // remove notification flag
                qa_db_query_sub('UPDATE ^usermeta SET meta_value=$ WHERE meta_key=$ AND user_id=#', ($all[0] ? $all[0] . ',' : '') . $all[1] . '^', 'priv_notify', $userid);
                /*					
                					$this->output("
                					<script>
                						jQuery('document').ready(function() { jQuery('.notify-container').delay(10000).fadeOut(); });
                					</script>");
                */
                $this->output('
					<style>', qa_opt('priv_css'), '</style>');
            }
        }
    }
开发者ID:NoahY,项目名称:q2a-privileges,代码行数:31,代码来源:qa-priv-layer.php


示例3: theme_switch_form

 function theme_switch_form()
 {
     // displays signature form in user profile
     global $qa_request;
     $handle = preg_replace('/^[^\\/]+\\/([^\\/]+).*/', "\$1", $qa_request);
     $userid = $this->getuserfromhandle($handle);
     if (!$userid) {
         return;
     }
     if (qa_get_logged_in_handle() && qa_get_logged_in_handle() == $handle) {
         if (qa_clicked('theme_switch_save')) {
             qa_db_query_sub('INSERT INTO ^usermeta (user_id,meta_key,meta_value) VALUES (#,$,$) ON DUPLICATE KEY UPDATE meta_value=$', $userid, 'custom_theme', qa_post_text('theme_choice'), qa_post_text('theme_choice'));
             qa_redirect($this->request, array('ok' => qa_lang_html('admin/options_saved')));
         } else {
             if (qa_clicked('theme_switch_user_reset')) {
                 qa_db_query_sub('DELETE FROM ^usermeta WHERE user_id=# AND meta_key=$', $userid, 'custom_theme');
                 qa_redirect($this->request, array('ok' => qa_lang_html('admin/options_reset')));
             }
         }
         require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
         $ok = qa_get('ok') ? qa_get('ok') : null;
         $theme_choice = qa_db_read_one_value(qa_db_query_sub('SELECT meta_value FROM ^usermeta WHERE user_id=# AND meta_key=$', $userid, 'custom_theme'), true);
         $themes = qa_admin_theme_options();
         $fields['themes'] = array('label' => qa_opt('theme_switch_text'), 'tags' => 'NAME="theme_choice"', 'type' => 'select', 'options' => qa_admin_theme_options(), 'value' => @$themes[$theme_choice]);
         $form = array('ok' => $ok && !isset($error) ? $ok : null, 'style' => 'tall', 'title' => '<a name="theme_text"></a>' . qa_opt('theme_switch_title'), 'tags' => 'action="' . qa_self_html() . '#theme_text" method="POST"', 'fields' => $fields, 'buttons' => array(array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="theme_switch_user_reset"'), array('label' => qa_lang_html('main/save_button'), 'tags' => 'NAME="theme_switch_save"')));
         return $form;
     }
 }
开发者ID:NoahY,项目名称:q2a-theme-switcher,代码行数:28,代码来源:qa-theme-layer.php


示例4: dele_single_article

 public function dele_single_article($articleid = 0)
 {
     $username = qa_get_logged_in_handle();
     $article = $this->article_model->select_single_article($articleid);
     $userlevel = $this->user_model->get_user_level($username);
     if ($username == null) {
         echo '发生了错误1';
         exit;
     }
     //判断权限
     $power = -1;
     if ($userlevel != null) {
         $power = $userlevel['level'];
     }
     if ($power < 0) {
         echo '你没有权限发表文章';
         exit;
     }
     if ($article != null) {
         $newid = $this->article_model->update_article_by_array($articleid, array("status"), array(-1));
     }
     if ($newid == null) {
         $newid = 0;
     }
     echo $newid;
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:26,代码来源:dele_article.php


示例5: index

 public function index($id = null)
 {
     $username = qa_get_logged_in_handle();
     if ($username == '') {
         exit;
     }
     $user = $this->user_model->get_user_config($username);
     if ($user == null) {
         exit;
     }
     $userlevel = $this->user_model->get_user_level($username);
     $data = $this->defaultpage_model->all_items();
     $data = array_merge($data, array('blog_title' => $user['blogtitle'], 'blog_subtitle' => $user['blogsubtitle'], 'img_article_operation_btns1' => base_url($this->config->item('app_src') . 'views/theme/' . $this->config->item('theme') . '/img/article_operation_btns1.gif'), 'article_submit' => site_url('action/add_article/add_single_by_post'), 'save_posted_page' => site_url('action/save_article/save_single_by_post'), 'aritile_site_url' => site_url('article/index')));
     if ($id == null) {
         $data['ar_saveid'] = '0';
         $data['ar_draft_title'] = '';
         $data['ar_draft_content'] = '';
         $data['ar_draft_tags'] = '';
     } else {
         $artl = $this->article_model->select_single_article($id);
         if ($artl != null and ($artl['username'] == $username or $userlevel['level'] >= 4)) {
             $data['ar_saveid'] = $id;
             $data['ar_draft_title'] = htmlspecialchars($artl['caption'], ENT_QUOTES, 'UTF-8');
             $data['ar_draft_content'] = htmlspecialchars($artl['content'], ENT_QUOTES, 'UTF-8');
             $data['ar_draft_tags'] = htmlspecialchars($artl['tags'], ENT_QUOTES, 'UTF-8');
         } else {
             echo 'no permits!';
             exit;
         }
     }
     $this->parser->parse('theme/default/templete/header', $data);
     $this->parser->parse('theme/default/templete/head', $data);
     $this->parser->parse('theme/default/templete/createarticle', $data);
     $this->parser->parse('theme/default/templete/foot', $data);
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:35,代码来源:createarticle.php


示例6: logged_in

 function logged_in()
 {
     if (isset($this->content['loggedin']['data']) && qa_opt('buddypress_integration_enable') && qa_opt('buddypress_display_names')) {
         $handle = qa_get_logged_in_handle();
         $name = bp_core_get_user_displayname($handle);
         $this->content['loggedin']['data'] = str_replace('>' . $handle . '<', ' title="@' . $handle . '">' . $name . '<', $this->content['loggedin']['data']);
     }
     qa_html_theme_base::logged_in();
 }
开发者ID:NoahY,项目名称:q2a-buddypress,代码行数:9,代码来源:qa-bp-layer.php


示例7: qa_page_q_post_rules

function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $childposts = null)
{
    $rules = qa_page_q_post_rules_base($post, $parentpost, $siblingposts, $childposts);
    qa_db_query_sub('CREATE TABLE IF NOT EXISTS ^postmeta (
			meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
			post_id bigint(20) unsigned NOT NULL,
			meta_key varchar(255) DEFAULT \'\',
			meta_value longtext,
			PRIMARY KEY (meta_id),
			KEY post_id (post_id),
			KEY meta_key (meta_key)
			) ENGINE=MyISAM  DEFAULT CHARSET=utf8');
    $expert = qa_db_read_one_value(qa_db_query_sub("SELECT meta_value FROM ^postmeta WHERE meta_key='is_expert_question' AND post_id=#", $post['postid']), true);
    if ($expert) {
        if (!qa_permit_value_error(qa_opt('expert_question_roles'), qa_get_logged_in_userid(), qa_get_logged_in_level(), qa_get_logged_in_flags())) {
            $is_expert = true;
        }
        $users = qa_opt('expert_question_users');
        $users = explode("\n", $users);
        $handle = qa_get_logged_in_handle();
        foreach ($users as $idx => $user) {
            if ($user == $handle) {
                $is_expert = true;
                break;
            }
            if (strpos($user, '=')) {
                $user = explode('=', $user);
                if ($user[0] == $handle) {
                    $catnames = explode(',', $user[1]);
                    $cats = qa_db_read_all_values(qa_db_query_sub('SELECT categoryid FROM ^categories WHERE title IN ($)', $catnames));
                    $is_expert = $cats;
                }
            }
        }
        if (isset($is_expert) && !$rules['viewable']) {
            // experts that aren't allowed to change hidden questions
            if (is_array($is_expert)) {
                $in_cats = qa_db_read_one_value(qa_db_query_sub("SELECT COUNT(postid) FROM ^posts WHERE categoryid IN (#) AND postid=#", $is_expert, $post['postid']), true);
                if ($in_cats) {
                    $rules['viewable'] = true;
                }
            } else {
                $rules['viewable'] = true;
            }
        }
        $rules['reshowable'] = false;
        $rules['answerbutton'] = true;
        $rules['commentbutton'] = true;
        $rules['commentable'] = true;
    }
    return $rules;
}
开发者ID:rkarimabadi,项目名称:q2a-expert-questions,代码行数:52,代码来源:qa-expert-overrides.php


示例8: qw_notification_btn

    function qw_notification_btn()
    {
        //if (true){ // check options
        $userid = qa_get_logged_in_userid();
        if (isset($userid)) {
            $handle = qa_get_logged_in_handle();
            $this->output('
					<div class="user-actions pull-right">
						<div class="activity-bar">
							<div class="button dropdown">
								<a href="' . qa_path_html('user/' . $handle . '/activity') . '" class=" icon-bullhorn dropdown-toggle activitylist" data-toggle="dropdown" id="activitylist"></a>
								<div class="dropdown-menu activity-dropdown-list pull-right" id="activity-dropdown-list">
									<div class="bar">
										<span>' . qa_lang_html('dude/notifications') . '</span>
										<a class="mark-activity" href="#" data-id="' . qa_get_logged_in_userid() . '">' . qa_lang('dude/mark_all_as_read') . '</a>
									</div>
									<div class="append">
										<div class="ajax-list"></div>
										<span class="loading"></span>
										<div class="no-activity icon-chart-bar">' . qa_lang('dude/no-activity') . '</div>
									</div>
									
									<a class="event-footer" href="' . qa_path_html('notifications', null, QW_BASE_URL) . '">' . qa_lang('dude/see_all') . '</a>
									
								</div>
							</div>
						</div>
						
						<div class="message-bar">
							<div class="button dropdown">
								<a href="' . qa_path_html('user/' . $handle . '/message') . '" class=" icon-envelope-alt dropdown-toggle messagelist" data-toggle="dropdown" id="messagelist"></a>
								<div class="dropdown-menu message-dropdown-list pull-right" id="message-dropdown-list">
									<div class="bar">
										<span>' . qa_lang_html('dude/messages') . '</span>
										<a class="mark-messages" href="#">' . qa_lang('dude/mark_all_as_read') . '</a>
									</div>
									<div class="append">
										<div class="ajax-list"></div>
										<span class="loading"></span>
										<div class="no-activity icon-chart-bar">' . qa_lang('dude/no-activity') . '</div>
									</div>
									
									<a class="event-footer" href="' . qa_path_html('user/' . $handle . '/wall', null, QW_BASE_URL) . '">' . qa_lang('dude/see_all') . '</a>
									
								</div>
							</div>
						</div>
					</div>
				');
        }
        //}
    }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:52,代码来源:notification-layer.php


示例9: head_custom

 function head_custom()
 {
     qa_html_theme_base::head_custom();
     if (@$this->template == 'user' && qa_opt('signatures_enable')) {
         $formats = qa_list_modules('editor');
         $editorname = $formats[qa_opt('signatures_format')];
         $handle = preg_replace('/^[^\\/]+\\/([^\\/]+).*/', "\$1", $this->request);
         if (qa_get_logged_in_handle() == $handle && (!$editorname || $editorname == 'Markdown Editor')) {
             $this->output_raw('<script src="' . QA_HTML_THEME_LAYER_URLTOROOT . 'textLimitCount.js" type="text/javascript"></script>');
             $this->output_raw("\n<script>\n\tvar signature_max_length = " . (qa_opt('signatures_length') ? qa_opt('signatures_length') : 1000) . ";\n\tjQuery('document').ready(function(){\n\t\ttextLimiter(jQuery('textarea[name=\"signature_text\"]'),{\n\t\tmaxLength: signature_max_length,\n\t\telCount: 'elCount'\n\t  });\n\t});\n</script>");
         }
     }
 }
开发者ID:NoahY,项目名称:q2a-signatures,代码行数:13,代码来源:qa-sig-layer.php


示例10: index

 public function index($articleid = 1)
 {
     $atcl = $this->article_model->select_single_article($articleid);
     if ($atcl == null) {
         exit;
     }
     if ($atcl['status'] == 1) {
         //如果不是文章作者,且不是管理员
         if (qa_get_logged_in_handle() != $atcl['username'] or $this->user_model->get_user_level(qa_get_logged_in_handle()) < 4) {
             echo 'no permints!';
             exit;
         }
     }
     if ($atcl['status'] < 0) {
         //如果不是管理员
         if ($this->user_model->get_user_level(qa_get_logged_in_handle()) < 4) {
             echo 'no permints!';
             exit;
         }
     }
     $username = $atcl['username'];
     $user = $this->user_model->get_user_config($username);
     $articles_meta = $this->article_model->get_article_list_by_author($username);
     $comments_meta = $this->comment_model->get_comments_by_to_user($username);
     $messages_meta = $this->message_model->get_messages_by_to_user($username);
     $articles = array();
     $comments = array();
     $messages = array();
     foreach ($articles_meta as $key => $article) {
         $articles[$key]['title'] = $article['caption'];
         $articles[$key]['content'] = mb_substr($article['content'], 0, 200);
         $articles[$key]['date'] = date('Y-m-d g:i', strtotime($article['createtime']));
     }
     foreach ($comments_meta as $key => $comment) {
         $comments[$key]['comment'] = mb_substr($comment['content'], 0, 17) . '...';
     }
     foreach ($messages_meta as $key => $message) {
         $messages_meta[$key]['comment'] = mb_substr($message['content'], 0, 17) . '...';
     }
     $data = $this->defaultpage_model->all_items();
     $data = array_merge($data, array('blog_title' => $user['blogtitle'], 'blog_subtitle' => $user['blogsubtitle'], 'user_photo' => $this->user_model->get_qa_avartar_html($username), 'user_profile' => $this->config->item('qaroot_src') . '?qa=user/' . $username));
     $atcl['createtime'] = date('Y-m-d g:i', strtotime($atcl['createtime']));
     $data['articles'] = array($atcl);
     //var_dump($data['articles']);
     $data['comments'] = $comments;
     $data['messages'] = $messages;
     $this->parser->parse('theme/default/templete/header', $data);
     $this->parser->parse('theme/default/templete/head', $data);
     $this->parser->parse('theme/default/templete/article', $data);
     $this->parser->parse('theme/default/templete/foot', $data);
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:51,代码来源:article.php


示例11: 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']}";
             }
         }
     }
 }
开发者ID:microbye,项目名称:q2a-open-login,代码行数:51,代码来源:qa-open-layer.php


示例12: 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


示例13: output_widget

 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     // only show for logged in users
     if (qa_get_logged_in_handle() == null) {
         return;
     }
     require_once QA_INCLUDE_DIR . 'qa-db.php';
     require_once QA_INCLUDE_DIR . 'qa-db.php';
     require_once QA_INCLUDE_DIR . 'mp-db-users.php';
     $userid = qa_get_logged_in_userid();
     $categoryid = mp_get_categoryid();
     // check each property
     $nameSQL = qa_db_read_one_value(qa_db_query_sub('select count(content) from ^userprofile p where p.userid =# and content="" and title=#', $userid, 'name'));
     $aboutSQL = qa_db_read_one_value(qa_db_query_sub('select count(content) from ^userprofile p where p.userid =# and content="" and title=#', $userid, 'about'));
     $websiteSQL = qa_db_read_one_value(qa_db_query_sub('select count(content) from ^userprofile p where p.userid =# and content="" and title=#', $userid, 'website'));
     $questionSQL = qa_db_read_one_value(qa_db_query_sub('select count(userid) from ^posts p where p.userid =# and categoryid=# and type=#', $userid, $categoryid, 'Q'));
     $answerSQL = qa_db_read_one_value(qa_db_query_sub('select count(userid) from ^posts p where p.userid =# and categoryid=# and type=#', $userid, $categoryid, 'A'));
     $perc = 0;
     if ($nameSQL == 0) {
         $perc++;
     }
     if ($aboutSQL == 0) {
         $perc++;
     }
     if ($websiteSQL == 0) {
         $perc++;
     }
     if ($questionSQL > 0) {
         $perc++;
     }
     if ($answerSQL > 0) {
         $perc++;
     }
     $themeobject->output('<DIV CLASS="mp-widget-profile-view"><DIV CLASS="mp-widget-profile-title">Profile Progress - ' . $perc * 100 / 5 . '%</DIV>');
     $data = '<DIV CLASS="mp-widget-profile-list-item"><SPAN CLASS="mp-widget-profile-list-title">Name</SPAN>' . ($nameSQL ? '<SPAN CLASS="mp-widget-profile-list-bad"></SPAN>' : '<SPAN CLASS="mp-widget-profile-list-good"></SPAN>') . '</DIV>';
     // value of 0 is complete
     $data .= '<DIV CLASS="mp-widget-profile-list-item"><SPAN CLASS="mp-widget-profile-list-title">About</SPAN>' . ($aboutSQL ? '<SPAN CLASS="mp-widget-profile-list-bad"></SPAN>' : '<SPAN CLASS="mp-widget-profile-list-good"></SPAN>') . '</DIV>';
     // value of 0 is complete
     $data .= '<DIV CLASS="mp-widget-profile-list-item"><SPAN CLASS="mp-widget-profile-list-title">Website</SPAN>' . ($websiteSQL ? '<SPAN CLASS="mp-widget-profile-list-bad"></SPAN>' : '<SPAN CLASS="mp-widget-profile-list-good"></SPAN>') . '</DIV>';
     // value of 0 is complete
     $data .= '<DIV CLASS="mp-widget-profile-list-item"><SPAN CLASS="mp-widget-profile-list-title">Posted a question</SPAN>' . ($questionSQL <= 0 ? '<SPAN CLASS="mp-widget-profile-list-bad"></SPAN>' : '<SPAN CLASS="mp-widget-profile-list-good"></SPAN>') . '</DIV>';
     // value > 0 is complete
     $data .= '<DIV CLASS="mp-widget-profile-list-item"><SPAN CLASS="mp-widget-profile-list-title">Posted an answer</SPAN>' . ($answerSQL <= 0 ? '<SPAN CLASS="mp-widget-profile-list-bad"></SPAN>' : '<SPAN CLASS="mp-widget-profile-list-good"></SPAN>') . '</DIV>';
     // value > 0 is complete
     $data .= '<br /><center><a CLASS="qa-page-link" href="' . qa_path_html('account') . '">Edit Profile</a></center><br />';
     $themeobject->output($data);
     $themeobject->output('</DIV>');
 }
开发者ID:TheProjecter,项目名称:microprobe,代码行数:48,代码来源:mp-profile-progress-widget.php


示例14: 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


示例15: set_duodaa_user

function set_duodaa_user()
{
    $user = array();
    $user['username'] = qa_get_logged_in_handle();
    if (!$user['username']) {
        //header("Content-type: text/html; charset=utf-8");
        //unset($user['username']);
        $user['nologin'] = 1;
        $user['nologinzh'] = '没有登录';
        //echo json_encode($user);
    } else {
        $user['nologin'] = 0;
        $user['points'] = qa_get_logged_in_points();
    }
    return $user;
}
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:16,代码来源:qa-login-info.php


示例16: draft

 public function draft()
 {
     $username = qa_get_logged_in_handle();
     if ($username == null) {
         echo 'please login!';
         exit;
     }
     $user = $this->user_model->get_user_config($username);
     if ($user == null) {
         echo 'no permits!';
         exit;
     }
     $data = $this->defaultpage_model->all_items();
     $articles_meta = $this->article_model->get_article_list_by_author($username, 1000, 1);
     $comments_meta = $this->comment_model->get_comments_by_to_user($username);
     $messages_meta = $this->message_model->get_messages_by_to_user($username);
     $articles = array();
     $comments = array();
     $messages = array();
     foreach ($articles_meta as $key => $article) {
         $articles[$key]['articleid'] = $article['ID'];
         $articles[$key]['title'] = $article['caption'];
         $articles[$key]['content'] = mb_substr($article['content'], 0, 200);
         $articles[$key]['date'] = date('Y-m-d g:i', strtotime($article['createtime']));
         $articles[$key]['articlelink'] = site_url('article/index/' . $article['ID']);
         $articles[$key]['ar_operation_items'] = $this->ui_model->ar_operation_items($article);
         unset($articles[$key]['ar_operation_items'][0]);
         unset($articles[$key]['ar_operation_items'][1]);
     }
     foreach ($comments_meta as $key => $comment) {
         $comments[$key]['comment'] = mb_substr($comment['content'], 0, 17) . '...';
     }
     foreach ($messages_meta as $key => $message) {
         $messages[$key]['message'] = mb_substr($message['content'], 0, 17) . '...';
     }
     $data = $this->defaultpage_model->all_items();
     //var_dump($user);
     $data = array_merge($data, array('blog_title' => $user['blogtitle'], 'blog_subtitle' => $user['blogsubtitle'], 'user_photo' => $this->user_model->get_qa_avartar_html($username), 'user_profile' => $this->config->item('qaroot_src') . '?qa=user/' . $username));
     $data['articles'] = $articles;
     $data['comments'] = $comments;
     $data['messages'] = $messages;
     $data['dele_posted_page'] = site_url('action/dele_article/dele_single_article');
     $this->parser->parse('theme/default/templete/header', $data);
     $this->parser->parse('theme/default/templete/head', $data);
     $this->parser->parse('theme/default/templete/user', $data);
     $this->parser->parse('theme/default/templete/foot', $data);
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:47,代码来源:user.php


示例17: doctype

    function doctype()
    {
        if (qa_get_logged_in_userid() && qa_opt('user_act_list_active') && qa_opt('user_act_list_new') && ($this->template != 'user' || qa_get_logged_in_handle() != $this->_user_handle())) {
            qa_db_query_sub('CREATE TABLE IF NOT EXISTS ^usermeta (
				meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
				user_id bigint(20) unsigned NOT NULL,
				meta_key varchar(255) DEFAULT NULL,
				meta_value longtext,
				PRIMARY KEY (meta_id),
				UNIQUE (user_id,meta_key)
				) ENGINE=MyISAM  DEFAULT CHARSET=utf8');
            $last_visit = qa_db_read_one_value(qa_db_query_sub('SELECT UNIX_TIMESTAMP(meta_value) FROM ^usermeta WHERE user_id=# AND meta_key=$', qa_get_logged_in_userid(), 'visited_profile'), true);
            if ($last_visit) {
                $events = qa_db_read_one_value(qa_db_query_sub('SELECT COUNT(event) FROM ^eventlog WHERE userid=# AND DATE_SUB(CURDATE(),INTERVAL # DAY) <= datetime AND FROM_UNIXTIME(#) <= datetime AND event LIKE \'in_%\'' . (qa_opt('user_act_list_max') ? ' LIMIT ' . (int) qa_opt('user_act_list_max') : ''), qa_get_logged_in_userid(), qa_opt('user_act_list_age'), $last_visit));
                if ($events) {
                    $tooltip = str_replace('#', $events, qa_opt('user_act_list_new_text'));
                    // pluralizing
                    preg_match('/\\S+\\/\\S+/', qa_opt('user_act_list_new_text'), $voicea);
                    $voices = explode('/', $voicea[0]);
                    foreach ($voices as $voice) {
                        if (!preg_match('/[0-9]/', substr($voice, -1))) {
                            $tooltip = preg_replace('/\\S+\\/\\S+/', $voice, $tooltip);
                            break;
                        } else {
                            if ((int) substr($voice, -1) >= $events) {
                                $tooltip = preg_replace('/\\S+\\/\\S+/', substr($voice, 0, -1), $tooltip);
                                break;
                            }
                        }
                    }
                    $this->content['loggedin']['suffix'] = @$this->content['loggedin']['suffix'] . ' <a class="qa-history-new-event-link" title="' . $tooltip . '" href="' . qa_path_html('user/' . qa_get_logged_in_handle(), array('tab' => 'history'), qa_opt('site_url')) . '"><span class="qa-history-new-event-count">' . $events . '</span></a>';
                }
            }
        }
        if (qa_opt('user_act_list_active') && $this->template == 'user' && (qa_get_logged_in_handle() === $this->_user_handle() || qa_opt('user_act_list_show'))) {
            if (!isset($this->content['navigation']['sub'])) {
                $this->content['navigation']['sub'] = array('profile' => array('url' => qa_path_html('user/' . $this->_user_handle(), null, qa_opt('site_url')), 'label' => $this->_user_handle(), 'selected' => !qa_get('tab') ? true : false), 'history' => array('url' => qa_path_html('user/' . $this->_user_handle(), array('tab' => 'history'), qa_opt('site_url')), 'label' => qa_opt('user_act_list_tab'), 'selected' => qa_get('tab') == 'history' ? true : false));
            } else {
                $this->content['navigation']['sub']['history'] = array('url' => qa_path_html('user/' . $this->_user_handle(), array('tab' => 'history'), qa_opt('site_url')), 'label' => qa_opt('user_act_list_tab'), 'selected' => qa_get('tab') == 'history' ? true : false);
            }
        }
        qa_html_theme_base::doctype();
    }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:43,代码来源:qa-history-layer.php


示例18: __construct

 public function __construct()
 {
     //var $admins;
     parent::__construct();
     $this->load->model('user_model');
     $this->load->model('article_model');
     $this->load->model('comment_model');
     $this->load->model('message_model');
     $this->load->model('defaultpage_model');
     $this->load->library('parser');
     $this->load->helper('url');
     $this->load->helper('text');
     $this->admins = array('math001', 'duodaamaster');
     $this->username = qa_get_logged_in_handle();
     if (!in_array($this->username, $this->admins)) {
         echo 'no permits!';
         exit;
     }
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:19,代码来源:admin.php


示例19: save_single_by_post

 public function save_single_by_post()
 {
     //$actor = qa_get_logged_in_handle();
     $username = qa_get_logged_in_handle();
     $caption = htmlspecialchars($this->input->post('title'), ENT_QUOTES, 'UTF-8');
     $content = strip_tags($this->input->post('content'), ALLOW_CONTENT_TAGS);
     $tags = htmlspecialchars($this->input->post('tags'), ENT_QUOTES, 'UTF-8');
     $createtime = date('Y-m-d G:i:s');
     $articleid = $this->input->post('ar_saveid');
     $article = $this->article_model->select_single_article($articleid);
     $userlevel = $this->user_model->get_user_level($username);
     //echo 333;
     if ($username == null) {
         echo '发生了错误1';
         exit;
     } elseif ($caption == null) {
         echo '发生了错误2';
         exit;
     } else {
         if ($content == null) {
             echo '发生了错误3';
             exit;
         }
     }
     //判断权限
     $power = -1;
     if ($userlevel != null) {
         $power = $userlevel['level'];
     }
     if ($power < 0) {
         echo '你没有权限发表文章';
         exit;
     }
     if ($article != null) {
         $newid = $this->article_model->update_article($articleid, $article['username'], $caption, $content, $tags, $createtime, $status = 1);
     }
     if ($newid == null) {
         $newid = $this->article_model->insert_article($username, $caption, $content, $tags, $createtime, 1);
     }
     echo $newid;
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:41,代码来源:save_article.php


示例20: process_request

 function process_request($request)
 {
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     require_once QA_INCLUDE_DIR . 'qa-app-posts.php';
     require_once QA_INCLUDE_DIR . 'qa-db-post-create.php';
     require_once QA_INCLUDE_DIR . 'mp-db-users.php';
     // report that we entered this page
     qa_report_event('page_enter', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array('params' => $_SERVER['QUERY_STRING']));
     // create the editor and update its content
     qa_get_post_content('editor', 'content', $ineditor, $incontent, $informat, $intext);
     $editorname = isset($ineditor) ? $ineditor : qa_opt('editor_for_qs');
     $editor = qa_load_editor(@$incontent, @$informat, $editorname);
     // retrieve variable data
     $innotify = qa_post_text('notify') ? true : false;
     // handle creation of annoucement
     if (qa_post_text('docreate')) {
         //retrieve data
         $title = qa_post_text('title');
         $content = $incontent;
         $format = $informat;
         // validate data
         // handle create work
         // actual create process is in file mp-app-posts.php
         $postid = qa_post_create('AN', null, $title, $content, $format, mp_get_categoryid(), null, qa_get_logged_in_userid(), $innotify);
         // redirect page
         qa_redirect('mp-announcements-page');
         // our work is done here
     }
     $qa_content = qa_content_prepare();
     // if the user is not logged in, request user to login
     if (!qa_get_logged_in_userid()) {
         $qa_content['error'] = qa_insert_login_links('Please ^1log in^2 or ^3register^4 first.', $request);
         return $qa_content;
     }
     $qa_content['title'] = 'Create Announcement';
     $qa_content['form_newannouncement'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array('title' => array('label' => qa_lang_html('announcements/a_title_label'), 'tags' => 'NAME="title"', 'value' => qa 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP qa_get_logged_in_level函数代码示例发布时间:2022-05-15
下一篇:
PHP qa_get_logged_in_flags函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap