function checkperm($permtype) { global $_SGLOBAL, $space; if ($permtype == 'admin') { $permtype = 'manageconfig'; } $var = 'checkperm_' . $permtype; if (!isset($_SGLOBAL[$var])) { if (empty($_SGLOBAL['supe_uid'])) { $_SGLOBAL[$var] = ''; } else { if (empty($_SGLOBAL['member'])) { getmember(); } $gid = getgroupid($_SGLOBAL['member']['experience'], $_SGLOBAL['member']['groupid']); if (!@(include_once S_ROOT . './data/data_usergroup_' . $gid . '.php')) { usergroup_cache(); @(include_once S_ROOT . './data/data_usergroup_' . $gid . '.php'); } if ($gid != $_SGLOBAL['member']['groupid']) { updatetable('space', array('groupid' => $gid), array('uid' => $_SGLOBAL['supe_uid'])); //赠送道具 if ($_SGLOBAL['usergroup'][$gid]['magicaward']) { include_once S_ROOT . './source/inc_magicaward.php'; } } $_SGLOBAL[$var] = empty($_SGLOBAL['usergroup'][$gid][$permtype]) ? '' : $_SGLOBAL['usergroup'][$gid][$permtype]; if (substr($permtype, 0, 6) == 'manage' && empty($_SGLOBAL[$var])) { $_SGLOBAL[$var] = $_SGLOBAL['usergroup'][$gid]['manageconfig']; //权限覆盖 if (empty($_SGLOBAL[$var])) { $_SGLOBAL[$var] = ckfounder($_SGLOBAL['supe_uid']) ? 1 : 0; //创始人 } } } } return $_SGLOBAL[$var]; }
// 如果是自定字 if (strpos($value['fieldname'], 'ext_') === 0) { $title = $value['fieldtitle']; } else { $title = $mname . '_' . $value['fieldname']; } pklabel(array('type' => $value['formtype'], 'alang' => $title, 'name' => $value['fieldname'], 'options' => $temparr2, 'rows' => 10, 'width' => '30%', 'size' => '60', 'value' => $editvalue[$value['fieldname']], 'other' => $other, 'fileurl' => $fileurl, 'required' => $value['required'])); } } echo '<script charset="' . $_G['charset'] . '">function getattributes() {$("#attributes").load("batch.attribute.php?ajax=1&itemid=' . $editvalue['itemid'] . '&typeid="+$("select[name=catid]").val());}</script>'; if (($mname == 'good' || $mname == 'groupbuy') && $_GET['action'] != 'list') { showrelatedinfo($mname); if ($_GET['action'] == 'add') { showrelatedinfojs($mname, $_SGLOBAL['panelinfo']['groupid'], '', $_SGLOBAL['panelinfo']['itemid'], 'admin'); } else { $editvalue['groupid'] = getgroupid($mname, $editvalue['itemid']); showrelatedinfojs($mname, $editvalue['groupid'], $editvalue['itemid'], $editvalue['shopid'], 'admin'); } } if (!empty($_SGLOBAL['panelinfo'])) { showhiddenfields(array('shopid' => $_SGLOBAL['panelinfo']['itemid'])); } elseif ($editvalue['shopid']) { showhiddenfields(array('shopid' => $editvalue['shopid'])); } showhiddenfields(array('itemid' => $editvalue['itemid'])); showhiddenfields(array('nid' => $editvalue['nid'])); if ($_GET['action'] == 'edit') { showhiddenfields(array('nocheckcatid' => 1)); } showhiddenfields(array('valuesubmit' => 'yes')); showsubmit('settingsubmit', 'submit', '');
function deleteinfo($ids) { global $_SGLOBAL; include_once S_ROOT . './source/function_delete.php'; $deltype = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('report') . " WHERE rid IN (" . simplode($ids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $deltype[$value['idtype']][] = $value['id']; } $gid = getgroupid($_SGLOBAL['member']['credit'], $_SGLOBAL['member']['groupid']); //执行相应的删除操作 foreach ($deltype as $key => $value) { switch ($key) { case 'blog': $_SGLOBAL['usergroup'][$gid]['manageblog'] = 1; deleteblogs($value); break; case 'picid': $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1; deletepics($value); break; case 'album': $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1; deletealbums($value); break; case 'thread': $_SGLOBAL['usergroup'][$gid]['managethread'] = 1; deletethreads(0, $value); break; case 'mtag': $_SGLOBAL['usergroup'][$gid]['managemtag'] = 1; deletemtag($value); break; case 'share': $_SGLOBAL['usergroup'][$gid]['manageshare'] = 1; deleteshares($value); break; case 'space': $_SGLOBAL['usergroup'][$gid]['managespace'] = 1; foreach ($value as $uid) { deletespace($uid); } break; } } }
$grouptype = $db->result_first("SELECT type FROM {$tablepre}usergroups WHERE groupid='{$groupid}'"); if (!empty($grouptype)) { $cachelost .= ' usergroup_' . $groupid; } else { $grouptype = 'member'; } } /* $link_login = '******'; $link_logout = 'logging.php?action=logout&formhash='.FORMHASH; $link_register = $regname; */ if ($discuz_uid && $_DSESSION) { if (!empty($groupexpiry) && $groupexpiry < $timestamp && !in_array(CURSCRIPT, array('wap', 'member'))) { dheader("Location: {$boardurl}member.php?action=groupexpiry"); } elseif ($grouptype && $groupid != getgroupid($discuz_uid, array('type' => $grouptype, 'creditshigher' => $groupcreditshigher, 'creditslower' => $groupcreditslower), $_DSESSION)) { @extract($_DSESSION); $cachelost .= @(include DISCUZ_ROOT . './forumdata/cache/usergroup_' . intval($groupid) . '.php') ? '' : ' usergroup_' . $groupid; } } $tpp = intval(empty($_DSESSION['tpp']) ? $topicperpage : $_DSESSION['tpp']); $ppp = intval(empty($_DSESSION['ppp']) ? $postperpage : $_DSESSION['ppp']); if (!in_array($adminid, array(1, 2, 3))) { $alloweditpost = $alloweditpoll = $allowstickthread = $allowmodpost = $allowdelpost = $allowmassprune = $allowrefund = $allowcensorword = $allowviewip = $allowbanip = $allowedituser = $allowmoduser = $allowbanuser = $allowpostannounce = $allowviewlog = $disablepostctrl = 0; } elseif (isset($radminid) && $adminid != $radminid && $adminid != $groupid) { $cachelost .= @(include DISCUZ_ROOT . './forumdata/cache/admingroup_' . intval($adminid) . '.php') ? '' : ' admingroup_' . $groupid; } $page = isset($page) ? max(1, intval($page)) : 1; $tid = isset($tid) && is_numeric($tid) ? $tid : 0; $fid = isset($fid) && is_numeric($fid) ? $fid : 0; $typeid = isset($typeid) ? intval($typeid) : 0;
//删除保护 if ($member['flag'] != -1) { include_once S_ROOT . './uc_client/client.php'; if ($_POST['flag'] == 1) { $result = uc_user_addprotected(array($member['username']), $_SGLOBAL['supe_username']); } else { $_POST['flag'] = 0; $result = uc_user_deleteprotected(array($member['username']), $_SGLOBAL['supe_username']); } if ($result) { $setarr['flag'] = $_POST['flag']; } } if ($uid != $_SGLOBAL['supe_uid'] || ckfounder($_SGLOBAL['supe_uid'])) { if (empty($_POST['groupid'])) { $_POST['groupid'] = getgroupid($_POST['experience'], 0); } else { $expiration = $_POST['expiration'] ? sstrtotime($_POST['expiration']) : 0; if ($expiration && $expiration <= $_SGLOBAL['timestamp']) { showmessage('time_expired_error'); } } include_once S_ROOT . './data/data_usergroup_' . $_POST['groupid'] . '.php'; $group = $_SGLOBAL['usergroup'][$_POST['groupid']]; if ($group['manageconfig'] && !ckfounder($_SGLOBAL['supe_uid'])) { cpmessage('no_authority_management_operation'); } //有效期 if ($expiration) { $setlogarr = array('uid' => $member['uid'], 'username' => addslashes($member['username']), 'opuid' => $_SGLOBAL['supe_uid'], 'opusername' => $_SGLOBAL['supe_username'], 'expiration' => $expiration, 'dateline' => $_SGLOBAL['timestamp'], 'flag' => 1); inserttable('spacelog', $setlogarr, 0, true);
function checkperm($permtype, $gid = 0) { global $_SGLOBAL, $_SCONFIG, $channel, $channels; if (!@(include_once S_ROOT . './data/system/group.cache.php')) { include_once S_ROOT . './function/cache.func.php'; updategroupcache(); } $founderprem = array('managetpl', 'managecss', 'managestyletpl'); if (ckfounder($_SGLOBAL['supe_uid'])) { return $permtype == 'allowdirectpost' ? false : true; //´´Ê¼È˲»×öȨÏÞ¼ì²é } elseif (in_array($permtype, $founderprem)) { return false; //·Ç´´Ê¼ÈËȨÏÞ } if (!$gid) { if (empty($_SGLOBAL['supe_uid'])) { getmember(); } if (empty($_SGLOBAL['member']['groupid'])) { $gid = 2; //ÓοÍ×é } else { $gid = intval($_SGLOBAL['member']['groupid']); $gid = getgroupid($_SGLOBAL['member']['experience'], $gid); if ($gid != $_SGLOBAL['member']['groupid']) { updatetable('members', array('groupid' => $gid), array('uid' => $_SGLOBAL['supe_uid'])); //¸üÐÂÓû§×é } } if (!empty($channel)) { if (!empty($channels['menus'][$channel][$permtype])) { $extgroupid = explode("\t", $channels['menus'][$channel][$permtype]); if (!in_array($gid, $extgroupid)) { return false; } //ûÓÐƵµÀ·ÃÎÊȨ } } } if ($permtype == 'allowmanage') { return true; } return empty($_SGLOBAL['grouparr'][$gid][$permtype]) ? false : true; }
@(include_once DISCUZ_ROOT . './forumdata/cache/cache_viewpro.php'); @extract($_DCACHE['custominfo']); $discuz_action = 61; if ($oltimespan) { $oltimeadd1 = ', o.thismonth AS thismonthol, o.total AS totalol'; $oltimeadd2 = "LEFT JOIN {$tablepre}onlinetime o ON o.uid=m.uid"; } else { $oltimeadd1 = $oltimeadd2 = ''; } $member = $db->fetch_first("SELECT m.*, mf.*, u.grouptitle, u.type, u.creditshigher, u.creditslower, u.readaccess,\r\n\t\tu.color AS groupcolor, u.stars AS groupstars, u.allownickname, u.allowuseblog, r.ranktitle,\r\n\t\tr.color AS rankcolor, r.stars AS rankstars {$oltimeadd1}\r\n\t\tFROM {$tablepre}members m\r\n\t\tLEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid\r\n\t\tLEFT JOIN {$tablepre}usergroups u ON u.groupid=m.groupid\r\n\t\tLEFT JOIN {$tablepre}ranks r ON m.posts>=r.postshigher\r\n\t\t{$oltimeadd2}\r\n\t\tWHERE " . ($uid ? "m.uid='{$uid}'" : "m.username='******'") . "ORDER BY r.postshigher DESC LIMIT 1"); if (!$member) { showmessage('member_nonexistence'); } $uid = $member['uid']; $member['online'] = $db->result_first("SELECT lastactivity FROM {$tablepre}sessions WHERE uid='{$uid}' AND invisible='0'"); if ($member['groupid'] != ($member['groupidnew'] = getgroupid($member['uid'], $member, $member))) { $member = array_merge($member, $db->fetch_first("SELECT groupid, grouptitle, type, creditshigher, creditslower, color AS groupcolor,\r\n\t\tstars AS groupstars, allownickname, allowuseblog\r\n\t\tFROM {$tablepre}usergroups WHERE groupid='{$member['groupidnew']}'")); } $viewspace = !$inajax && $spacestatus && (!$supe['status'] || !$member['xspacestatus']) && !in_array($member['groupid'], array(4, 5, 6)); if ($viewspace) { include_once DISCUZ_ROOT . './include/space.func.php'; if (!($spacesettings = getspacesettings($member['uid']))) { dheader("location: {$boardurl}"); } include_once language('spaces'); $modulelist = explode('][', ']' . str_replace("\t", '', $spacesettings['layout']) . '['); foreach ($modulelist as $module) { if (array_key_exists($module, $listmodule)) { $menulist[$listmodule[$module]] = $module; } }
function viewthread_procpost($post, $special = 0) { global $_DCACHE, $newpostanchor, $numpost, $thisbg, $postcount, $ratelogpids, $onlineauthors, $lastvisit, $thread, $attachpids, $attachtags, $forum, $dateformat, $timeformat, $timeoffset, $userstatusby, $allowgetattach, $ratelogrecord, $showimages, $forum, $discuz_uid, $showavatars, $pagebydesc, $ppp, $ppp2, $ppp3, $firstpid, $videoopen, $threadpay, $sigviewcond; if (!$newpostanchor && $post['dateline'] > $lastvisit) { $post['newpostanchor'] = '<a name="newpost"></a>'; $newpostanchor = 1; } else { $post['newpostanchor'] = ''; } $post['lastpostanchor'] = $numpost == $thread['replies'] ? '<a name="lastpost"></a>' : ''; if ($pagebydesc) { $post['number'] = $numpost + $ppp2--; $post['count'] = $ppp == $ppp3 ? $ppp - $postcount - 1 : $ppp3 - $postcount - 1; } else { $post['number'] = ++$numpost; $post['count'] = $postcount; } $postcount++; $post['dbdateline'] = $post['dateline']; $post['dateline'] = dgmdate("{$dateformat} {$timeformat}", $post['dateline'] + $timeoffset * 3600); $post['groupid'] = $_DCACHE['usergroups'][$post['groupid']] ? $post['groupid'] : 7; if ($post['username']) { $onlineauthors[] = $post['authorid']; $post['usernameenc'] = rawurlencode($post['username']); !$special && ($post['groupid'] = getgroupid($post['authorid'], $_DCACHE['usergroups'][$post['groupid']], $post)); $post['readaccess'] = $_DCACHE['usergroups'][$post['groupid']]['readaccess']; if ($_DCACHE['usergroups'][$post['groupid']]['userstatusby'] == 1) { $post['authortitle'] = $_DCACHE['usergroups'][$post['groupid']]['grouptitle']; $post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars']; } elseif ($_DCACHE['usergroups'][$post['groupid']]['userstatusby'] == 2) { foreach ($_DCACHE['ranks'] as $rank) { if ($post['posts'] > $rank['postshigher']) { $post['authortitle'] = $rank['ranktitle']; $post['stars'] = $rank['stars']; break; } } } $post['taobaoas'] = addslashes($post['taobao']); $post['authoras'] = !$post['anonymous'] ? ' ' . addslashes($post['author']) : ''; $post['regdate'] = gmdate($dateformat, $post['regdate'] + $timeoffset * 3600); $post['lastdate'] = gmdate($dateformat, $post['lastactivity'] + $timeoffset * 3600); if ($post['medals']) { @(include_once DISCUZ_ROOT . './forumdata/cache/cache_medals.php'); foreach ($post['medals'] = explode("\t", $post['medals']) as $key => $medalid) { list($medalid, $medalexpiration) = explode("|", $medalid); if (isset($_DCACHE['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > $timestamp)) { $post['medals'][$key] = $_DCACHE['medals'][$medalid]; } else { unset($post['medals'][$key]); } } } if ($showavatars) { $post['avatar'] = discuz_uc_avatar($post['authorid']); if ($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) { $post['avatar'] .= '<br /><img src="' . $_DCACHE['usergroups'][$post['groupid']]['groupavatar'] . '" border="0" alt="" />'; } } else { $post['avatar'] = ''; } $post['status'] = sprintf('%b', $post['status']); $post['banned'] = substr($post['status'], -1, 1); $post['warned'] = substr($post['status'], -2, 1); $post['msn'] = explode("\t", $post['msn']); } else { if (!$post['authorid']) { $post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')) . '.x'; } } $post['attachments'] = array(); if ($post['attachment']) { if ($allowgetattach && !$threadpay) { $attachpids .= ",{$post['pid']}"; $post['attachment'] = 0; if (preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $post['message'], $matchaids)) { $attachtags[$post['pid']] = $matchaids[1]; } } else { $post['message'] = preg_replace("/\\[attach\\](\\d+)\\[\\/attach\\]/i", '', $post['message']); } } $ratelogpids .= $ratelogrecord && $post['rate'] ? ',' . $post['pid'] : ''; $forum['allowbbcode'] = $forum['allowbbcode'] ? $_DCACHE['usergroups'][$post['groupid']]['allowcusbbcode'] ? 2 : 1 : 0; $post['signature'] = $post['usesig'] ? $sigviewcond ? strlen($post['message']) > $sigviewcond ? $post['signature'] : '' : $post['signature'] : ''; $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $forum['allowsmilies'], $forum['allowbbcode'], $forum['allowimgcode'] && $showimages ? 1 : 0, $forum['allowhtml'], $forum['jammer'] && $post['authorid'] != $discuz_uid ? 1 : 0, 0, $post['authorid'], $forum['allowmediacode'], $post['pid']); $videoopen && ($post['message'] = videocode($post['message'], $post['tid'], $post['pid'])); $post['first'] && ($firstpid = $post['pid']); $firstpid = intval($firstpid); return $post; }
} $setarr = array('name' => getstr($_POST['name'], 20, 1, 1), 'namestatus' => intval($_POST['namestatus']), 'domain' => trim($_POST['domain']), 'addsize' => intval($_POST['addsize']) * 1024 * 1024, 'credit' => intval($_POST['credit'])); //删除保护 include_once S_ROOT . './uc_client/client.php'; if ($_POST['flag'] == 1) { $result = uc_user_addprotected(array($member['username']), $_SGLOBAL['supe_username']); } else { $_POST['flag'] = 0; $result = uc_user_deleteprotected(array($member['username']), $_SGLOBAL['supe_username']); } if ($result) { $setarr['flag'] = $_POST['flag']; } if ($uid != $_SGLOBAL['supe_uid'] || ckfounder($_SGLOBAL['supe_uid'])) { if (empty($_POST['groupid'])) { $_POST['groupid'] = getgroupid($_POST['credit'], 0); } $setarr['groupid'] = intval($_POST['groupid']); } updatetable('space', $setarr, array('uid' => $uid)); //附属表 $setarr = array('email' => getstr($_POST['email'], 100, 1, 1), 'emailcheck' => intval($_POST['emailcheck']), 'qq' => getstr($_POST['qq'], 20, 1, 1), 'msn' => getstr($_POST['msn'], 80, 1, 1), 'sex' => intval($_POST['sex']), 'birthyear' => intval($_POST['birthyear']), 'birthmonth' => intval($_POST['birthmonth']), 'birthday' => intval($_POST['birthday']), 'blood' => getstr($_POST['blood'], 5, 1, 1), 'marry' => intval($_POST['marry']), 'birthprovince' => getstr($_POST['birthprovince'], 20, 1, 1), 'birthcity' => getstr($_POST['birthcity'], 20, 1, 1), 'resideprovince' => getstr($_POST['resideprovince'], 20, 1, 1), 'residecity' => getstr($_POST['residecity'], 20, 1, 1)); foreach ($profilefields as $field => $value) { if ($value['formtype'] == 'select') { $value['maxsize'] = 255; } $setarr['field_' . $field] = getstr($_POST['field_' . $field], $value['maxsize'], 1, 1); } //清空 if ($_POST['clearcss']) { $setarr['css'] = '';
function deleteinfo($ids) { global $_SGLOBAL; include_once S_ROOT . './source/function_delete.php'; $deltype = array(); $reportuser = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('report') . " WHERE rid IN (" . simplode($ids) . ")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['user'] = unserialize($value['uids']); $reportuser[] = array_shift(array_flip($value['user'])); $deltype[$value['idtype']][] = $value['id']; } $gid = getgroupid($_SGLOBAL['member']['experience'], $_SGLOBAL['member']['groupid']); //Perform the corresponding delete operations $i = 0; $_SGLOBAL['usergroup'][$gid]['managebatch'] = 1; foreach ($deltype as $key => $value) { switch ($key) { case 'blogid': $_SGLOBAL['usergroup'][$gid]['manageblog'] = 1; deleteblogs($value); break; case 'picid': $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1; deletepics($value); break; case 'albumid': $_SGLOBAL['usergroup'][$gid]['managealbum'] = 1; deletealbums($value); break; case 'tid': $_SGLOBAL['usergroup'][$gid]['managethread'] = 1; deletethreads(0, $value); break; case 'tagid': $_SGLOBAL['usergroup'][$gid]['managemtag'] = 1; deletemtag($value); break; case 'sid': $_SGLOBAL['usergroup'][$gid]['manageshare'] = 1; deleteshares($value); break; case 'uid': $_SGLOBAL['usergroup'][$gid]['managedelspace'] = 1; foreach ($value as $uid) { deletespace($uid); } break; case 'eventid': $_SGLOBAL['usergroup'][$gid]['manageevent'] = 1; deleteevents($value); break; case 'pid': $_SGLOBAL['usergroup'][$gid]['managepoll'] = 1; deletepolls($value); break; case 'comment': $_SGLOBAL['usergroup'][$gid]['managecomment'] = 1; deletecomments($value); break; case 'post': $_SGLOBAL['usergroup'][$gid]['managethread'] = 1; deleteposts(0, $value); break; } //The first reporter award getreward('report', 1, $reportuser[$i], '', 0); $i++; } }
//评论 $list = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('post') . " WHERE {$pidsql} uid='{$_SGLOBAL['supe_uid']}' ORDER BY dateline DESC LIMIT 0,1"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { realname_set($value['uid'], $value['username']); $list[] = $value; } realname_get(); } elseif ($op == 'credit') { $uid = empty($_GET['uid']) ? 0 : intval($_GET['uid']); include_once S_ROOT . './data/data_usergroup.php'; $space = getspace($uid); if (empty($space)) { showmessage('space_does_not_exist'); } $gid = getgroupid($space['credit'], $space['groupid']); if ($gid != $space['groupid']) { //需要升级 updatetable('space', array('groupid' => $gid), array('uid' => $space['uid'])); $space['groupid'] = $gid; } $space['haveattachsize'] = ''; if ($space['self']) { $maxattachsize = intval(checkperm('maxattachsize')); //单位MB if ($maxattachsize) { //0为不限制 $space['haveattachsize'] = $maxattachsize + $space['addsize'] - $space['attachsize']; $space['haveattachsize'] = formatsize($space['haveattachsize']); } }
function viewthread_procpost($post, $lastvisit, $ordertype, $special = 0) { global $_G; 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 ($_G['forum_pagebydesc']) { if ($ordertype != 1) { $post['number'] = $_G['forum_numpost'] + $_G['forum_ppp2']--; } else { $post['number'] = $post['first'] == 1 ? 1 : $_G['forum_numpost'] - $_G['forum_ppp2']--; } $post['count'] = $_G['ppp'] == $_G['forum_ppp3'] ? $_G['ppp'] - $_G['forum_postcount'] - 1 : $_G['forum_ppp3'] - $_G['forum_postcount'] - 1; } else { if ($ordertype != 1) { $post['number'] = ++$_G['forum_numpost']; } else { $post['number'] = $post['first'] == 1 ? 1 : --$_G['forum_numpost']; } $post['count'] = $_G['forum_postcount']; } $_G['forum_postcount']++; $post['dbdateline'] = $post['dateline']; $post['dateline'] = dgmdate($post['dateline'], 'u'); $post['groupid'] = $_G['cache']['usergroups'][$post['groupid']] ? $post['groupid'] : 7; if ($post['username']) { $_G['forum_onlineauthors'][] = $post['authorid']; $post['usernameenc'] = rawurlencode($post['username']); !$special && ($post['groupid'] = getgroupid($post['authorid'], $_G['cache']['usergroups'][$post['groupid']], $post)); $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['taobaoas'] = addslashes($post['taobao']); $post['regdate'] = dgmdate($post['regdate'], 'd'); $post['lastdate'] = dgmdate($post['lastactivity'], '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]; } else { unset($post['medals'][$key]); } } } $post['avatar'] = discuz_uc_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'] = ''; if ($post['attachment']) { if ($_G['group']['allowgetattach']) { $_G['forum_attachpids'] .= ",{$post['pid']}"; $post['attachment'] = 0; if (preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $post['message'], $matchaids)) { $_G['forum_attachtags'][$post['pid']] = $matchaids[1]; } } else { $post['message'] = preg_replace("/\\[attach\\](\\d+)\\[\\/attach\\]/i", '', $post['message']); } } $_G['forum_ratelogpid'] .= $_G['setting']['ratelogrecord'] && $post['ratetimes'] ? ',' . $post['pid'] : ''; if ($_G['setting']['commentnumber'] && ($post['first'] && $_G['setting']['commentfirstpost'] || !$post['first'])) { $_G['forum_commonpid'] .= $post['comment'] ? ',' . $post['pid'] : ''; } $post['allowcomment'] = $_G['setting']['commentnumber'] && ($_G['setting']['commentpostself'] || $post['authorid'] != $_G['uid']) && ($post['first'] && $_G['setting']['commentfirstpost'] && in_array($_G['group']['allowcommentpost'], array(1, 3)) || !$post['first'] && in_array($_G['group']['allowcommentpost'], array(2, 3))); $_G['forum']['allowbbcode'] = $_G['forum']['allowbbcode'] ? $_G['cache']['usergroups'][$post['groupid']]['allowcusbbcode'] ? 2 : 1 : 0; $post['signature'] = $post['usesig'] ? $_G['setting']['sigviewcond'] ? strlen($post['message']) > $_G['setting']['sigviewcond'] ? $post['signature'] : '' : $post['signature'] : ''; $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0, $_G['forum']['allowhtml'], $_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0, 0, $post['authorid'], $_G['forum']['allowmediacode'], $post['pid']); $post['first'] && ($_G['forum_firstpid'] = $post['pid']); $_G['forum_firstpid'] = intval($_G['forum_firstpid']); return $post; }
function checkperm($permtype) { global $_SGLOBAL, $space; @(include_once S_ROOT . './data/data_usergroup.php'); //升级身份 if (empty($_SGLOBAL['supe_uid'])) { return ''; } else { if (empty($_SGLOBAL['member'])) { //获取当前人 getmember(); } $gid = getgroupid($_SGLOBAL['member']['credit'], $_SGLOBAL['member']['groupid']); if ($gid != $_SGLOBAL['member']['groupid']) { //需要升级 updatetable('space', array('groupid' => $gid), array('uid' => $_SGLOBAL['supe_uid'])); } } if ($permtype == 'admin') { $permtype = 'manageconfig'; } return empty($_SGLOBAL['usergroup'][$gid][$permtype]) ? '' : $_SGLOBAL['usergroup'][$gid][$permtype]; }