$userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $authordb = $userService->get($atcdb['authorid']); /**Begin modify by liaohu*/ $pce_arr = explode(",", $GLOBALS['SYSTEM']['tcanedit']); if (($authordb['groupid'] == 3 || $authordb['groupid'] == 4 || $authordb['groupid'] == 5) && !in_array($authordb['groupid'], $pce_arr)) { Showmsg('modify_admin'); } /**End modify by liaohu*/ } //版块编辑时间限制 global $postedittime; L::loadClass('forum', 'forum', false); $pwforum = new PwForum($atcdb['fid']); $isBM = $pwforum->isBM($windid); $userSystemRight = userSystemRight($windid, $isBM, 'deltpcs'); $postedittime = $pwforum->foruminfo['forumset']['postedittime']; if (!$userSystemRight && $winduid == $atcdb['authorid'] && $postedittime !== "" && $postedittime != 0 && $timestamp - $atcdb['postdate'] > $postedittime * 60) { Showmsg('modify_forumtimelimit'); } if ($winduid == $atcdb['authorid'] && $_G['edittime'] && $timestamp - $atcdb['postdate'] > $_G['edittime'] * 60) { Showmsg('modify_timelimit'); } if ($atcdb['specialsort'] == PW_THREADSPECIALSORT_KMD && $postmodify->type == 'topic' && $winduid == $atcdb['authorid']) { $kmdService = L::loadClass('KmdService', 'forum'); $kmdInfo = $kmdService->getKmdInfoByTid($tid); $isKmd = 1; } if (empty($_POST['step'])) { if ($isKmd == 1) { if (!$checkkmd && $db_kmd_deducttime) {
function alterinfo() { global $db_postedittime, $windid, $winduid, $manager, $groupid; L::loadClass('forum', 'forum', false); //$pwforum = new PwForum($this->atcdb['fid']); $postedittime = (int) $db_postedittime * 60; $isBM = $this->forum->isBM($windid); $userSystemRight = userSystemRight($windid, $isBM, 'deltpcs'); if (S::inArray($windid, $manager) || $groupid == 3) { $alterinfo = ''; } elseif ($this->post->uid == $this->atcdb['authorid'] && $db_postedittime != 0 && $this->atcdb['postdate'] + $postedittime < $GLOBALS['timestamp']) { global $altername, $db_anonymousname, $timeofedit, $timestamp; $altername = $this->data['anonymous'] && $this->post->uid == $this->atcdb['authorid'] ? $db_anonymousname : $this->post->username; $timeofedit = get_date($timestamp); $alterinfo = getLangInfo('post', 'edit_post'); } elseif ($userSystemRight && $this->post->uid != $this->atcdb['authorid'] && $db_postedittime != 0 && $this->atcdb['postdate'] + $postedittime < $GLOBALS['timestamp']) { global $altername, $db_anonymousname, $timeofedit, $timestamp; $altername = $this->data['anonymous'] && $this->post->uid == $this->atcdb['authorid'] ? $db_anonymousname : $this->post->username; $timeofedit = get_date($timestamp); $alterinfo = getLangInfo('post', 'edit_post'); } else { $alterinfo = ''; } return $alterinfo; }