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

PHP qa_db_points_update_ifuser函数代码示例

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

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



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

示例1: qa_vote_set

function qa_vote_set($post, $userid, $handle, $cookieid, $vote)
{
    require_once QA_INCLUDE_DIR . 'qa-db-points.php';
    require_once QA_INCLUDE_DIR . 'qa-db-hotness.php';
    require_once QA_INCLUDE_DIR . 'qa-db-votes.php';
    require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
    $vote = (int) min(1, max(-1, $vote));
    $oldvote = (int) qa_db_uservote_get($post['postid'], $userid);
    qa_db_uservote_set($post['postid'], $userid, $vote);
    qa_db_post_recount_votes($post['postid']);
    $postisanswer = $post['basetype'] == 'A';
    $columns = array();
    if ($vote > 0 || $oldvote > 0) {
        $columns[] = $postisanswer ? 'aupvotes' : 'qupvotes';
    }
    if ($vote < 0 || $oldvote < 0) {
        $columns[] = $postisanswer ? 'adownvotes' : 'qdownvotes';
    }
    qa_db_points_update_ifuser($userid, $columns);
    qa_db_points_update_ifuser($post['userid'], array($postisanswer ? 'avoteds' : 'qvoteds', 'upvoteds', 'downvoteds'));
    if ($post['basetype'] == 'Q') {
        qa_db_hotness_update($post['postid']);
    }
    if ($vote < 0) {
        $action = $postisanswer ? 'a_vote_down' : 'q_vote_down';
    } elseif ($vote > 0) {
        $action = $postisanswer ? 'a_vote_up' : 'q_vote_up';
    } else {
        $action = $postisanswer ? 'a_vote_nil' : 'q_vote_nil';
    }
    qa_report_write_action($userid, null, $action, $postisanswer ? null : $post['postid'], $postisanswer ? $post['postid'] : null, null);
    qa_report_event($action, $userid, $handle, $cookieid, array('postid' => $post['postid'], 'vote' => $vote, 'oldvote' => $oldvote));
}
开发者ID:TheProjecter,项目名称:microprobe,代码行数:33,代码来源:qa-app-votes.php


示例2: qa_create_new_user

function qa_create_new_user($email, $password, $handle, $level = QA_USER_LEVEL_BASIC, $confirmed = false)
{
    require_once QA_INCLUDE_DIR . 'qa-db-users.php';
    require_once QA_INCLUDE_DIR . 'qa-db-points.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';
    $userid = qa_db_user_create($email, $password, $handle, $level, qa_remote_ip_address());
    qa_db_points_update_ifuser($userid, null);
    qa_db_uapprovecount_update();
    if ($confirmed) {
        qa_db_user_set_flag($userid, QA_USER_FLAGS_EMAIL_CONFIRMED, true);
    }
    if (qa_opt('show_notice_welcome')) {
        qa_db_user_set_flag($userid, QA_USER_FLAGS_WELCOME_NOTICE, true);
    }
    $custom = qa_opt('show_custom_welcome') ? trim(qa_opt('custom_welcome')) : '';
    if (qa_opt('confirm_user_emails') && $level < QA_USER_LEVEL_EXPERT && !$confirmed) {
        $confirm = strtr(qa_lang('emails/welcome_confirm'), array('^url' => qa_get_new_confirm_url($userid, $handle)));
        if (qa_opt('confirm_user_required')) {
            qa_db_user_set_flag($userid, QA_USER_FLAGS_MUST_CONFIRM, true);
        }
    } else {
        $confirm = '';
    }
    if (qa_opt('moderate_users') && qa_opt('approve_user_required') && $level < QA_USER_LEVEL_EXPERT) {
        qa_db_user_set_flag($userid, QA_USER_FLAGS_MUST_APPROVE, true);
    }
    qw_send_notification($userid, $email, $handle, qa_lang('emails/welcome_subject'), nl2br(qa_lang('emails/welcome_body')), array('^password' => isset($password) ? qa_lang('main/hidden') : qa_lang('users/password_to_set'), '^url' => qa_opt('site_url'), '^custom' => strlen($custom) ? $custom . "\n\n" : '', '^confirm' => $confirm));
    qa_report_event('u_register', $userid, $handle, qa_cookie_get(), array('email' => $email, 'level' => $level));
    return $userid;
}
开发者ID:rahularyan,项目名称:dude-theme,代码行数:32,代码来源:overrides.php


示例3: qa_comment_set_userid

function qa_comment_set_userid($oldcomment, $userid, $handle, $cookieid)
{
    qa_db_post_set_userid($oldcomment['postid'], $userid);
    qa_db_points_update_ifuser($oldcomment['userid'], array('cposts'));
    qa_db_points_update_ifuser($userid, array('cposts'));
    qa_report_event('c_claim', $userid, $handle, $cookieid, array('postid' => $oldcomment['postid'], 'parentid' => $oldcomment['parentid'], 'oldcomment' => $oldcomment));
}
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:7,代码来源:qa-app-post-update.php


示例4: qa_redirect

            }
            qa_redirect(qa_request());
        }
        if (qa_clicked('dodelete') && $loginlevel >= QA_USER_LEVEL_ADMIN) {
            require_once QA_INCLUDE_DIR . 'qa-app-users-edit.php';
            qa_delete_user($userid);
            qa_report_event('u_delete', $loginuserid, qa_get_logged_in_handle(), qa_cookie_get(), array('userid' => $userid, 'handle' => $useraccount['handle']));
            qa_redirect('users');
        }
    }
}
//	Process bonus setting button
if ($loginlevel >= QA_USER_LEVEL_ADMIN && qa_clicked('dosetbonus')) {
    require_once QA_INCLUDE_DIR . 'qa-db-points.php';
    qa_db_points_set_bonus($userid, (int) qa_post_text('bonus'));
    qa_db_points_update_ifuser($userid, null);
    qa_redirect(qa_request(), null, null, null, 'activity');
}
//	Get information on user references in answers and other stuff need for page
$pagesize = qa_opt('page_size_user_posts');
$questions = qa_any_sort_and_dedupe(array_merge($questions, $answerqs, $commentqs, $editqs));
$questions = array_slice($questions, 0, $pagesize);
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
$usershtml[$userid] = $userhtml;
//	Prepare content for theme
$qa_content = qa_content_prepare(true);
$qa_content['title'] = qa_lang_html_sub('profile/user_x', $userhtml);
if (isset($loginuserid) && !QA_FINAL_EXTERNAL_USERS) {
    $qa_content['favorite'] = qa_favorite_form(QA_ENTITY_USER, $useraccount['userid'], $favorite, qa_lang_sub($favorite ? 'main/remove_x_favorites' : 'users/add_user_x_favorites', $handle));
}
//	General information about the user, only available if we're using internal user management
开发者ID:ruuttt,项目名称:question2answer,代码行数:31,代码来源:qa-page-user.php


示例5: qa_delete_user

function qa_delete_user($userid)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    require_once QA_INCLUDE_DIR . 'qa-db-votes.php';
    require_once QA_INCLUDE_DIR . 'qa-db-users.php';
    require_once QA_INCLUDE_DIR . 'qa-db-post-update.php';
    require_once QA_INCLUDE_DIR . 'qa-db-points.php';
    $postids = qa_db_uservoteflag_user_get($userid);
    // posts this user has flagged or voted on, whose counts need updating
    qa_db_user_delete($userid);
    foreach ($postids as $postid) {
        // hoping there aren't many of these - saves a lot of new SQL code...
        qa_db_post_recount_votes($postid);
        qa_db_post_recount_flags($postid);
    }
    $postuserids = qa_db_posts_get_userids($postids);
    foreach ($postuserids as $postuserid) {
        qa_db_points_update_ifuser($postuserid, array('avoteds', 'qvoteds', 'upvoteds', 'downvoteds'));
    }
}
开发者ID:robomartin,项目名称:Q2A-Mod-2,代码行数:23,代码来源:qa-app-users-edit.php


示例6: qa_vote_set

function qa_vote_set($post, $userid, $handle, $cookieid, $vote)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    require_once QA_INCLUDE_DIR . 'db/points.php';
    require_once QA_INCLUDE_DIR . 'db/hotness.php';
    require_once QA_INCLUDE_DIR . 'db/votes.php';
    require_once QA_INCLUDE_DIR . 'db/post-create.php';
    require_once QA_INCLUDE_DIR . 'app/limits.php';
    $vote = (int) min(1, max(-1, $vote));
    $oldvote = (int) qa_db_uservote_get($post['postid'], $userid);
    qa_db_uservote_set($post['postid'], $userid, $vote);
    qa_db_post_recount_votes($post['postid']);
    $postisanswer = $post['basetype'] == 'A';
    if ($postisanswer) {
        qa_db_post_acount_update($post['parentid']);
        qa_db_unupaqcount_update();
    }
    $columns = array();
    if ($vote > 0 || $oldvote > 0) {
        $columns[] = $postisanswer ? 'aupvotes' : 'qupvotes';
    }
    if ($vote < 0 || $oldvote < 0) {
        $columns[] = $postisanswer ? 'adownvotes' : 'qdownvotes';
    }
    qa_db_points_update_ifuser($userid, $columns);
    qa_db_points_update_ifuser($post['userid'], array($postisanswer ? 'avoteds' : 'qvoteds', 'upvoteds', 'downvoteds'));
    if ($post['basetype'] == 'Q') {
        qa_db_hotness_update($post['postid']);
    }
    if ($vote < 0) {
        $event = $postisanswer ? 'a_vote_down' : 'q_vote_down';
    } elseif ($vote > 0) {
        $event = $postisanswer ? 'a_vote_up' : 'q_vote_up';
    } else {
        $event = $postisanswer ? 'a_vote_nil' : 'q_vote_nil';
    }
    qa_report_event($event, $userid, $handle, $cookieid, array('postid' => $post['postid'], 'userid' => $post['userid'], 'vote' => $vote, 'oldvote' => $oldvote));
}
开发者ID:swuit,项目名称:swuit-q2a,代码行数:41,代码来源:votes.php


示例7: qa_comment_create

function qa_comment_create($userid, $handle, $cookieid, $content, $format, $text, $notify, $email, $question, $parent, $commentsfollows, $queued = false)
{
    require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
    require_once QA_INCLUDE_DIR . 'qa-app-options.php';
    require_once QA_INCLUDE_DIR . 'qa-app-format.php';
    require_once QA_INCLUDE_DIR . 'qa-util-string.php';
    if (!isset($parent)) {
        $parent = $question;
    }
    // for backwards compatibility with old answer parameter
    $postid = qa_db_post_create($queued ? 'C_QUEUED' : 'C', $parent['postid'], $userid, isset($userid) ? null : $cookieid, qa_remote_ip_address(), null, $content, $format, null, qa_combine_notify_email($userid, $notify, $email), $question['categoryid']);
    qa_db_posts_calc_category_path($postid);
    if (!$queued) {
        if ($question['type'] == 'Q' && ($parent['type'] == 'Q' || $parent['type'] == 'A')) {
            // only index if antecedents fully visible
            qa_post_index($postid, 'C', $question['postid'], $parent['postid'], null, $content, $format, $text, null, $question['categoryid']);
        }
        qa_db_points_update_ifuser($userid, 'cposts');
        qa_db_ccount_update();
    }
    $thread = array();
    foreach ($commentsfollows as $comment) {
        if ($comment['type'] == 'C' && $comment['parentid'] == $parent['postid']) {
            // find just those for this parent, fully visible
            $thread[] = $comment;
        }
    }
    qa_report_event($queued ? 'c_queue' : 'c_post', $userid, $handle, $cookieid, array('postid' => $postid, 'parentid' => $parent['postid'], 'parenttype' => $parent['basetype'], 'parent' => $parent, 'questionid' => $question['postid'], 'question' => $question, 'thread' => $thread, 'content' => $content, 'format' => $format, 'text' => $text, 'categoryid' => $question['categoryid'], 'notify' => $notify, 'email' => $email));
    return $postid;
}
开发者ID:ramo01,项目名称:1kapp,代码行数:30,代码来源:qa-app-post-create.php


示例8: qa_comment_create

function qa_comment_create($userid, $handle, $cookieid, $content, $format, $text, $notify, $email, $question, $answer, $commentsfollows)
{
    require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
    require_once QA_INCLUDE_DIR . 'qa-app-options.php';
    require_once QA_INCLUDE_DIR . 'qa-app-format.php';
    require_once QA_INCLUDE_DIR . 'qa-util-string.php';
    $parent = isset($answer) ? $answer : $question;
    $postid = qa_db_post_create('C', $parent['postid'], $userid, isset($userid) ? null : $cookieid, qa_remote_ip_address(), null, $content, $format, null, qa_combine_notify_email($userid, $notify, $email), $question['categoryid']);
    qa_db_posts_calc_category_path($postid);
    if (!($question['hidden'] || @$answer['hidden'])) {
        // don't index comment if parent or parent of parent is hidden
        qa_post_index($postid, 'C', $question['postid'], null, $text, null);
    }
    qa_db_points_update_ifuser($userid, 'cposts');
    qa_db_ccount_update();
    //	$senttoemail and $senttouserid ensure each user or email gets only one notification about an added comment,
    //	even if they have several previous comments in the same thread and asked for notifications for the parent.
    //	Still, if a person posted some comments as a registered user and some others anonymously,
    //	they could get two emails about a subsequent comment. Shouldn't be much of a problem in practice.
    $senttoemail = array();
    $senttouserid = array();
    switch ($parent['basetype']) {
        case 'Q':
            $subject = qa_lang('emails/q_commented_subject');
            $body = qa_lang('emails/q_commented_body');
            $context = $parent['title'];
            break;
        case 'A':
            $subject = qa_lang('emails/a_commented_subject');
            $body = qa_lang('emails/a_commented_body');
            $context = qa_viewer_text($parent['content'], $parent['format']);
            break;
    }
    $blockwordspreg = qa_get_block_words_preg();
    $sendhandle = isset($handle) ? $handle : qa_lang('main/anonymous');
    $sendcontext = qa_block_words_replace($context, $blockwordspreg);
    $sendtext = qa_block_words_replace($text, $blockwordspreg);
    $sendtitle = qa_block_words_replace($question['title'], $blockwordspreg);
    $sendurl = qa_path(qa_q_request($question['postid'], $sendtitle), null, qa_opt('site_url'), null, qa_anchor($parent['basetype'], $parent['postid']));
    if (isset($parent['notify']) && !qa_post_is_by_user($parent, $userid, $cookieid)) {
        $senduserid = $parent['userid'];
        $sendemail = @$parent['notify'];
        if (qa_email_validate($sendemail)) {
            $senttoemail[$sendemail] = true;
        } elseif (isset($senduserid)) {
            $senttouserid[$senduserid] = true;
        }
        qa_send_notification($senduserid, $sendemail, @$parent['handle'], $subject, $body, array('^c_handle' => $sendhandle, '^c_context' => $sendcontext, '^c_content' => $sendtext, '^url' => $sendurl));
    }
    foreach ($commentsfollows as $comment) {
        if ($comment['basetype'] == 'C' && $comment['parentid'] == $parent['postid'] && !$comment['hidden']) {
            // find just those for this parent
            if (isset($comment['notify']) && !qa_post_is_by_user($comment, $userid, $cookieid)) {
                $senduserid = $comment['userid'];
                $sendemail = @$comment['notify'];
                if (qa_email_validate($sendemail)) {
                    if (@$senttoemail[$sendemail]) {
                        continue;
                    }
                    $senttoemail[$sendemail] = true;
                } elseif (isset($senduserid)) {
                    if (@$senttouserid[$senduserid]) {
                        continue;
                    }
                    $senttouserid[$senduserid] = true;
                }
                qa_send_notification($senduserid, $sendemail, @$comment['handle'], qa_lang('emails/c_commented_subject'), qa_lang('emails/c_commented_body'), array('^c_handle' => $sendhandle, '^c_context' => $sendcontext, '^c_content' => $sendtext, '^url' => $sendurl));
            }
        }
    }
    qa_report_event('c_post', $userid, $handle, $cookieid, array('postid' => $postid, 'parentid' => $parent['postid'], 'parenttype' => $parent['basetype'], 'questionid' => $question['postid'], 'content' => $content, 'format' => $format, 'text' => $text, 'categoryid' => $question['categoryid'], 'notify' => $notify, 'email' => $email));
    return $postid;
}
开发者ID:TheProjecter,项目名称:microprobe,代码行数:73,代码来源:qa-app-post-create.php


示例9: qa_comment_set_userid

function qa_comment_set_userid($oldcomment, $userid, $handle, $cookieid)
{
    require_once QA_INCLUDE_DIR . 'db/votes.php';
    $postid = $oldcomment['postid'];
    qa_db_post_set_userid($postid, $userid);
    qa_db_uservote_remove_own($postid);
    qa_db_post_recount_votes($postid);
    qa_db_points_update_ifuser($oldcomment['userid'], array('cposts'));
    qa_db_points_update_ifuser($userid, array('cposts'));
    qa_report_event('c_claim', $userid, $handle, $cookieid, array('postid' => $postid, 'parentid' => $oldcomment['parentid'], 'oldcomment' => $oldcomment));
}
开发者ID:nikhilkumar80,项目名称:question2answer,代码行数:11,代码来源:post-update.php


示例10: qa_create_new_user

function qa_create_new_user($email, $password, $handle, $level = QA_USER_LEVEL_BASIC, $confirmed = false)
{
    require_once QA_INCLUDE_DIR . 'qa-db-users.php';
    require_once QA_INCLUDE_DIR . 'qa-db-points.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';
    $userid = qa_db_user_create($email, $password, $handle, $level, qa_remote_ip_address());
    qa_db_points_update_ifuser($userid, null);
    if ($confirmed) {
        qa_db_user_set_flag($userid, QA_USER_FLAGS_EMAIL_CONFIRMED, true);
    }
    $options = qa_get_options(array('custom_welcome', 'site_url', 'confirm_user_emails'));
    $custom = trim($options['custom_welcome']);
    if ($options['confirm_user_emails'] && $level < QA_USER_LEVEL_EXPERT && !$confirmed) {
        $confirm = strtr(qa_lang('emails/welcome_confirm'), array('^url' => qa_get_new_confirm_url($userid, $handle)));
    } else {
        $confirm = '';
    }
    qa_send_notification($userid, $email, $handle, qa_lang('emails/welcome_subject'), qa_lang('emails/welcome_body'), array('^password' => isset($password) ? $password : qa_lang('users/password_to_set'), '^url' => $options['site_url'], '^custom' => empty($custom) ? '' : $custom . "\n\n", '^confirm' => $confirm));
    qa_report_event('u_register', $userid, $handle, qa_cookie_get(), array('email' => $email, 'level' => $level));
    return $userid;
}
开发者ID:TheProjecter,项目名称:microprobe,代码行数:23,代码来源:qa-app-users-edit.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP qa_db_popular_tags_selectspec函数代码示例发布时间:2022-05-15
下一篇:
PHP qa_db_last_insert_id函数代码示例发布时间: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