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


PHP checkreasonpm函数代码示例

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


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

示例1: showmessage

 if (!$post || $post['tid'] != $thread['tid'] || !$post['authorid']) {
     showmessage('rate_post_error');
 }
 require_once libfile('function/misc');
 if (!submitcheck('ratesubmit')) {
     $referer = $_G['siteurl'] . 'forum.php?mod=viewthread&tid=' . $_G['tid'] . '&page=' . $page . ($_GET['from'] ? '&from=' . $_GET['from'] : '') . '#pid' . $_GET['pid'];
     $ratelogs = array();
     foreach (C::t('forum_ratelog')->fetch_all_by_pid($_GET['pid'], 'ASC') as $ratelog) {
         $ratelog['dbdateline'] = $ratelog['dateline'];
         $ratelog['dateline'] = dgmdate($ratelog['dateline'], 'u');
         $ratelog['scoreview'] = $ratelog['score'] > 0 ? '+' . $ratelog['score'] : $ratelog['score'];
         $ratelogs[] = $ratelog;
     }
     include template('forum/rate');
 } else {
     $reason = checkreasonpm();
     if (!empty($_GET['logidarray'])) {
         if ($sendreasonpm) {
             $ratescore = $slash = '';
         }
         $rate = $ratetimes = 0;
         $logs = array();
         foreach (C::t('forum_ratelog')->fetch_all_by_pid($_GET['pid']) as $ratelog) {
             if (in_array($ratelog['uid'] . ' ' . $ratelog['extcredits'] . ' ' . $ratelog['dateline'], $_GET['logidarray'])) {
                 $rate += $ratelog['score'] = -$ratelog['score'];
                 $ratetimes += ceil(max(abs($rating['min']), abs($rating['max'])) / 5);
                 updatemembercount($post['authorid'], array($ratelog['extcredits'] => $ratelog['score']));
                 C::t('common_credit_log')->delete_by_uid_operation_relatedid($post['authorid'], 'PRC', $_GET['pid']);
                 C::t('forum_ratelog')->delete_by_pid_uid_extcredits_dateline($_GET['pid'], $ratelog['uid'], $ratelog['extcredits'], $ratelog['dateline']);
                 $logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['adminid']}\t{$ratelog['username']}\t{$ratelog['extcredits']}\t{$ratelog['score']}\t{$_G['tid']}\t{$thread['subject']}\t{$reason}\tD");
                 if ($sendreasonpm) {
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:31,代码来源:forum_misc.php

示例2: _topicAdmin_band

 private function _topicAdmin_band($fid, $tid, $pid, $act, $type, $params = array())
 {
     extract($params);
     global $_G;
     // 在DISCUZ_ROOT/source/include/topicadmin/topicadmin_banpost.php基础上进行二次开发
     if (!$_G['group']['allowbanpost']) {
         $this->_exitWithHtmlAlert('no_privilege_banpost');
     }
     $topiclist = $_GET['topiclist'];
     $modpostsnum = count($topiclist);
     if (!($banpids = dimplode($topiclist))) {
         $this->_exitWithHtmlAlert('admin_banpost_invalid');
     } elseif (!$_G['group']['allowbanpost'] || !$_G['tid']) {
         $this->_exitWithHtmlAlert('admin_nopermission');
     }
     $posts = $authors = array();
     $banstatus = 0;
     foreach (C::t('forum_post')->fetch_all('tid:' . $_G['tid'], $topiclist) as $post) {
         if ($post['tid'] != $_G['tid']) {
             continue;
         }
         $banstatus = $post['status'] & 1 || $banstatus;
         $authors[$post['authorid']] = 1;
         $posts[] = $post;
     }
     $authorcount = count(array_keys($authors));
     if (!empty($_POST)) {
         $banned = intval($_GET['banned']);
         $modaction = $banned ? 'BNP' : 'UBN';
         $reason = checkreasonpm();
         include_once libfile('function/member');
         $pids = $comma = '';
         foreach ($posts as $k => $post) {
             if ($banned) {
                 C::t('forum_postcomment')->delete_by_rpid($post['pid']);
                 C::t('forum_post')->increase_status_by_pid('tid:' . $_G['tid'], $post['pid'], 1, '|', true);
                 crime('recordaction', $post['authorid'], 'crime_banpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $_G['tid'], 'pid' => $post['pid'])));
             } else {
                 C::t('forum_post')->increase_status_by_pid('tid:' . $_G['tid'], $post['pid'], 1, '^', true);
             }
             $pids .= $comma . $post['pid'];
             $comma = ',';
         }
         $resultarray = array('redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page={$page}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post', 'notictype' => 'post') : array(), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), 'modtids' => 0, 'modlog' => $thread);
         return $resultarray;
     }
     $banid = $checkunban = $checkban = '';
     foreach ($topiclist as $id) {
         $banid .= '<input type="hidden" name="topiclist[]" value="' . $id . '" />';
     }
     $banstatus ? $checkunban = 'checked="checked"' : ($checkban = 'checked="checked"');
     if ($modpostsnum == 1 || $authorcount == 1) {
         include_once libfile('function/member');
         $crimenum = crime('getcount', $posts[0]['authorid'], 'crime_banpost');
         $crimeauthor = $posts[0]['author'];
     }
     $this->getController()->renderPartial('topicAdmin', array('formUrl' => WebUtils::createUrl_oldVersion('forum/topicadminview', array('fid' => $fid, 'tid' => $tid, 'pid' => $pid, 'act' => $act, 'type' => $type)), 'errorMsg' => $errorMsg, 'action' => $act, '_G' => $_G, 'banid' => $banid, 'checkunban' => $checkunban, 'checkban' => $checkban, 'modpostsnum' => $modpostsnum, 'crimenum' => $crimenum, 'crimeauthor' => $crimeauthor));
     exit;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:59,代码来源:TopicAdminViewAction.php

示例3: while

    while ($post = $db->fetch_array($query)) {
        if ($post['first'] && $thread['digest'] == '-1') {
            showmessage('special_noaction');
        }
        $posts[] = $post;
    }
    if (!submitcheck('banpostsubmit')) {
        $banid = '';
        foreach ($topiclist as $id) {
            $banid .= '<input type="hidden" name="topiclist[]" value="' . $id . '" />';
        }
        include template('topicadmin_banpost');
    } else {
        $banned = intval($banned);
        $modaction = $banned ? 'BNP' : 'UBN';
        checkreasonpm();
        $db->query("UPDATE {$tablepre}posts SET status='{$banned}' WHERE pid IN ({$banpids}) AND tid='{$tid}'", 'UNBUFFERED');
        $resultarray = array('redirect' => "viewthread.php?tid={$tid}&amp;page={$page}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post') : array(), 'modtids' => 0, 'modlog' => $thread);
    }
} else {
    showmessage('undefined_action', NULL, 'HALTED');
}
if ($resultarray) {
    if ($resultarray['modtids']) {
        updatemodlog($resultarray['modtids'], $modaction, $resultarray['expiration']);
    }
    updatemodworks($modaction, $modpostsnum);
    if (is_array($resultarray['modlog'])) {
        if (isset($resultarray['modlog']['tid'])) {
            modlog($resultarray['modlog'], $modaction);
        } else {
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:topicadmin.php

示例4: _viewRate

    private function _viewRate($res, $tid, $pid)
    {
        $res = $this->_checkRate($res, $tid, $pid);
        $status = WebUtils::checkError($res);
        $location = WebUtils::createUrl_oldVersion('index/returnmobileview');
        if ($status) {
            $str = <<<HTML
            <script>
                alert("{$res['head']['errInfo']}");
                location.href = "{$location}";
            </script>
HTML;
            echo $str;
            exit;
        }
        // [add]修复gbk编码导致的评分理由不显示。Author:HanPengyu Data:04.09.27
        if (!empty($_POST)) {
            // 把$_POST转成utf-8, 这是由于discuz源码会在mobile情况下把$_POST预先转码成对应的charset,
            $_POST = array_intersect_key($_REQUEST, $_POST);
            // 手动把转成utf-8的$_POST数据再次转成对应的charset
            foreach ($_POST as $key => $value) {
                if (is_string($value)) {
                    $_POST[$key] = WebUtils::t($value);
                }
            }
            $_GET = array_merge($_GET, $_POST);
        }
        global $_G;
        require_once libfile('function/misc');
        require_once libfile('function/forum');
        //今日剩余积分
        $maxratetoday = $this->_getratingleft($_G['group']['raterange']);
        $post = C::t('forum_post')->fetch('tid:' . $tid, $pid);
        $thread = C::t('forum_thread')->fetch($tid);
        if (!empty($_POST)) {
            $reason = checkreasonpm();
            $rate = $ratetimes = 0;
            $creditsarray = $sub_self_credit = array();
            getuserprofile('extcredits1');
            foreach ($_G['group']['raterange'] as $id => $rating) {
                $score = intval($_GET['score' . $id]);
                if (isset($_G['setting']['extcredits'][$id]) && !empty($score)) {
                    if ($rating['isself'] && intval($_G['member']['extcredits' . $id]) - $score < 0) {
                        //抱歉,您的{extcreditstitle}(评分栏目)不足,无法评分
                        $errorMsg = lang('message', 'thread_rate_range_self_invalid', array('extcreditstitle' => $_G['setting']['extcredits'][$id]['title']));
                        $this->_renderTemplates($tid, $pid, $errorMsg);
                        exit;
                    }
                    if (abs($score) <= $maxratetoday[$id]) {
                        if ($score > $rating['max'] || $score < $rating['min']) {
                            //请输入正确的分值
                            $errorMsg = lang('message', 'thread_rate_range_invalid');
                            $this->_renderTemplates($tid, $pid, $errorMsg);
                            exit;
                        } else {
                            $creditsarray[$id] = $score;
                            if ($rating['isself']) {
                                $sub_self_credit[$id] = -abs($score);
                            }
                            $rate += $score;
                            $ratetimes += ceil(max(abs($rating['min']), abs($rating['max'])) / 5);
                        }
                    } else {
                        //抱歉,24 小时评分数超过限制
                        $errorMsg = lang('message', 'thread_rate_ctrl');
                        $this->_renderTemplates($tid, $pid, $errorMsg);
                        exit;
                    }
                }
            }
            if (!$creditsarray) {
                //请输入正确的分值
                $errorMsg = lang('message', 'thread_rate_range_invalid');
                $this->_renderTemplates($tid, $pid, $errorMsg);
                exit;
            }
            updatemembercount($post['authorid'], $creditsarray, 1, 'PRC', $_GET['pid']);
            if (!empty($sub_self_credit)) {
                updatemembercount($_G['uid'], $sub_self_credit, 1, 'RSC', $_GET['pid']);
            }
            C::t('forum_post')->increase_rate_by_pid('tid:' . $_G['tid'], $_GET['pid'], $rate, $ratetimes);
            if ($post['first']) {
                $threadrate = intval(@($post['rate'] + $rate) / abs($post['rate'] + $rate));
                C::t('forum_thread')->update($_G['tid'], array('rate' => $threadrate));
            }
            require_once libfile('function/discuzcode');
            $sqlvalues = $comma = '';
            $sqlreason = censor(trim($_GET['reason']));
            $sqlreason = cutstr(dhtmlspecialchars($sqlreason), 40, '.');
            foreach ($creditsarray as $id => $addcredits) {
                $insertarr = array('pid' => $_GET['pid'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'extcredits' => $id, 'dateline' => $_G['timestamp'], 'score' => $addcredits, 'reason' => $sqlreason);
                C::t('forum_ratelog')->insert($insertarr);
            }
            include_once libfile('function/post');
            $_G['forum']['threadcaches'] && @deletethreadcaches($_G['tid']);
            $reason = dhtmlspecialchars(censor(trim($reason)));
            //对是否通知作者做的一些初始工作
            if ($_G['group']['resasonpm'] == 2 || $_G['group']['reasonpm'] == 3 || !empty($_GET['sendreasonpm'])) {
                $forumname = strip_tags($_G['forum']['name']);
                $sendreasonpm = 1;
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:TopicRateAction.php


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