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


PHP qa_db_user_account_selectspec函数代码示例

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


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

示例1: qa_priv_notification

function qa_priv_notification($uid, $oid, $badge_slug)
{
    require_once QA_INCLUDE_DIR . 'qa-app-users.php';
    require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
    if (QA_FINAL_EXTERNAL_USERS) {
        $publictohandle = qa_get_public_from_userids(array($uid));
        $handle = @$publictohandle[$uid];
    } else {
        $user = qa_db_single_select(qa_db_user_account_selectspec($uid, true));
        $handle = @$user['handle'];
    }
    $subject = qa_opt('badge_email_subject');
    $body = qa_opt('badge_email_body');
    $body = preg_replace('/\\^if_post_text="([^"]*)"/', $oid ? '$1' : '', $body);
    // if post text
    $site_url = qa_opt('site_url');
    $profile_url = qa_path_html('user/' . $handle, null, $site_url);
    if ($oid) {
        $post = qa_db_read_one_assoc(qa_db_query_sub('SELECT * FROM ^posts WHERE postid=#', $oid), true);
        if ($post['parentid']) {
            $parent = qa_db_read_one_assoc(qa_db_query_sub('SELECT * FROM ^posts WHERE postid=#', $post['parentid']), true);
        }
        if (isset($parent)) {
            $anchor = urlencode(qa_anchor($post['basetype'], $oid));
            $post_title = $parent['title'];
            $post_url = qa_path_html(qa_q_request($parent['postid'], $parent['title']), null, qa_opt('site_url'), null, $anchor);
        } else {
            $post_title = $post['title'];
            $post_url = qa_path_html(qa_q_request($post['postid'], $post['title']), null, qa_opt('site_url'));
        }
    }
    $subs = array('^badge_name' => qa_opt('badge_' . $badge_slug . '_name'), '^post_title' => @$post_title, '^post_url' => @$post_url, '^profile_url' => $profile_url, '^site_url' => $site_url);
    qa_send_notification($uid, '@', $handle, $subject, $body, $subs);
}
开发者ID:NoahY,项目名称:q2a-privileges,代码行数:34,代码来源:qa-plugin.php

示例2: getEmail

 function getEmail($userid)
 {
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     if (QA_FINAL_EXTERNAL_USERS) {
         $email = qa_get_user_email($userid);
     } else {
         $useraccount = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
         $email = @$useraccount['email'];
     }
     return $email;
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:11,代码来源:qa-news-layer.php

示例3: getHandleFromId

 function getHandleFromId($userid)
 {
     require_once QA_INCLUDE_DIR . 'qa-app-users.php';
     if (QA_FINAL_EXTERNAL_USERS) {
         $publictohandle = qa_get_public_from_userids(array($userid));
         $handle = @$publictohandle[$userid];
     } else {
         $user = qa_db_single_select(qa_db_user_account_selectspec($userid, true));
         $handle = @$user['handle'];
     }
     return $handle;
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:12,代码来源:qa-history-check.php

示例4: qa_send_notification

function qa_send_notification($userid, $email, $handle, $subject, $body, $subs)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    global $qa_notifications_suspended;
    if ($qa_notifications_suspended > 0) {
        return false;
    }
    require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
    require_once QA_INCLUDE_DIR . 'qa-util-string.php';
    if (isset($userid)) {
        $needemail = !qa_email_validate(@$email);
        // take from user if invalid, e.g. @ used in practice
        $needhandle = empty($handle);
        if ($needemail || $needhandle) {
            if (QA_FINAL_EXTERNAL_USERS) {
                if ($needhandle) {
                    $handles = qa_get_public_from_userids(array($userid));
                    $handle = @$handles[$userid];
                }
                if ($needemail) {
                    $email = qa_get_user_email($userid);
                }
            } else {
                $useraccount = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
                if ($needhandle) {
                    $handle = @$useraccount['handle'];
                }
                if ($needemail) {
                    $email = @$useraccount['email'];
                }
            }
        }
    }
    if (isset($email) && qa_email_validate($email)) {
        $subs['^site_title'] = qa_opt('site_title');
        $subs['^handle'] = $handle;
        $subs['^email'] = $email;
        $subs['^open'] = "\n";
        $subs['^close'] = "\n";
        return qa_send_email(array('fromemail' => qa_opt('from_email'), 'fromname' => qa_opt('site_title'), 'toemail' => $email, 'toname' => $handle, 'subject' => strtr($subject, $subs), 'body' => (empty($handle) ? '' : qa_lang_sub('emails/to_handle_prefix', $handle)) . strtr($body, $subs), 'html' => false));
    } else {
        return false;
    }
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:47,代码来源:qa-app-emails.php

示例5: qa_page_queue_pending

function qa_page_queue_pending()
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    qa_preload_options();
    $loginuserid = qa_get_logged_in_userid();
    if (isset($loginuserid)) {
        if (!QA_FINAL_EXTERNAL_USERS) {
            qa_db_queue_pending_select('loggedinuser', qa_db_user_account_selectspec($loginuserid, true));
        }
        qa_db_queue_pending_select('notices', qa_db_user_notices_selectspec($loginuserid));
    }
    qa_db_queue_pending_select('navpages', qa_db_pages_selectspec(array('B', 'M', 'O', 'F')));
    qa_db_queue_pending_select('widgets', qa_db_widgets_selectspec());
}
开发者ID:ramo01,项目名称:1kapp,代码行数:17,代码来源:qa-page.php

示例6: qa_complete_reset_user

function qa_complete_reset_user($userid)
{
    require_once QA_INCLUDE_DIR . 'qa-util-string.php';
    require_once QA_INCLUDE_DIR . 'qa-app-options.php';
    require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
    require_once QA_INCLUDE_DIR . 'qa-app-cookies.php';
    require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
    $password = qa_random_alphanum(max(QA_MIN_PASSWORD_LEN, QA_NEW_PASSWORD_LEN));
    $userinfo = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
    if (!qw_send_notification($userid, $userinfo['email'], $userinfo['handle'], qa_lang('emails/new_password_subject'), nl2br(qa_lang('emails/new_password_body')), array('^password' => $password, '^url' => qa_opt('site_url')))) {
        qa_fatal_error('Could not send new password - password not reset');
    }
    qa_db_user_set_password($userid, $password);
    // do this last, to be safe
    qa_db_user_set($userid, 'emailcode', '');
    // so can't be reused
    qa_report_event('u_reset', $userid, $userinfo['handle'], qa_cookie_get(), array('email' => $userinfo['email']));
}
开发者ID:rahularyan,项目名称:dude-theme,代码行数:18,代码来源:overrides.php

示例7: get_qa_avartar_html

 function get_qa_avartar_html($user, $size = 200)
 {
     $userid_array = qa_handles_to_userids(array($user));
     $userid = $userid_array[$user];
     $useraccount = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
     $avartahtml = qa_get_user_avatar_html($useraccount['flags'], $useraccount['email'], $useraccount['handle'], $useraccount['avatarblobid'], $useraccount['avatarwidth'], $useraccount['avatarheight'], qa_opt('avatar_profile_size'));
     $avartahtml = strtolower($avartahtml);
     if ($avartahtml != null) {
         $avartahtml = strtolower($avartahtml);
         $avartahtml = str_replace('?', '\\?', $avartahtml);
         //生成avarta的html串,从站点的根目录引用
     } else {
         $avartahtml = '<a href="' . $this->config->item('qaroot_src') . '?qa=user/' . $user . '" class="qa-user-link">';
         $avartahtml .= '<img src="' . base_url($this->config->item('app_src')) . '/views/theme/' . $this->config->item('theme') . '/img/default_avatar.jpg' . '"/>';
         $avartahtml .= '</a>';
     }
     return $avartahtml;
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:18,代码来源:user_model.php

示例8: sendNewConfirm

function sendNewConfirm($userid)
{
    require_once QA_INCLUDE_DIR . 'db/users.php';
    require_once QA_INCLUDE_DIR . 'db/selects.php';
    require_once QA_INCLUDE_DIR . 'app/emails.php';
    $userinfo = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
    if (!qa_send_notification($userid, $userinfo['email'], $userinfo['handle'], qa_lang('emails/confirm_subject'), qa_lang('emails/confirm_body'), array('^url' => getNewConfirmUrl($userid, $userinfo['handle'])))) {
        qa_fatal_error('Could not send email confirmation');
    }
    // $userinfo=qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
    // $params = array();
    // $params['fromemail'] = qa_opt('from_email'),
    // $params['fromname'] = qa_opt('site_title'),
    // $params['toemail'] = $userinfo['email'];
    // $params['toname'] = $userinfo['handle'];
    // $params['subject'] = qa_lang('emails/confirm_subject');
    // $params['body'] = qa_lang('emails/confirm_body');
    // qa_send_email($params);
}
开发者ID:GitFuture,项目名称:bmf,代码行数:19,代码来源:register.php

示例9: cs_user_data

function cs_user_data($handle)
{
    $userid = qa_handle_to_userid($handle);
    $identifier = QA_FINAL_EXTERNAL_USERS ? $userid : $handle;
    if (defined('QA_WORDPRESS_INTEGRATE_PATH')) {
        $u = qa_db_select_with_pending(qa_db_user_rank_selectspec($handle), qa_db_user_points_selectspec($identifier));
        $user = array();
        $user[]['points'] = $u[1]['points'];
        unset($u[1]['points']);
        $user[] = 0;
        $user[] = $u[1];
    } else {
        $user[0] = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
        $user[1]['rank'] = qa_db_select_with_pending(qa_db_user_rank_selectspec($handle));
        $user[2] = qa_db_select_with_pending(qa_db_user_points_selectspec($identifier));
        $user = $user[0] + $user[1] + $user[2];
    }
    return $user;
}
开发者ID:microbye,项目名称:CleanStrap,代码行数:19,代码来源:functions.php

示例10: get_user_activity

 function get_user_activity($handle, $limit = 10)
 {
     $userid = qa_handle_to_userid($handle);
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     $identifier = QA_FINAL_EXTERNAL_USERS ? $userid : $handle;
     list($useraccount, $questions, $answerqs, $commentqs, $editqs) = qa_db_select_with_pending(QA_FINAL_EXTERNAL_USERS ? null : qa_db_user_account_selectspec($handle, false), qa_db_user_recent_qs_selectspec($userid, $identifier, $limit), qa_db_user_recent_a_qs_selectspec($userid, $identifier), qa_db_user_recent_c_qs_selectspec($userid, $identifier), qa_db_user_recent_edit_qs_selectspec($userid, $identifier));
     if (!QA_FINAL_EXTERNAL_USERS && !is_array($useraccount)) {
         // check the user exists
         return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
     }
     //	Get information on user references
     $questions = qa_any_sort_and_dedupe(array_merge($questions, $answerqs, $commentqs, $editqs));
     $questions = array_slice($questions, 0, $limit);
     $usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions), false);
     $htmldefaults = qa_post_html_defaults('Q');
     $htmldefaults['whoview'] = false;
     $htmldefaults['voteview'] = false;
     $htmldefaults['avatarsize'] = 0;
     foreach ($questions as $question) {
         $qa_content[] = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, array('voteview' => false) + qa_post_html_options($question, $htmldefaults));
     }
     $output = '<div class="user-activities">';
     $output .= '<ul>';
     if (isset($qa_content)) {
         foreach ($qa_content as $qs) {
             $icon = 'icon-time undefined';
             $output .= '<li class="activity-item">';
             $output .= '<div class="list-right">';
             $output .= '<div class="type pull-left ' . $icon . '"></div>';
             $output .= '<div class="what"><a class="what-task" href="' . @$qs['url'] . '">' . $qs['what'] . '</a>';
             $output .= '<a href="' . $qs['url'] . '">' . $qs['title'] . '</a> </div>';
             $output .= '<strong class="when">' . implode(' ', $qs['when']) . '</strong>';
             $output .= '</div>';
             $output .= '</li>';
         }
     } else {
         $output .= '<li>' . qa_lang('cleanstrap/no_activity_yet') . '</li>';
     }
     $output .= '</ul>';
     $output .= '</div>';
     return $output;
 }
开发者ID:microbye,项目名称:CleanStrap,代码行数:43,代码来源:widget_user_activity.php

示例11: process_request

 function process_request($request)
 {
     $userid = qa_get_logged_in_userid();
     $categoryid = mp_get_categoryid();
     $users = mp_get_category_userids($categoryid);
     $qa_content = qa_content_prepare();
     $qa_content['title'] = 'Classroom';
     $data = "<div class='mp-classroom'>";
     $data .= "<center><div class='mp-classroom-teacher'>&nbsp;</div></center>";
     $data .= "<div class='mp-classroom-users'>";
     foreach ($users as $user) {
         $userinfo = qa_db_select_with_pending(qa_db_user_account_selectspec($user['userid'], true));
         $data .= "<div class='mp-classroom-user'>";
         $data .= "<div class='mp-classroom-avatar'></div>";
         $data .= "<div class='mp-classroom-useremail'>" . qa_get_one_user_html($userinfo['handle'], false) . "</div>";
         $data .= "</div>";
     }
     $data .= "</div></div>";
     $qa_content['custom'] = $data;
     return $qa_content;
 }
开发者ID:TheProjecter,项目名称:microprobe,代码行数:21,代码来源:mp-classroom-page.php

示例12: getValidLoginUserData

 function getValidLoginUserData()
 {
     // Check if we have a valid registered user:
     if (!(qa_get_logged_in_userid() === null)) {
         $userData = array();
         $userId = qa_get_logged_in_userid();
         $userData['userID'] = $userId;
         $userData['userName'] = $this->trimUserName(qa_get_logged_in_handle());
         if (qa_get_logged_in_level() >= QA_USER_LEVEL_MODERATOR) {
             $userData['userRole'] = AJAX_CHAT_ADMIN;
         } elseif (qa_get_logged_in_level() == QA_USER_LEVEL_EDITOR) {
             $userData['userRole'] = AJAX_CHAT_MODERATOR;
         } else {
             $userData['userRole'] = AJAX_CHAT_USER;
         }
         $user = qa_db_select_with_pending(qa_db_user_account_selectspec($userId, true));
         $userData['avatar'] = qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'], $user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], qa_opt('avatar_users_size'), true);
         return $userData;
     } else {
         // Guest users:
         return $this->getGuestUser();
     }
 }
开发者ID:arjunsuresh,项目名称:chat,代码行数:23,代码来源:CustomAJAXChat.php

示例13: qa_load_modules_with

                    }
                    break;
            }
        }
        if (count($inprofile)) {
            $filtermodules = qa_load_modules_with('filter', 'filter_profile');
            foreach ($filtermodules as $filtermodule) {
                $filtermodule->filter_profile($inprofile, $errors, $useraccount, $userprofile);
            }
        }
        foreach ($userfields as $userfield) {
            if (!isset($errors[$userfield['fieldid']])) {
                qa_db_user_profile_set($userid, $userfield['title'], $inprofile[$userfield['fieldid']]);
            }
        }
        list($useraccount, $userprofile) = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true), qa_db_user_profile_selectspec($userid, true));
        qa_report_event('u_save', $userid, $useraccount['handle'], qa_cookie_get());
        if (empty($errors)) {
            qa_redirect('account', array('state' => 'profile-saved'));
        }
        qa_logged_in_user_flush();
    }
}
//	Process change password if clicked
if (qa_clicked('dochangepassword')) {
    require_once QA_INCLUDE_DIR . 'qa-app-users-edit.php';
    $inoldpassword = qa_post_text('oldpassword');
    $innewpassword1 = qa_post_text('newpassword1');
    $innewpassword2 = qa_post_text('newpassword2');
    if (!qa_check_form_security_code('password', qa_post_text('code'))) {
        $errors['page'] = qa_lang_html('misc/form_security_again');
开发者ID:netham91,项目名称:question2answer,代码行数:31,代码来源:qa-page-account.php

示例14: qa_request_part

$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));
//	Check the user exists and work out what can and can't be set (if not using single sign-on)
if (!qa_opt('allow_private_messages') || !is_array($toaccount) || $toaccount['flags'] & QA_USER_FLAGS_NO_MESSAGES) {
    return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
//	Check that we have permission and haven't reached the limit
$errorhtml = null;
switch (qa_user_permit_error(null, QA_LIMIT_MESSAGES)) {
    case 'limit':
        $errorhtml = qa_lang_html('misc/message_limit');
        break;
    case false:
        break;
    default:
        $errorhtml = qa_lang_html('users/no_permission');
        break;
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:31,代码来源:qa-page-message.php

示例15: header

*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
require_once QA_INCLUDE_DIR . 'db/selects.php';
require_once QA_INCLUDE_DIR . 'app/messages.php';
//	Check we're not using single-sign on integration, which doesn't allow walls
if (QA_FINAL_EXTERNAL_USERS) {
    qa_fatal_error('User accounts are handled by external code');
}
//	$handle, $userhtml are already set by qa-page-user.php
$start = qa_get_start();
//	Find the questions for this user
list($useraccount, $usermessages) = qa_db_select_with_pending(qa_db_user_account_selectspec($handle, false), qa_db_recent_messages_selectspec(null, null, $handle, false, qa_opt_if_loaded('page_size_wall'), $start));
if (!is_array($useraccount)) {
    // check the user exists
    return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
//	Perform pagination
$pagesize = qa_opt('page_size_wall');
$count = $useraccount['wallposts'];
$loginuserid = qa_get_logged_in_userid();
$usermessages = array_slice($usermessages, 0, $pagesize);
$usermessages = qa_wall_posts_add_rules($usermessages, $start);
//	Process deleting or adding a wall post (similar but not identical code to qq-page-user-profile.php)
$errors = array();
$wallposterrorhtml = qa_wall_error_html($loginuserid, $useraccount['userid'], $useraccount['flags']);
foreach ($usermessages as $message) {
    if ($message['deleteable'] && qa_clicked('m' . $message['messageid'] . '_dodelete')) {
开发者ID:swuit,项目名称:swuit-q2a,代码行数:31,代码来源:user-wall.php


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