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


PHP getstatus函数代码示例

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


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

示例1: addmobileauth

 function addmobileauth($uid, $mobile)
 {
     if (!preg_match('/^\\d{11}$/', $mobile)) {
         $this->result['message'] = '手机号码非法';
         return new ApiResponse($this->result);
     }
     $userService = L::loadClass('userservice', 'user');
     /* @var $userService PW_Userservice */
     $uid = intval($uid);
     $userinfo = $userService->get($uid);
     if (!S::isArray($userinfo)) {
         $this->result['message'] = '用户名"' . $username . '"未找到';
         return new ApiResponse($this->result);
     } elseif ($userinfo['authmobile'] && getstatus($userinfo['userstatus'], PW_USERSTATUS_AUTHMOBILE)) {
         $this->result['message'] = '该用户已完成手机实名认证';
         $this->result['authmobile'] = $userinfo['authmobile'];
         return new ApiResponse($this->result);
     }
     $userService->update($userinfo['uid'], array('authmobile' => $mobile));
     $userService->setUserStatus($userinfo['uid'], PW_USERSTATUS_AUTHMOBILE, true);
     //颁发勋章
     if ($db_md_ifopen) {
         $medalService = L::loadClass('medalservice', 'medal');
         $medalService->awardMedalByIdentify($userinfo['uid'], 'shimingrenzheng');
     }
     require_once R_P . 'require/functions.php';
     initJob($userinfo['uid'], 'doAuthMobile');
     $this->result['error'] = 0;
     return new ApiResponse($this->result);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:30,代码来源:class_auth.php

示例2: after_newreply

	public function after_newreply() {
		global $rushinfo;
		if(getstatus($this->thread['status'], 3) && $this->param['maxposition']) {
			$rushstopfloor = $rushinfo['stopfloor'];
			if($rushstopfloor > 0 && $this->thread['closed'] == 0 && $this->param['maxposition'] >= $rushstopfloor) {
				$this->param['updatethreaddata'] = array_merge((array)$this->param['updatethreaddata'], array('closed' => 1));
			}
		}
	}
开发者ID:xDiglett,项目名称:discuzx30,代码行数:9,代码来源:extend_thread_rushreply.php

示例3: post_mobile_message

 function post_mobile_message($message, $url_forward, $values, $extraparam, $custom)
 {
     if ($message == 'comment_add_succeed') {
         showmessage($message);
     }
     if ($values['tid'] && $values['pid']) {
         global $_G;
         $threadstatus = DB::result_first("SELECT status FROM " . DB::table('forum_thread') . " WHERE tid='{$values['tid']}'");
         $setstatusold = base_convert(getstatus($threadstatus, 13) . getstatus($threadstatus, 12) . getstatus($threadstatus, 11), 2, 10);
         $updatestatus = false;
         if (!empty($_POST['allowsound'])) {
             $setstatus = array(1, 0, 0);
             $updatestatus = $setstatusold < 4;
         } elseif (!empty($_POST['allowphoto'])) {
             $setstatus = array(0, 1, 1);
             $updatestatus = $setstatusold < 3;
         } elseif (!empty($_POST['allowlocal'])) {
             $setstatus = array(0, 1, 0);
             $updatestatus = $setstatusold < 2;
         } else {
             $setstatus = array(0, 0, 1);
         }
         if ($updatestatus) {
             foreach ($setstatus as $i => $bit) {
                 $threadstatus = setstatus(13 - $i, $bit, $threadstatus);
             }
             //note DB::update('forum_thread', array('status' => $threadstatus), "tid='$values[tid]'");
             C::t('forum_thread')->update($values['tid'], array('status' => $threadstatus));
         }
         $posttable = getposttablebytid($values['tid']);
         $poststatus = DB::result_first("SELECT status FROM " . DB::table($posttable) . " WHERE pid='{$values['pid']}'");
         $poststatus = setstatus(4, 1, $poststatus);
         if (!empty($_POST['allowlocal'])) {
             $poststatus = setstatus(6, 1, $poststatus);
         }
         if (!empty($_POST['allowsound'])) {
             $poststatus = setstatus(7, 1, $poststatus);
         }
         if (!empty($_POST['mobiletype']) && $_POST['mobiletype'] < 8) {
             $mobiletype = base_convert($_POST['mobiletype'], 10, 2);
             $mobiletype = sprintf('%03d', $mobiletype);
             for ($i = 0; $i < 3; $i++) {
                 $poststatus = setstatus(10 - $i, $mobiletype[$i], $poststatus);
             }
         }
         //note DB::update($posttable, array('status' => $poststatus), "pid='$values[pid]'");
         C::t('forum_post')->update('tid:' . $values['tid'], $values['pid'], array('status' => $poststatus));
         if ($_POST['location']) {
             list($mapx, $mapy, $location) = explode('|', dhtmlspecialchars($_POST['location']));
             C::t('forum_post_location')->insert(array('pid' => $values['pid'], 'tid' => $values['tid'], 'uid' => $_G['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
         }
     }
 }
开发者ID:sayhanabi,项目名称:sayhanabi_forum,代码行数:53,代码来源:sendreply.php

示例4: _check_post_length

 private function _check_post_length($message, $length)
 {
     if ($this->param['special'] || $this->thread['special'] || getstatus($this->thread['status'], 3) || !$length) {
         return 0;
     }
     require_once libfile('function/discuzcode');
     $langthread = lang('forum/thread');
     $content = discuzcode($message);
     $content = strip_tags($content);
     $content = str_replace(array(',', '.', '?', '!', $langthread['t_question'], $langthread['t_exclamatory'], $langthread['t_period'], $langthread['t_comma'], '~', $langthread['t_suspension']), '', $content);
     $content = preg_replace('/\\s+/', '', $content);
     $realLength = dstrlen($content);
     $checkQuote = preg_match("/\\s?\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s?/is", $message) > 0 || preg_match("/\\[img=(\\d{1,4})[x|\\,](\\d{1,4})\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/i", $message) > 0 || preg_match("/\\[img\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/i", $message) > 0 || preg_match("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $message) > 0;
     if ($checkQuote || $realLength >= $length) {
         return $realLength <= 0 ? 1 : $realLength;
     } else {
         return 0;
     }
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:19,代码来源:extend_thread_filter.php

示例5: build_cache_founder

function build_cache_founder()
{
    global $_G;
    $allowadmincp = $status0 = $status1 = array();
    $founders = explode(',', str_replace(' ', '', $_G['config']['admincp']['founder']));
    if ($founders) {
        foreach ($founders as $founder) {
            if (is_numeric($founder)) {
                $fuid[] = $founder;
            } else {
                $fuser[] = $founder;
            }
        }
        $query = DB::query('SELECT uid FROM ' . DB::table('common_member') . ' WHERE ' . ($fuid ? 'uid IN (' . dimplode($fuid) . ')' : '0') . ' OR ' . ($fuser ? 'username IN (' . dimplode($fuser) . ')' : '0'));
        while ($founder = DB::fetch($query)) {
            $allowadmincp[$founder['uid']] = $founder['uid'];
        }
    }
    $query = DB::query('SELECT uid FROM ' . DB::table('common_admincp_member'));
    while ($member = DB::fetch($query)) {
        $allowadmincp[$member['uid']] = $member['uid'];
    }
    $query = DB::query('SELECT uid, allowadmincp FROM ' . DB::table('common_member') . " WHERE allowadmincp > '0' OR uid IN (" . dimplode($allowadmincp) . ')');
    while ($user = DB::fetch($query)) {
        if (isset($allowadmincp[$user['uid']]) && !getstatus($user['allowadmincp'], 1)) {
            $status1[$user['uid']] = $user['uid'];
        } elseif (!isset($allowadmincp[$user['uid']]) && getstatus($user['allowadmincp'], 1)) {
            $status0[$user['uid']] = $user['uid'];
        }
    }
    if (!empty($status0)) {
        DB::query('UPDATE ' . DB::table('common_member') . ' SET allowadmincp=allowadmincp & 0xFE WHERE uid IN (' . dimplode($status0) . ')');
    }
    if (!empty($status1)) {
        DB::query('UPDATE ' . DB::table('common_member') . ' SET allowadmincp=allowadmincp | 1 WHERE uid IN (' . dimplode($status1) . ')');
    }
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:37,代码来源:cache_founder.php

示例6: build_cache_founder

function build_cache_founder()
{
    global $_G;
    $allowadmincp = $status0 = $status1 = array();
    $founders = explode(',', str_replace(' ', '', $_G['config']['admincp']['founder']));
    if ($founders) {
        foreach ($founders as $founder) {
            if (is_numeric($founder)) {
                $fuid[] = $founder;
            } else {
                $fuser[] = $founder;
            }
        }
        if ($fuid) {
            $allowadmincp = C::t('common_member')->fetch_all($fuid, false, 0);
        }
        if ($fuser) {
            $allowadmincp = $allowadmincp + C::t('common_member')->fetch_all_by_username($fuser);
        }
    }
    $allowadmincp = $allowadmincp + C::t('common_admincp_member')->range();
    $allallowadmincp = C::t('common_member')->fetch_all_by_allowadmincp('0', '>') + C::t('common_member')->fetch_all(array_keys($allowadmincp), false, 0);
    foreach ($allallowadmincp as $uid => $user) {
        if (isset($allowadmincp[$uid]) && !getstatus($user['allowadmincp'], 1)) {
            $status1[$uid] = $uid;
        } elseif (!isset($allowadmincp[$uid]) && getstatus($user['allowadmincp'], 1)) {
            $status0[$uid] = $uid;
        }
    }
    if (!empty($status0)) {
        C::t('common_member')->clean_admincp_manage($status0);
    }
    if (!empty($status1)) {
        C::t('common_member')->update_admincp_manage($status1);
    }
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:36,代码来源:cache_founder.php

示例7: isUserBanned

 function isUserBanned($uid)
 {
     $uid = intval($uid);
     if ($uid < 1) {
         return $this->buildResponse(PERMISSIONS_INVALID_PARAMS);
     }
     $userService = L::loadClass('UserService', 'user');
     $userInfo = $userService->get($uid);
     if (!S::isArray($userInfo)) {
         return $this->buildResponse(PERMISSIONS_USER_NOT_EXISTS);
     }
     $groupId = $userInfo['groupid'] == -1 ? $userInfo['memberid'] : $userInfo['groupid'];
     $_G = array();
     if (file_exists(D_P . "data/groupdb/group_{$groupId}.php")) {
         require S::escapePath(D_P . "data/groupdb/group_{$groupId}.php");
     } else {
         require D_P . 'data/groupdb/group_1.php';
     }
     $code = 0;
     if ($groupId == 6 || getstatus($userInfo['userstatus'], PW_USERSTATUS_BANUSER) || !$_G['allowpost']) {
         $code = 500;
     }
     return $this->buildResponse($code);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:24,代码来源:ver.common.permissions.php

示例8: pwEscape

         }
         $count -= 2;
         $db->update("DELETE FROM {$pw_posts} WHERE pid=" . pwEscape($rt['pid']));
         $pwSQL = $rt['subject'] ? array('subject' => $rt['subject']) : array();
         $pwSQL += array('icon' => $rt['icon'], 'author' => $rt['author'], 'authorid' => $rt['authorid'], 'postdate' => $rt['postdate'], 'lastpost' => $lastpost, 'lastposter' => $lastposter, 'replies' => $count);
         $db->update("UPDATE pw_threads SET " . pwSqlSingle($pwSQL, false) . " WHERE tid=" . pwEscape($tid));
         # memcache reflesh
         $threadList = L::loadClass("threadlist");
         $threadList->updateThreadIdsByForumId($fid, $tid);
         $db->update("UPDATE {$pw_tmsgs} SET " . pwSqlSingle(array('aid' => $rt['aid'], 'userip' => $rt['userip'], 'ifsign' => $rt['ifsign'], 'ipfrom' => $rt['ipfrom'], 'alterinfo' => $rt['alterinfo'], 'ifconvert' => $rt['ifconvert'], 'content' => $rt['content']), false) . " WHERE tid=" . pwEscape($tid));
     }
     $msg_delrvrc = abs($creditset['Delete']['rvrc']);
     $msg_delmoney = abs($creditset['Delete']['money']);
     $credit->addLog('topic_Delete', $creditset['Delete'], array('uid' => $authorid, 'username' => $author, 'ip' => $onlineip, 'fname' => strip_tags($forum[$fid]['name']), 'operator' => $windid));
     $credit->sets($authorid, $creditset['Delete'], false);
     if ($thread_tpcstatus && getstatus($thread_tpcstatus, 1)) {
         $db->update("DELETE FROM pw_argument WHERE tid=" . pwEscape($tid));
     }
 } else {
     $deltype = 'delrp';
     $deltitle = $subject ? substrs($subject, 28) : substrs($content, 28);
     $db->update("DELETE FROM {$pw_posts} WHERE pid=" . pwEscape($pid));
     $db->update("UPDATE pw_threads SET replies=replies-1 WHERE tid=" . pwEscape($tid));
     $msg_delrvrc = abs($creditset['Deleterp']['rvrc']);
     $msg_delmoney = abs($creditset['Deleterp']['money']);
     $credit->addLog('topic_Deleterp', $creditset['Deleterp'], array('uid' => $authorid, 'username' => $author, 'ip' => $onlineip, 'fname' => strip_tags($forum[$fid]['name']), 'operator' => $windid));
     $credit->sets($authorid, $creditset['Deleterp'], false);
 }
 $credit->setMdata($authorid, 'postnum', -1);
 $credit->runsql();
 if ($db_guestread) {
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:postmodify.php

示例9: isban

function isban($udb, $fid = null)
{
    global $db;
    $retu = $uids = array();
    if (isset($udb['groupid']) && isset($udb['userstatus'])) {
        if ($udb['groupid'] == 6) {
            $retu[$udb['uid']] = 1;
        } elseif ($fid && getstatus($udb['userstatus'], 1) && ($rt = $db->get_one("SELECT uid FROM pw_banuser WHERE uid=" . pwEscape($udb['uid']) . " AND fid=" . pwEscape($fid)))) {
            $retu[$udb['uid']] = 2;
        }
    } else {
        foreach ($udb as $key => $u) {
            if ($u['groupid'] == 6) {
                //是否全局禁言
                $retu[$u['uid']] = 1;
            } elseif (getstatus($u['userstatus'], 1)) {
                //是否版块禁言
                $uids[] = $u['uid'];
            }
        }
        if ($fid && $uids) {
            $uids = pwImplode($uids);
            $query = $db->query("SELECT uid FROM pw_banuser WHERE uid IN ({$uids}) AND fid=" . pwEscape($fid));
            while ($rt = $db->fetch_array($query)) {
                $retu[$rt['uid']] = 2;
            }
        }
    }
    return $retu;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:30,代码来源:forum.php

示例10: viewread

function viewread($read, $start_limit)
{
    global $db, $_G, $isGM, $pwSystem, $groupid, $attach_url, $winduid, $tablecolor, $tpc_author, $tpc_buy, $tpc_pid, $tpc_tag, $count, $orderby, $pageinverse, $timestamp, $db_onlinetime, $attachdir, $attachpath, $readcolorone, $readcolortwo, $lpic, $ltitle, $imgpath, $db_ipfrom, $db_showonline, $stylepath, $db_windpost, $db_windpic, $db_signwindcode, $fid, $tid, $pid, $db_md_ifopen, $_MEDALDB, $rewardtype, $db_shield, $db_iftag, $db_readtag, $viewpic;
    global $ping_logs;
    if ($read['istop'] == 'topped') {
        $read['lou'] = $read['floor'];
    } else {
        $read['lou'] = $count - $start_limit;
    }
    $read['jupend'] = $start_limit == $count - 1 ? "<a name=a></a><a name={$read['pid']}></a>" : "<a name={$read['pid']}></a>";
    $tpc_buy = $read['buy'];
    $tpc_pid = $read['pid'];
    $tpc_tag = NULL;
    $tpc_shield = 0;
    $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br />", $read['content']));
    if ($read['anonymous']) {
        $anonymous = !$isGM && $winduid != $read['authorid'] && !$pwSystem['anonyhide'];
        $read['anonymousname'] = $GLOBALS['db_anonymousname'];
    } else {
        $anonymous = false;
        $read['anonymousname'] = $read['username'];
    }
    $read['ipfrom'] = $db_ipfrom == 1 && $_G['viewipfrom'] ? $read['ipfrom'] : '';
    $read['ip'] = $isGM || $pwSystem['viewip'] ? 'IP:' . $read['userip'] : '';
    if ($read['groupid'] && !$anonymous) {
        $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']);
        !array_key_exists($read['groupid'], (array) $lpic) && ($read['groupid'] = 8);
        $read['lpic'] = $lpic[$read['groupid']];
        $read['level'] = $ltitle[$read['groupid']];
        $read['regdate'] = get_date($read['regdate'], "Y-m-d");
        $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d");
        $read['rvrc'] = floor($read['rvrc'] / 10);
        $read['author'] = $read['username'];
        $tpc_author = $read['author'];
        if (!empty($GLOBALS['showfield'])) {
            $customdata = $read['customdata'] ? (array) unserialize($read['customdata']) : array();
            $read['customdata'] = array();
            foreach ($customdata as $key => $val) {
                if ($val && in_array($key, $GLOBALS['showfield'])) {
                    $read['customdata'][$key] = $val;
                }
            }
        }
        $read['ontime'] = (int) ($read['onlinetime'] / 3600);
        $read['groupid'] == 6 && ($read['honor'] = '');
        if ($read['groupid'] != 6 && ($read['ifsign'] == 1 || $read['ifsign'] == 3)) {
            global $sign;
            if (!$sign[$read['author']]) {
                global $db_signmoney, $db_signgroup, $tdtime, $db_signcurtype;
                if ($db_signmoney && strpos($db_signgroup, ",{$read['groupid']},") !== false && (!getstatus($read['userstatus'], PW_USERSTATUS_SHOWSIGN) || !$read['starttime'] || $read[$db_signcurtype] < ($tdtime - $read['starttime']) / 86400 * $db_signmoney)) {
                    $read['signature'] = '';
                } else {
                    if ($db_signwindcode && getstatus($read['userstatus'], PW_USERSTATUS_SIGNCHANGE)) {
                        if ($GLOBALS['gp_right'][$read['groupid']]['imgwidth'] && $GLOBALS['gp_right'][$read['groupid']]['imgheight']) {
                            $db_windpic['picwidth'] = $GLOBALS['gp_right'][$read['groupid']]['imgwidth'];
                            $db_windpic['picheight'] = $GLOBALS['gp_right'][$read['groupid']]['imgheight'];
                        }
                        if ($GLOBALS['gp_right'][$read['groupid']]['fontsize']) {
                            $db_windpic['size'] = $GLOBALS['gp_right'][$read['groupid']]['fontsize'];
                        }
                        $read['signature'] = convert($read['signature'], $db_windpic, 2);
                    }
                    $read['signature'] = str_replace("\n", "<br />", $read['signature']);
                }
                $sign[$read['author']] = $read['signature'];
            } else {
                $read['signature'] = $sign[$read['author']];
            }
        } else {
            $read['signature'] = '';
        }
    } else {
        $read['lpic'] = $lpic['2'];
        $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['currency'] = '*';
        $read['rvrc'] = $read['lastlogin'] = $read['credit'] = $read['regdate'] = '*';
        $read['honor'] = $read['signature'] = $read['micon'] = $read['aliww'] = '';
        if ($anonymous) {
            $read['oicq'] = $read['ip'] = $read['medals'] = $read['ipfrom'] = '';
            $read['author'] = $GLOBALS['db_anonymousname'];
            $read['authorid'] = 0;
            foreach ($GLOBALS['customfield'] as $key => $val) {
                $field = "field_" . (int) $val['id'];
                $read[$field] = '*';
            }
        }
    }
    list($read['face'], , $httpWidth, $httpHeight, , , , $read['facesize']) = showfacedesign($read['micon'], true, 'm');
    if ($httpWidth > 120 || $httpHeight > 120 || $read['facesize'] == '') {
        $read['facesize'] = ' width="120" height="120"';
    }
    list($read['posttime'], $read['postdate']) = getLastDate($read['postdate']);
    $read['mark'] = $read['reward'] = $read['tag'] = NULL;
    if ($read['ifmark']) {
        $ping_logs[$read['pid']] = $read['ifmark'];
    }
    if ($rewardtype != null) {
        if ($read['lou'] == 0 || $read['ifreward'] > 0 || $rewardtype == '0' && $winduid == $GLOBALS['authorid'] && $winduid != $read['authorid']) {
            $read['reward'] = Getrewhtml($read['lou'], $read['ifreward'], $read['pid']);
        }
    }
//.........这里部分代码省略.........
开发者ID:jechiy,项目名称:PHPWind,代码行数:101,代码来源:addfloor.php

示例11: _viewthread_bottom_output

 function _viewthread_bottom_output()
 {
     if (!$this->allow) {
         return;
     }
     global $_G, $thread, $rushreply, $postlist, $page;
     $uids = $openids = array();
     foreach ($postlist as $pid => $post) {
         if ($post['anonymous']) {
             continue;
         }
         if ($post['authorid']) {
             $uids[$post['authorid']] = $post['authorid'];
         }
     }
     foreach (C::t('#qqconnect#common_member_connect')->fetch_all($uids) as $connect) {
         if ($connect['conisqqshow'] && $connect['conopenid']) {
             $openids[$connect['uid']] = $connect['conopenid'];
         }
     }
     foreach ($postlist as $pid => $post) {
         if (getstatus($post['status'], 5)) {
             $matches = array();
             preg_match('/\\[tthread=(.+?),(.+?)\\](.*?)\\[\\/tthread\\]/', $post['message'], $matches);
             if ($matches[1] && $matches[2]) {
                 $post['message'] = preg_replace('/\\[tthread=(.+?)\\](.*?)\\[\\/tthread\\]/', lang('plugin/qqconnect', 'connect_tthread_message', array('username' => $matches[1], 'nick' => $matches[2])), $post['message']);
             }
             $post['authorid'] = 0;
             $post['author'] = lang('plugin/qqconnect', 'connect_tthread_comment');
             $post['avatar'] = $matches[3] ? '<img src="' . $matches[3] . '/120' . '">' : '<img src="' . $_G['siteurl'] . '/static/image/common/tavatar.gif">';
             $post['groupid'] = '7';
             $postlist[$pid] = $post;
             continue;
         }
         if ($post['anonymous']) {
             continue;
         }
     }
     if ($page == 1 && $postlist[$_G['forum_firstpid']]['invisible'] == 0) {
         $jsurl = '';
         if (!$_G['cookie']['connect_last_sync_t'] && $_G['uid'] && $_G['setting']['connect']['t']['reply'] && !$thread['closed'] && !$rushreply && getstatus($_G['forum_thread']['status'], 14)) {
             $jsurl = $_G['connect']['discuz_sync_tthread_url'] . '&tid=' . $thread['tid'];
             dsetcookie('connect_last_sync_t', 1, 600);
         }
         return tpl_viewthread_bottom($jsurl);
     }
 }
开发者ID:samyex6,项目名称:discuz3.2-lite,代码行数:47,代码来源:connect.class.php

示例12: showmessage

            }
        }
    } else {
        showmessage('parameters_error', '', array('haserror' => 1));
    }
    include_once template("forum/usertag");
} elseif ($_GET['action'] == 'postreview') {
    if (!$_G['setting']['repliesrank'] || empty($_G['uid'])) {
        showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1));
    }
    if (empty($_GET['hash']) || $_GET['hash'] != formhash()) {
        showmessage('submit_invalid');
    }
    $doArray = array('support', 'against');
    $post = C::t('forum_post')->fetch('tid:' . $_GET['tid'], $_GET['pid'], false);
    if (!in_array($_GET['do'], $doArray) || empty($post) || $post['first'] == 1 || $_G['setting']['threadfilternum'] && $_G['setting']['filterednovote'] && getstatus($post['status'], 11)) {
        showmessage('undefined_action', NULL);
    }
    $hotreply = C::t('forum_hotreply_number')->fetch_by_pid($post['pid']);
    if ($_G['uid'] == $post['authorid']) {
        showmessage('noreply_yourself_error', '', array(), array('msgtype' => 3));
    }
    if (empty($hotreply)) {
        $hotreply['pid'] = C::t('forum_hotreply_number')->insert(array('pid' => $post['pid'], 'tid' => $post['tid'], 'support' => 0, 'against' => 0, 'total' => 0), true);
    } else {
        if (C::t('forum_hotreply_member')->fetch($post['pid'], $_G['uid'])) {
            showmessage('noreply_voted_error', '', array(), array('msgtype' => 3));
        }
    }
    $typeid = $_GET['do'] == 'support' ? 1 : 0;
    C::t('forum_hotreply_number')->update_num($post['pid'], $typeid);
开发者ID:443952248,项目名称:jiazhichao,代码行数:31,代码来源:forum_misc.php

示例13: dsetcookie

 $st_p = $_G['uid'] . '|' . TIMESTAMP;
 dsetcookie('st_p', $st_p . '|' . md5($st_p . $_G['config']['security']['authkey']));
 if ($thread['special'] == 2 && ((!isset($_GET['addtrade']) || $thread['authorid'] != $_G['uid']) && !($tradenum = C::t('forum_trade')->fetch_counter_thread_goods($_G['tid'])))) {
     showmessage('trade_newreply_nopermission', NULL);
 }
 $language = lang('forum/misc');
 $noticeauthor = $noticetrimstr = '';
 if (isset($_GET['repquote']) && ($_GET['repquote'] = intval($_GET['repquote']))) {
     $thaquote = C::t('forum_post')->fetch('tid:' . $_G['tid'], $_GET['repquote']);
     if (!($thaquote && ($thaquote['invisible'] == 0 || $thaquote['authorid'] == $_G['uid'] && $thaquote['invisible'] == -2))) {
         $thaquote = array();
     }
     if ($thaquote['tid'] != $_G['tid']) {
         showmessage('reply_quotepost_error', NULL);
     }
     if (getstatus($thread['status'], 2) && $thaquote['authorid'] != $_G['uid'] && $_G['uid'] != $thread['authorid'] && $thaquote['first'] != 1 && !$_G['forum']['ismoderator']) {
         showmessage('reply_quotepost_error', NULL);
     }
     if (!($thread['price'] && !$thread['special'] && $thaquote['first'])) {
         $quotefid = $thaquote['fid'];
         $message = $thaquote['message'];
         if (strpos($message, '[/password]') !== FALSE) {
             $message = '';
         }
         if ($_G['setting']['bannedmessages'] && $thaquote['authorid']) {
             $author = getuserbyuid($thaquote['authorid']);
             if (!$author['groupid'] || $author['groupid'] == 4 || $author['groupid'] == 5) {
                 $message = $language['post_banned'];
             } elseif ($thaquote['status'] & 1) {
                 $message = $language['post_single_banned'];
             }
开发者ID:lemonstory,项目名称:bbs,代码行数:31,代码来源:post_newreply.php

示例14: getblockperm

function getblockperm($bid)
{
    global $_G;
    $perm = array('allowmanage' => '0', 'allowrecommend' => '0', 'needverify' => '1');
    $bid = max(0, intval($bid));
    if (!$bid) {
        return $perm;
    }
    $allperm = array('allowmanage' => '1', 'allowrecommend' => '1', 'needverify' => '0');
    if (checkperm('allowdiy')) {
        return $allperm;
    } elseif (!getstatus($_G['member']['allowadmincp'], 4) && !getstatus($_G['member']['allowadmincp'], 5) && !getstatus($_G['member']['allowadmincp'], 6) && !checkperm('allowmanagetopic') && !checkperm('allowaddtopic')) {
        return $perm;
    }
    require_once libfile('class/blockpermission');
    $blockpermsission =& block_permission::instance();
    $perm = $blockpermsission->get_perms_by_bid($bid, $_G['uid']);
    $perm = $perm ? current($perm) : '';
    if (empty($perm)) {
        if ($block = C::t('common_block')->fetch($bid)) {
            $block = array_merge($block, C::t('common_template_block')->fetch_by_bid($bid));
        }
        if (empty($block['targettplname']) && empty($block['blocktype'])) {
            if ($_G['group']['allowmanagetopic'] || $_G['group']['allowaddtopic'] && $block['uid'] == $_G['uid']) {
                $perm = $allperm;
            }
        } elseif (substr($block['targettplname'], 0, 28) == 'portal/portal_topic_content_') {
            if (!empty($_G['group']['allowmanagetopic'])) {
                $perm = $allperm;
            } elseif ($_G['group']['allowaddtopic']) {
                $id = str_replace('portal/portal_topic_content_', '', $block['targettplname']);
                $topic = C::t('portal_topic')->fetch(intval($id));
                if ($topic['uid'] == $_G['uid']) {
                    $perm = $allperm;
                }
            }
        }
    }
    return $perm;
}
开发者ID:softhui,项目名称:discuz,代码行数:40,代码来源:function_portalcp.php

示例15: viewthread_procpost

function viewthread_procpost($post, $lastvisit, $ordertype, $maxposition = 0)
{
    global $_G, $rushreply;
    if (!$_G['forum_newpostanchor'] && $post['dateline'] > $lastvisit) {
        $post['newpostanchor'] = '<a name="newpost"></a>';
        $_G['forum_newpostanchor'] = 1;
    } else {
        $post['newpostanchor'] = '';
    }
    $post['lastpostanchor'] = $ordertype != 1 && $_G['forum_numpost'] == $_G['forum_thread']['replies'] || $ordertype == 1 && $_G['forum_numpost'] == $_G['forum_thread']['replies'] + 2 ? '<a name="lastpost"></a>' : '';
    if (!$post['hotrecommended']) {
        if ($_G['forum_pagebydesc']) {
            if ($ordertype != 1) {
                $post['number'] = $_G['forum_numpost'] + $_G['forum_ppp2']--;
            } else {
                $post['number'] = $post['first'] == 1 ? 1 : $_G['forum_numpost'] - 1 - $_G['forum_ppp2']--;
            }
        } else {
            if ($ordertype != 1) {
                $post['number'] = ++$_G['forum_numpost'];
            } else {
                $post['number'] = $post['first'] == 1 ? 1 : --$_G['forum_numpost'];
                $post['number'] = $post['number'] - 1;
            }
        }
    }
    if ($post['existinfirstpage']) {
        if ($_G['forum_pagebydesc']) {
            $_G['forum_ppp2']--;
        } else {
            if ($ordertype != 1) {
                ++$_G['forum_numpost'];
            } else {
                --$_G['forum_numpost'];
            }
        }
    }
    if ($maxposition) {
        $post['number'] = $post['position'];
    }
    if ($post['hotrecommended']) {
        $post['number'] = -1;
    }
    if (!$_G['forum_thread']['special'] && !$rushreply && !$hiddenreplies && $_G['setting']['threadfilternum'] && getstatus($post['status'], 11)) {
        $post['isWater'] = true;
        if ($_G['setting']['hidefilteredpost'] && !$_G['forum']['noforumhidewater']) {
            $post['inblacklist'] = true;
        }
    } else {
        $_G['allblocked'] = false;
    }
    if ($post['inblacklist']) {
        $_G['blockedpids'][] = $post['pid'];
    }
    $_G['forum_postcount']++;
    $post['dbdateline'] = $post['dateline'];
    $post['dateline'] = dgmdate($post['dateline'], 'u', '9999', getglobal('setting/dateformat') . ' H:i:s');
    $post['groupid'] = $_G['cache']['usergroups'][$post['groupid']] ? $post['groupid'] : 7;
    if ($post['username']) {
        $_G['forum_onlineauthors'][$post['authorid']] = 0;
        $post['usernameenc'] = rawurlencode($post['username']);
        $post['readaccess'] = $_G['cache']['usergroups'][$post['groupid']]['readaccess'];
        if ($_G['cache']['usergroups'][$post['groupid']]['userstatusby'] == 1) {
            $post['authortitle'] = $_G['cache']['usergroups'][$post['groupid']]['grouptitle'];
            $post['stars'] = $_G['cache']['usergroups'][$post['groupid']]['stars'];
        }
        $post['upgradecredit'] = false;
        if ($_G['cache']['usergroups'][$post['groupid']]['type'] == 'member' && $_G['cache']['usergroups'][$post['groupid']]['creditslower'] != 999999999) {
            $post['upgradecredit'] = $_G['cache']['usergroups'][$post['groupid']]['creditslower'] - $post['credits'];
            $post['upgradeprogress'] = 100 - ceil($post['upgradecredit'] / ($_G['cache']['usergroups'][$post['groupid']]['creditslower'] - $_G['cache']['usergroups'][$post['groupid']]['creditshigher']) * 100);
            $post['upgradeprogress'] = min(max($post['upgradeprogress'], 2), 100);
        }
        $post['taobaoas'] = addslashes($post['taobao']);
        $post['regdate'] = dgmdate($post['regdate'], 'd');
        $post['lastdate'] = dgmdate($post['lastvisit'], 'd');
        $post['authoras'] = !$post['anonymous'] ? ' ' . addslashes($post['author']) : '';
        if ($post['medals']) {
            loadcache('medals');
            foreach ($post['medals'] = explode("\t", $post['medals']) as $key => $medalid) {
                list($medalid, $medalexpiration) = explode("|", $medalid);
                if (isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
                    $post['medals'][$key] = $_G['cache']['medals'][$medalid];
                    $post['medals'][$key]['medalid'] = $medalid;
                    $_G['medal_list'][$medalid] = $_G['cache']['medals'][$medalid];
                } else {
                    unset($post['medals'][$key]);
                }
            }
        }
        $post['avatar'] = avatar($post['authorid']);
        $post['groupicon'] = $post['avatar'] ? g_icon($post['groupid'], 1) : '';
        $post['banned'] = $post['status'] & 1;
        $post['warned'] = ($post['status'] & 2) >> 1;
    } else {
        if (!$post['authorid']) {
            $post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')) . '.x';
        }
    }
    $post['attachments'] = array();
    $post['imagelist'] = $post['attachlist'] = '';
//.........这里部分代码省略.........
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:101,代码来源:forum_viewthread.php


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