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


PHP qa_get_logged_in_userid函数代码示例

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


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

示例1: mp_announcement_create

function mp_announcement_create($userid, $handle, $cookieid, $title, $content, $format, $text, $notify, $categoryid)
{
    /* 
     * Proceeds to create an announcement
     *
     */
    require_once QA_INCLUDE_DIR . 'qa-db-post-create.php';
    require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
    require_once QA_INCLUDE_DIR . 'mp-app-users.php';
    // persist data to database
    $postid = qa_db_post_create('AN', null, $userid, $cookieid, qa_remote_ip_address(), $title, $content, $format, null, $notify, $categoryid);
    qa_user_report_action(qa_get_logged_in_userid(), null, null, null, null);
    // update new post with category path hierarchy
    qa_db_posts_calc_category_path($postid);
    // send notifications
    if ($notify && isset($postid)) {
        $category = mp_get_categoryinfo($categoryid);
        $recipients = mp_get_category_userids($categoryid);
        foreach ($recipients as $recipient) {
            // retrieve the user flags
            $userflags = mp_get_user_flags($recipient['userid']);
            // check user flags to determine whether user should be notified or not
            // of the new answer post
            if (!($userflags & QA_USER_FLAGS_NOTIFY_ANNOUNCEMENTS)) {
                qa_send_notification($recipient['userid'], null, null, qa_lang('emails/an_posted_subject'), qa_lang('emails/an_posted_body'), array('^an_handle' => $handle, '^category_title' => $category['title'], '^an_title' => $title, '^an_url' => qa_path('mp-announcements-page', null, qa_opt('site_url'), null, null)));
            }
        }
    }
    // report announcement create event
    qa_report_event('an_post', $userid, $handle, $cookieid, array('postid' => $postid, 'title' => $title, 'content' => $content, 'format' => $format, 'text' => $text, 'categoryid' => $categoryid, 'notify' => $notify));
    return $postid;
}
开发者ID:TheProjecter,项目名称:microprobe,代码行数:32,代码来源:mp-app-posts.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: qw_notification_event

function qw_notification_event($postid, $userid, $effecteduserid, $params, $event)
{
    $loggeduserid = isset($userid) ? $userid : qa_get_logged_in_userid();
    if (!!$effecteduserid) {
        qw_notify_users_by_email($event, $postid, $loggeduserid, $effecteduserid, $params);
    }
}
开发者ID:rahularyan,项目名称:dude-theme,代码行数:7,代码来源:email-events.php

示例4: q_list_item

 function q_list_item($q_item)
 {
     $userid = qa_get_logged_in_userid();
     if (qa_opt('obvious_content_on') && $userid) {
         require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
         $fav_tags = qa_db_single_select(qa_db_user_favorite_tags_selectspec($userid));
         foreach ($fav_tags as $k => $v) {
             $tag[$k] = $v['word'];
         }
         $post_tags = explode(",", $q_item['raw']['tags']);
         $result = array_diff($tag, $post_tags);
         if (sizeof($result) != sizeof($tag) && $tag) {
             @($q_item['classes'] .= " is_favorite");
         }
     }
     if (qa_opt('obvious_content_category_on') && $userid) {
         require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
         $fav_cats = qa_db_single_select(qa_db_user_favorite_categories_selectspec($userid));
         foreach ($fav_cats as $k => $v) {
             $cat[$k] = $v['word'];
         }
         $post_cat = explode(",", $q_item['raw']['category']);
         $result = array_diff($cat, $post_cat);
         if (sizeof($result) != sizeof($cat) && $cat) {
             @($q_item['classes'] .= " is_favorite_cat");
         }
     }
     qa_html_theme_base::q_list_item($q_item);
     // call back through to the default function
 }
开发者ID:roine,项目名称:roine-q2a-obvious-favorite,代码行数:30,代码来源:qa-obvious-layer.php

示例5: process_request

 function process_request($request)
 {
     require_once QA_INCLUDE_DIR . 'mp-app-posts.php';
     require_once QA_INCLUDE_DIR . 'mp-db-users.php';
     $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'] = 'Course Announcements';
     // DISPLAY ANNOUCEMENTS
     $data = '<div class="qa-q-list">';
     // retrieve annoucements
     $announcements = mp_announcements_get_all(mp_get_categoryid());
     if (count($announcements) == 0) {
         $data .= "No announcements";
     } else {
         foreach ($announcements as $announcement) {
             $data .= '<div class="qa-q-list-item">';
             $data .= '<div class="qa-q-item-title">' . $announcement['title'] . '</div>';
             $data .= '<div class="qa-q-view-content">' . $announcement['content'] . '</div>';
             $data .= '<div class="qa-q-item-meta">Posted by <A HREF="' . qa_path_html('user/' . $announcement['handle']) . '">' . $announcement['handle'] . '</A> on ' . $announcement['created'] . '</div>';
             $data .= '</div>';
             $data .= '<div class="qa-q-list-item-clear" ></div>';
         }
     }
     $data .= '</div>';
     $qa_content['custom_2'] = $data;
     // create the sub menu for navigation
     $qa_content['navigation']['sub'] = mp_announcements_sub_navigation();
     $qa_content['navigation']['sub']['default']['selected'] = true;
     return $qa_content;
 }
开发者ID:TheProjecter,项目名称:microprobe,代码行数:34,代码来源:mp-announcements-page.php

示例6: process_request

 function process_request($request)
 {
     $userid = qa_get_logged_in_userid();
     $categoryoptions = array();
     $qa_content = qa_content_prepare();
     // check if we have done a post of the page
     if (qa_post_text('okthen')) {
         // update the current category
         $newcategory = qa_post_text('category');
         if (isset($newcategory)) {
             mp_set_categoryid($newcategory);
             // redirect to main page
             qa_redirect('');
         } else {
             $qa_content['error'] = 'You must select a course to continue.';
         }
     }
     // retrieve list of categories user is associated with
     // populate category options
     $results = mp_get_categories_for_user($userid);
     foreach ($results as $row) {
         $categoryoptions[$row['categoryid']] = $row['title'];
     }
     $qa_content['title'] = 'Registered courses';
     $qa_content['custom'] = 'The following list displays all courses your account is associated with.  Select a course from the list below and click <B>Select</B> to change to the new course<br /><br />';
     $qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'wide', 'fields' => array('courses' => array('type' => 'select-radio', 'label' => 'Courses', 'tags' => 'NAME="category"', 'options' => $categoryoptions, 'value' => mp_get_categoryid(), 'error' => qa_html(@$errors['course']))), 'buttons' => array('ok' => array('tags' => 'NAME="okthen"', 'label' => 'Select', 'value' => '1')));
     return $qa_content;
 }
开发者ID:TheProjecter,项目名称:microprobe,代码行数:28,代码来源:mp-change-course-page.php

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

示例8: initCustomRequestVars

 function initCustomRequestVars()
 {
     // Auto-login Q2A users:
     if (!$this->getRequestVar('logout') && !(qa_get_logged_in_userid() === null)) {
         $this->setRequestVar('login', true);
     }
 }
开发者ID:arjunsuresh,项目名称:chat,代码行数:7,代码来源:CustomAJAXChat.php

示例9: qa_permit_check

 function qa_permit_check($opt)
 {
     if (qa_opt($opt) == QA_PERMIT_POINTS) {
         return qa_get_logged_in_points() >= qa_opt($opt . '_points');
     }
     return !qa_permit_value_error(qa_opt($opt), qa_get_logged_in_userid(), qa_get_logged_in_level(), qa_get_logged_in_flags());
 }
开发者ID:NoahY,项目名称:q2a-poll,代码行数:7,代码来源:qa-plugin.php

示例10: it_q_list_page_content

function it_q_list_page_content($questions, $pagesize, $start, $count, $sometitle, $nonetitle, $navcategories, $categoryid, $categoryqcount, $categorypathprefix, $feedpathprefix, $suggest, $pagelinkparams = null, $categoryparams = null, $dummy = null)
{
    require_once QA_INCLUDE_DIR . 'qa-app-format.php';
    require_once QA_INCLUDE_DIR . 'qa-app-updates.php';
    $userid = qa_get_logged_in_userid();
    //	Chop down to size, get user information for display
    if (isset($pagesize)) {
        $questions = array_slice($questions, 0, $pagesize);
    }
    $usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
    $qa_content['q_list']['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('vote')));
    $qa_content['q_list']['qs'] = array();
    if (count($questions)) {
        $qa_content['title'] = $sometitle;
        $defaults = qa_post_html_defaults('Q');
        foreach ($questions as $question) {
            $qa_content['q_list']['qs'][] = qa_any_to_q_html_fields($question, $userid, it_cookie_get(), $usershtml, null, qa_post_html_options($question, $defaults));
        }
    } else {
        $qa_content['title'] = $nonetitle;
    }
    if (isset($count) && isset($pagesize)) {
        $qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'), $pagelinkparams);
    }
    return $qa_content;
}
开发者ID:swuit,项目名称:swuit-q2a,代码行数:26,代码来源:ajax_infinite_page.php

示例11: output_widget

 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     $widget_opt = @$themeobject->current_widget['param']['options'];
     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-q-list.php';
     $categoryslugs = '';
     $userid = qa_get_logged_in_userid();
     //	Get lists of recent activity in all its forms, plus category information
     list($questions1, $questions2, $questions3, $questions4) = qa_db_select_with_pending(qa_db_qs_selectspec($userid, 'created', 0, $categoryslugs, null, false, false, $qcount), qa_db_recent_a_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_c_qs_selectspec($userid, 0, $categoryslugs), qa_db_recent_edit_qs_selectspec($userid, 0, $categoryslugs));
     //	Prepare and return content for theme
     $content = qa_q_list_page_content(qa_any_sort_and_dedupe(array_merge($questions1, $questions2, $questions3, $questions4)), $qcount, 0, null, null, null, null, null, true, 'activity/', null, null, null, null);
     $content = $content['q_list']['qs'];
     if (@$themeobject->current_widget['param']['locations']['show_title']) {
         $themeobject->output('<h3 class="widget-title">' . qa_lang('cleanstrap/recent_activities') . ' <a href="' . qa_path_html('activity') . '">' . qa_lang('cleanstrap/view_all') . '</a></h3>');
     }
     $themeobject->output('<div class="ra-question-activity-widget">');
     $q_list = $content;
     $themeobject->output('<ul class="activity-list">');
     foreach ($q_list as $list) {
         $themeobject->output('<li class="clearfix ' . (is_featured($list['raw']['postid']) ? ' featured' : '') . '"><span class="fav-star icon-heart' . (@$list['raw']['userfavoriteq'] ? ' active' : '') . '"></span><span class="post-status-c">' . cs_post_status($list) . '</span><a href="' . $list['url'] . '">' . $list['title'] . '<span class="time">' . implode(' ', $list['when']) . '</span><span class="ans-count total-' . $list['raw']['acount'] . '">' . $list['raw']['acount'] . '</span></a></li>');
     }
     $themeobject->output('</ul>');
     $themeobject->output('</div>');
 }
开发者ID:microbye,项目名称:CleanStrap,代码行数:25,代码来源:widget_question_activity.php

示例12: qa_get_request_content

function qa_get_request_content()
{
    if (qa_opt('news_plugin_active')) {
        $requestlower = strtolower(qa_request());
        if ($requestlower && $requestlower === 'my-profile') {
            $userid = qa_get_logged_in_userid();
            if (!$userid) {
                qa_redirect();
            }
            $handles = qa_userids_to_handles(array($userid));
            $handle = $handles[$userid];
            qa_redirect(qa_path('user/' . $handle));
        } else {
            if ($requestlower && $requestlower === qa_opt('news_plugin_request')) {
                // send on cron
                if (qa_opt('news_plugin_send') && qa_get('cron') == qa_opt('news_plugin_cron_rand') && time() >= qa_opt('news_plugin_send_last') + 23 * 60 * 60) {
                    // minumum cron interval is 23 hours
                    qa_news_plugin_createNewsletter(true);
                    return false;
                } else {
                    if (qa_get('cron') == qa_opt('news_plugin_cron_rand')) {
                        if (!qa_opt('news_plugin_send')) {
                            error_log('Q2A Newsletter Recreate Error: sending newsletter not allowed via admin/plugins');
                        } else {
                            error_log('Q2A Newsletter Recreate Error: cron request before minimum time elapsed');
                        }
                        echo "false\n";
                        return false;
                    }
                }
                include qa_opt('news_plugin_loc');
                return false;
            } else {
                if (qa_opt('news_plugin_pdf') && $requestlower && $requestlower === qa_opt('news_plugin_request_pdf')) {
                    $pdf = file_get_contents(qa_opt('news_plugin_loc_pdf'));
                    header('Content-Description: File Transfer');
                    header('Cache-Control: public, must-revalidate, max-age=0');
                    // HTTP/1.1
                    header('Pragma: public');
                    header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
                    // Date in the past
                    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
                    // force download dialog
                    header('Content-Type: application/force-download');
                    header('Content-Type: application/octet-stream', false);
                    header('Content-Type: application/download', false);
                    header('Content-Type: application/pdf', false);
                    // use the Content-Disposition header to supply a recommended filename
                    header('Content-Disposition: attachment; filename="' . basename(qa_opt('news_plugin_loc_pdf')) . '";');
                    header('Content-Transfer-Encoding: binary');
                    header('Content-Length: ' . strlen($pdf));
                    echo $pdf;
                    return false;
                }
            }
        }
    }
    return qa_get_request_content_base();
}
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:59,代码来源:qa-news-overrides.php

示例13: process_request

 function process_request($request)
 {
     require_once QA_INCLUDE_DIR . 'qa-db-users.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     require_once QA_INCLUDE_DIR . 'qa-app-users.php';
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     require_once $this->directory . 'qa-open-utils.php';
     //	Check we're not using single-sign on integration, that we're logged in
     if (QA_FINAL_EXTERNAL_USERS) {
         qa_fatal_error('User accounts are handled by external code');
     }
     $userid = qa_get_logged_in_userid();
     if (!isset($userid)) {
         qa_redirect('login');
     }
     //	Get current information on user
     $useraccount = qa_db_user_find_by_id__open($userid);
     //  Check if settings were updated
     $this->check_settings();
     //  Check if we're unlinking an account
     $mylogins = $this->check_unlink($useraccount);
     //  Check if we need to associate another provider
     $tolink = $this->check_associate($useraccount);
     //  Check if we're merging multiple accounts
     $otherlogins = $this->check_merge($useraccount, $mylogins, $tolink);
     //	Prepare content for theme
     $disp_conf = qa_get('confirm') || !empty($tolink);
     $qa_content = qa_content_prepare();
     //  Build page
     if (!$disp_conf) {
         // just visiting the regular page
         $qa_content['title'] = qa_lang_html('plugin_open/my_logins_title');
         $qa_content['navigation']['sub'] = qa_user_sub_navigation($useraccount['handle'], '', true);
         $qa_content['script_onloads'][] = '$(function(){ window.setTimeout(function() { qa_conceal(".form-notification-ok"); }, 1500); });';
         $this->display_summary($qa_content, $useraccount);
         $this->display_logins($qa_content, $useraccount, $mylogins);
         $this->display_duplicates($qa_content, $useraccount, $otherlogins);
         $this->display_services($qa_content, !empty($mylogins) || !empty($otherlogins));
     } else {
         // logged in and there are duplicates
         $qa_content['title'] = qa_lang_html('plugin_open/other_logins_conf_title');
         if (!$this->display_duplicates($qa_content, $useraccount, $otherlogins)) {
             $tourl = qa_get('to');
             if (!empty($tourl)) {
                 qa_redirect($tourl);
             } else {
                 if ($tolink) {
                     // unable to link the login
                     $provider = ucfirst($tolink['source']);
                     qa_redirect('logins', array('provider' => $provider, 'code' => 99));
                 } else {
                     // no merge to confirm
                     qa_redirect('', array('provider' => '', 'code' => 98));
                 }
             }
         }
     }
     return $qa_content;
 }
开发者ID:microbye,项目名称:q2a-open-login,代码行数:59,代码来源:qa-open-page-logins.php

示例14: body_prefix

 function body_prefix()
 {
     if (!qa_get_logged_in_userid() && !@$_COOKIE['qa_faq_noshow'] && qa_opt('faq_notify_show')) {
         setcookie('qa_faq_noshow', 'true', 0, '/', QA_COOKIE_DOMAIN);
         $this->faq_notify();
     }
     qa_html_theme_base::body_prefix();
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:8,代码来源:qa-faq-layer.php

示例15: process_event

 function process_event($event, $userid, $handle, $cookieid, $params)
 {
     // check we have the correct event and the option is set
     if ($event != 'a_to_c') {
         return;
     }
     if (!qa_opt($this->convopt)) {
         return;
     }
     qa_post_set_content($params['postid'], null, null, '', null, null, null, qa_get_logged_in_userid());
 }
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:11,代码来源:qa-md-events.php


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