function __construct($kptime = -1) { $this->keeptime = $kptime; $this->db = $GLOBALS['dsql']; $this->uid = $this->GetNum(GetCookie("UserId")); $this->username = GetCookie("UserName"); $this->logintime = GetCookie("LoginTime"); }
/** * 列出某一频道下的所有栏目 * * @access public * @param string $channel 频道ID * @return void */ function ListAllType($channel = 0) { global $cfg_admin_channel, $admin_catalogs, $targetid, $oldvalue; $oldvalues = array(); if (!empty($oldvalue)) { $oldvalues = explode(',', $oldvalue); } //检测用户有权限的顶级栏目 if ($cfg_admin_channel == 'array') { $admin_catalog = join(',', $admin_catalogs); $this->dsql->SetQuery("SELECT reid FROM `#@__arctype` WHERE id IN({$admin_catalog}) GROUP BY reid "); $this->dsql->Execute(); $topidstr = ''; while ($row = $this->dsql->GetObject()) { if ($row->reid == 0) { continue; } $topidstr .= $topidstr == '' ? $row->reid : ',' . $row->reid; } $admin_catalog .= ',' . $topidstr; $admin_catalogs = explode(',', $admin_catalog); $admin_catalogs = array_unique($admin_catalogs); } $this->dsql->SetQuery("SELECT id,typedir,typename,ispart,channeltype FROM `#@__arctype` WHERE reid=0 ORDER BY sortrank"); $this->dsql->Execute(0); $lastid = GetCookie('lastCidMenu'); while ($row = $this->dsql->GetObject(0)) { if ($cfg_admin_channel == 'array' && !in_array($row->id, $admin_catalogs)) { continue; } $typeDir = $row->typedir; $typeName = $row->typename; $ispart = $row->ispart; $id = $row->id; $channeltype = $row->channeltype; $ischeck = in_array($id, $oldvalues) ? ' checked' : ''; $chackRadio = "<input type='radio' name='seltypeid' value='{$id}' {$ischeck} />"; if ($targetid == 'typeid2') { $chackRadio = "<input type='checkbox' name='seltypeid' id='seltypeid{$id}' value='{$id}' {$ischeck} />"; } if (!empty($channel) && $channeltype != $channel || $ispart != 0) { $chackRadio = ''; } $soncat = ''; $this->LogicListAllSunType($id, $channel, $soncat); if ($chackRadio == '' && $soncat == '') { continue; } echo "<div class='quickselItem'>\r\n"; echo " <div class='topcat'>{$chackRadio}{$typeName}</div>\r\n"; if ($soncat != '') { echo " <div class='soncat'>{$soncat}</div>\r\n"; } echo "</div>\r\n"; } }
function ListAllType($channel = 0, $nowdir = 0) { global $cfg_admin_channel, $admin_catalogs; //检测用户有权限的顶级栏目 if ($cfg_admin_channel == 'array') { $admin_catalog = join(',', $admin_catalogs); $this->dsql->SetQuery("Select reid From `#@__arctype` where id in({$admin_catalog}) group by reid "); $this->dsql->Execute(); $topidstr = ''; while ($row = $this->dsql->GetObject()) { if ($row->reid == 0) { continue; } $topidstr .= $topidstr == '' ? $row->reid : ',' . $row->reid; } $admin_catalog .= ',' . $topidstr; $admin_catalogs = explode(',', $admin_catalog); $admin_catalogs = array_unique($admin_catalogs); } $this->dsql->SetQuery("Select id,typedir,typename,ispart,channeltype From `#@__arctype` where reid=0 order by sortrank"); $this->dsql->Execute(0); $lastid = GetCookie('lastCidMenu'); while ($row = $this->dsql->GetObject(0)) { if ($cfg_admin_channel == 'array' && !in_array($row->id, $admin_catalogs)) { continue; } $typeDir = $row->typedir; $typeName = $row->typename; $ispart = $row->ispart; $id = $row->id; $channeltype = $row->channeltype; //普通栏目 if ($ispart == 0) { $smenu = " oncontextmenu=\"CommonMenu(event,this,{$id},'" . urlencode($typeName) . "')\""; } else { if ($ispart == 1) { $smenu = " oncontextmenu=\"CommonMenuPart(event,this,{$id},'" . urlencode($typeName) . "')\""; } else { continue; $smenu = " oncontextmenu=\"JumpMenu(event,this,{$id},'" . urlencode($typeName) . "')\" "; } } echo "<dl class='topcc'>\r\n"; echo " <dd class='dlf'><img style='cursor:pointer' onClick=\"LoadSuns('suns{$id}',{$id});\" src='img/tree_explode.gif' width='11' height='11'></dd>\r\n"; echo " <dd class='dlr'><a href='catalog_do.php?cid=" . $id . "&dopost=listArchives'{$smenu}>" . $typeName . "</a></dd>\r\n"; echo "</dl>\r\n"; echo "<div id='suns" . $id . "' class='sunct'>"; if ($lastid == $id || $cfg_admin_channel == 'array') { $this->LogicListAllSunType($id, " "); } echo "</div>\r\n"; } }
function CreateUserMenu() { global $db, $language; $menu_base = array($language['header']['menu_home'] => 'index.php'); $menu_guest = array($language['header']['menu_login'] => 'index.php?page=login', $language['header']['menu_register'] => 'index.php?page=register'); $menu_user = array($language['header']['menu_profile'] => 'index.php?page=profile', $language['header']['menu_search'] => 'index.php?page=search', $language['header']['menu_logout'] => 'index.php?page=logout'); if (!GetCookie('hbb')) { $menu = array_merge($menu_base, $menu_guest); } else { $menu = array_merge($menu_base, $menu_user); } return $menu; }
function forumcheck($user, $groupid) { if ($this->foruminfo['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) { Showmsg('forum_former'); } $pwdcheck = GetCookie('pwdcheck'); if ($this->foruminfo['password'] != '' && ($groupid == 'guest' || $pwdcheck[$this->fid] != $this->foruminfo['password'] && !S::inArray($user['username'], $GLOBALS['manager']))) { require_once R_P . 'require/forumpassword.php'; } if (!$this->allowvisit($user, $groupid)) { Showmsg('forum_jiami'); } if (!$this->foruminfo['cms'] && $this->foruminfo['f_type'] == 'hidden' && !$this->foruminfo['allowvisit']) { Showmsg('forum_hidden'); } }
/** *取得用户数据 **/ function PassportUserdb() { global $db, $timestamp, $webdb, $onlineip, $TB, $pre, $db_ifsafecv, $userDB; list($lfjuid, $lfjpwd, $safecv) = explode("\t", StrCode(GetCookie('winduser'), 'DECODE')); if (!$lfjuid || !$lfjpwd) { return ''; } if ($db_ifsafecv) { $SQL = ",M.safecv"; } $detail = $userDB->get_allInfo($lfjuid); if (PwdCode($detail[password]) != $lfjpwd || $db_ifsafecv && $safecv != $detail['safecv']) { return; } return $detail; }
function forumcheck($user, $groupid) { if ($this->foruminfo['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) { Showmsg('forum_former'); } if (!empty($this->foruminfo['style']) && file_exists(D_P . "data/style/{$this->foruminfo[style]}.php")) { $GLOBALS['skin'] = $this->foruminfo['style']; } $pwdcheck = GetCookie('pwdcheck'); if ($this->foruminfo['password'] != '' && ($groupid == 'guest' || $pwdcheck[$this->fid] != $this->foruminfo['password'] && !CkInArray($user['username'], $GLOBALS['manager']))) { require_once R_P . 'require/forumpw.php'; } if (!$this->allowvisit($user, $groupid)) { Showmsg('forum_jiami'); } if (!$this->foruminfo['cms'] && $this->foruminfo['f_type'] == 'hidden' && !$this->foruminfo['allowvisit']) { Showmsg('forum_hidden'); } }
function wind_forumcheck($forum) { global $windid, $groupid, $tid, $fid, $skin, $winddb, $manager; if ($forum['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) { Showmsg('forum_former'); } if (!empty($forum['style']) && file_exists(D_P . "data/style/{$forum['style']}.php")) { $skin = $forum['style']; } $pwdcheck = GetCookie('pwdcheck'); if ($forum['password'] != '' && ($groupid == 'guest' || $pwdcheck[$fid] != $forum['password'] && !CkInArray($windid, $manager))) { require_once R_P . 'require/forumpw.php'; } if ($forum['allowvisit'] && !allowcheck($forum['allowvisit'], $groupid, $winddb['groups'], $fid, $winddb['visit'])) { Showmsg('forum_jiami'); } if (!$forum['cms'] && $forum['f_type'] == 'hidden' && !$forum['allowvisit']) { Showmsg('forum_hidden'); } }
function addonlinefile($offset, $uid) { global $windid, $groupid, $lastvisit, $timestamp, $onlineip, $db_onlinetime, $fid, $tid, $wind_in, $tdtime, $db_olsize, $db_today; if (strlen($fid) > 4) { $fidwt = ''; } else { $fidwt = $fid; } if (strlen($tid) > 7) { $tidwt = ''; } else { $tidwt = $tid; } $wherebbsyou = getuseraction($fid, $wind_in); $acttime = get_date($timestamp, 'm-d H:i'); $D_name = "data/bbscache/online.php"; if (!file_exists(D_P . $D_name)) { pwCache::writeover(D_P . $D_name, str_pad("<?php die;?>", 96) . "\n"); } if (GetCookie('hideid') != 1) { $newonline = "{$windid}\t{$timestamp}\t{$onlineip}\t{$fidwt}\t{$tidwt}\t{$groupid}\t{$wherebbsyou}\t{$acttime}\t{$uid}\t"; $newonline = str_pad($newonline, $db_olsize) . "\n"; if (checkinline(D_P . $D_name, $offset, $windid)) { $isModify = 0; writeinline(D_P . $D_name, $newonline, $offset); } else { list($offset, $isModify) = GetInsertOffset(D_P . $D_name); writeinline(D_P . $D_name, $newonline, $offset); } if ($db_today && $timestamp - $lastvisit > $db_onlinetime) { require_once R_P . 'require/today.php'; } } elseif (GetCookie('hideid') == 1) { require_once R_P . 'require/hidden.php'; } if ($isModify === 1) { //频度可控制性 ModifySelectFile(D_P . "data/bbscache/guest.php"); } return array($offset, $isModify); }
function ListAllType($nowdir=0,$issend=-1,$opall=false,$channelid=0) { if(!is_object($this->dsql)){ $this->dsql = new DedeSql(false); } $this->dsql->SetQuery("Select ID,typedir,typename,ispart,channeltype,issend From #@__arctype where reID=0 order by sortrank"); $this->dsql->Execute(0); $lastID = GetCookie('lastCidTree'); while($row=$this->dsql->GetObject(0)) { $typeDir = $row->typedir; $typeName = $row->typename; $ispart = $row->ispart; $ID = $row->ID; $dcid = $row->channeltype; $dissend = $row->issend; if($ispart>=2||TestHasChannel($ID,$channelid,$issend)==0) continue; if($ispart==0 || ($ispart==1 && $opall)) {//普通列表 if(($channelid==0 || $channelid==$dcid) && ($issend!=1 || $dissend==1)) { $smenu = " <input type='checkbox' name='selid' id='selid$ID' class='np' onClick=\"ReSel($ID,'$typeName')\"> "; }else{ $smenu = "[×]"; } }else if($ispart==1) {//带封面的频道 $smenu = "[封面]"; } echo "<dl class='topcc'>\n"; echo "<dd><img style='cursor:hand' onClick=\"LoadSuns('suns{$ID}',{$ID},{$channelid});\" src='img/tree_explode.gif' width='11' height='11'> $typeName{$smenu}</dd>\n"; echo "</dl>\n"; echo "<div id='suns".$ID."' class='sunct'>"; if($lastID==$ID){ $this->LogicListAllSunType($ID," ",$opall,$issend,$channelid); } echo "</div>\r\n"; } }
function Loginout() { global $db, $timestamp, $db_onlinetime, $groupid, $windid, $winduid, $db_ckpath, $db_ckdomain, $db_online; $thisvisit = $timestamp - $db_onlinetime * 1.5; $db->update('UPDATE pw_memberdata SET thisvisit=' . pwEscape($thisvisit) . ' WHERE uid=' . pwEscape($winduid)); /*update cache*/ $_cache = getDatastore(); $_cache->delete("UID_" . $winduid); list($db_ckpath, $db_ckdomain) = explode("\t", GetCookie('ck_info')); Cookie('winduser', '', 0); Cookie('hideid', '', 0); Cookie('lastvisit', '', 0); $pwdcheck = GetCookie('pwdcheck'); if (is_array($pwdcheck)) { foreach ($pwdcheck as $key => $value) { Cookie("pwdcheck[{$key}]", '', 0); } } Cookie('ck_info', '', 0); Cookie('msghide', '', 0, false); $windid = $winduid = ''; }
function Loginout() { global $db, $timestamp, $db_onlinetime, $groupid, $windid, $winduid, $db_ckpath, $db_ckdomain, $db_online; $thisvisit = $timestamp - $db_onlinetime * 1.5; $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $userService->update($winduid, array(), array('thisvisit' => $thisvisit)); /*update cache*/ //* $_cache = getDatastore(); //* $_cache->delete("UID_".$winduid); list($db_ckpath, $db_ckdomain) = explode("\t", GetCookie('ck_info')); Cookie('winduser', '', 0); Cookie('hideid', '', 0); Cookie('lastvisit', '', 0); $pwdcheck = GetCookie('pwdcheck'); if (is_array($pwdcheck)) { foreach ($pwdcheck as $key => $value) { Cookie("pwdcheck[{$key}]", '', 0); } } Cookie('ck_info', '', 0); Cookie('msghide', '', 0, false); $windid = $winduid = ''; }
list(, $userinbbs, $guestinbbs) = $online_info; } else { $onlineService = L::loadClass('OnlineService', 'user'); $userinbbs = $onlineService->countOnlineUser(); $guestinbbs = $onlineService->countOnlineGuest(); Cookie('online_info', $timestamp . "\t" . $userinbbs . "\t" . $guestinbbs); } } if ($last_statistictime == 0 || get_date($timestamp, 'G') - get_date($last_statistictime, 'G') > 1 || $timestamp - $last_statistictime > 3600) { $stasticsService = L::loadClass('Statistics', 'datanalyse'); $stasticsService->updateOnlineInfo(); } $usertotal = $guestinbbs + $userinbbs; if ($db_indexonline) { S::gp(array('online')); empty($online) && ($online = GetCookie('online')); if ($online == 'yes') { if ($usertotal > 2000 && !S::inArray($windid, $manager)) { //$online = 'no'; Cookie('online', 'no'); } else { $index_whosonline = ''; $db_online = intval($db_online); Cookie('online', $online); include_once S::escapePath(R_P . "require/online_{$db_online}.php"); } } if ($online == 'no') { Cookie('online', 'no'); } }
<?php !function_exists('readover') && exit('Forbidden'); /*The app client*/ if ($db_siteappkey && ($db_apps_list['17']['status'] == 1 || is_array($db_threadconfig))) { $appclient = L::loadClass('appclient'); if (is_array($db_threadconfig)) { $threadright = array(); $threadright = $appclient->getThreadRight(); } } /*The app client*/ $newpic = (int) GetCookie('newpic'); $query = $db->query("SELECT f.fid,f.logo,f.name, f.descrip,f.forumadmin,f.password,f.allowvisit,f.f_type,f.ifcms,fd.tpost,fd.topic,fd.article,fd.subtopic,fd.lastpost FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.fup=" . S::sqlEscape($fid) . "ORDER BY f.vieworder"); while ($child = $db->fetch_array($query)) { if (empty($child['allowvisit']) || strpos($child['allowvisit'], ',' . $groupid . ',') !== false) { list($f_a, $child['au'], $f_c, $child['ft']) = explode("\t", $child['lastpost']); $child['pic'] = $newpic < $f_c && $f_c + 172800 > $timestamp ? 'new' : 'old'; $child['newtitle'] = get_date($f_c); $child['t'] = substrs($f_a, 21); } else { if ($child['f_type'] === 'hidden') { continue; } $child['pic'] = "lock"; } $child['topics'] = $child['topic'] + $child['subtopic']; if ($db_indexfmlogo == 1 && file_exists("{$imgdir}/{$stylepath}/forumlogo/{$child['fid']}.gif")) { $child['logo'] = "{$imgpath}/{$stylepath}/forumlogo/{$child['fid']}.gif"; } elseif ($db_indexfmlogo == 2) { if (!empty($child['logo']) && strpos($child['logo'], 'http://') === false) {
} else { Showmsg('ban_info2'); } } } } if (GetCookie('force') && $winduid != GetCookie('force')) { $force = GetCookie('force'); $bandb = $db->get_one('SELECT type FROM pw_banuser WHERE uid=' . pwEscape($force) . ' AND fid=0'); if ($bandb['type'] == 3) { Showmsg('ban_info3'); } else { Cookie('force', '', 0); } } $userlastptime = $groupid != 'guest' ? $winddb['lastpost'] : GetCookie('userlastptime'); $tdtime >= $winddb['lastpost'] && ($winddb['todaypost'] = 0); $montime >= $winddb['lastpost'] && ($winddb['monthpost'] = 0); if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) { Showmsg('post_gp_limit'); } list(, , $postq) = explode("\t", $db_qcheck); InitGP(array('action')); if ($action == 'modify') { InitGP(array('pid', 'article')); require_once R_P . 'lib/postmodify.class.php'; if ($pid && is_numeric($pid)) { $postmodify = new replyModify($tid, $pid, $pwpost); } else { $postmodify = new topicModify($tid, 0, $pwpost); }
function banUser() { global $db, $groupid, $winduid, $timestamp; if ($groupid == 6) { $mainFields = array(); $flag = 0; $bandb = $delban = array(); $query = $db->query("SELECT * FROM pw_banuser WHERE uid=" . S::sqlEscape($winduid) . " AND fid='0'"); while ($rt = $db->fetch_array($query)) { if ($rt['type'] == 1 && $timestamp - $rt['startdate'] > $rt['days'] * 86400) { $delban[] = $rt['id']; } else { $bandb = $rt; } } $delban && $db->update('DELETE FROM pw_banuser WHERE id IN(' . S::sqlImplode($delban) . ')'); $groupid == 6 && !isset($bandb) && ($mainFields['groupid'] = -1); if ($mainFields) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $userService->update($winduid, $mainFields); //* $_cache = getDatastore(); //* $_cache->delete('UID_'.$winduid); } if ($bandb) { if ($bandb['type'] == 1) { global $s_date, $e_date; $s_date = get_date($bandb['startdate']); $e_date = $bandb['startdate'] + $bandb['days'] * 86400; $e_date = get_date($e_date); Showmsg('ban_info1'); } else { if ($bandb['type'] == 3) { Cookie('force', $winduid); Showmsg('ban_info3'); } else { Showmsg('ban_info2'); } } } } if (GetCookie('force') && $winduid != GetCookie('force')) { $force = GetCookie('force'); $bandb = $db->get_one("SELECT type FROM pw_banuser WHERE uid=" . S::sqlEscape($force) . " AND fid='0'"); if ($bandb['type'] == 3) { Showmsg('ban_info3'); } else { Cookie('force', '', 0); } } /** * 需要验证用户只有通过管理员验证后才能发帖 */ if ($groupid == '7') { Showmsg('reg_check'); } }
function GdConfirm($code, $t = 1) { Cookie('cknum', '', 0); if (!$code || !SafeCheck(explode("\t", StrCode(GetCookie('cknum'), 'DECODE')), strtoupper($code), 'cknum', 300)) { global $basename, $admin_file; $t && Cookie('AdminUser', '', 0); $basename = $admin_file; adminmsg('check_error'); } }
$type = 'flash'; break; case 'rm': $height = 256; $type = 'rm'; break; default: Showmsg('undefined_action'); } echo "ok\t{$a_url['0']}\t{$width}\t{$height}\t{$type}"; ajax_footer(); } elseif ($action == 'getverify') { echo $verifyhash . "\t" . GetVerify($onlineip . $winddb['regdate'] . $fid . $tid); ajax_footer(); } elseif ($action == 'changestate') { if (GetCookie('hideid') == '1') { Cookie('hideid', '', 0); echo "0"; ajax_footer(); } else { Cookie('hideid', '1'); echo "1"; ajax_footer(); } } elseif ($action == 'changeeditor') { InitGP(array('editor')); if ($editor != getstatus($winddb['userstatus'], 11)) { $ustatus = 'userstatus=userstatus' . ($editor ? '|' : '&~') . '(1<<10)'; $db->update("UPDATE pw_members SET {$ustatus} WHERE uid=" . pwEscape($winduid)); } } elseif ($action == 'pwb_friend') {
$newSpace->initSet(); $indexRight = $newSpace->viewRight('index'); $indexValue = $newSpace->getPrivacyByKey('index'); if ($indexRight) { $data = $newSpace->layout(); //var_dump($data); } else { $data = array(0 => $newSpace->getSpaceData(array('info' => 1))); } $siteName = getSiteName('o'); $uSeo = USeo::getInstance(); $uSeo->set($space['name'] . ' - ' . $siteName, $space['name'], $space['name'] . ',' . $siteName); if ($winduid && !$space['isMe']) { //邀请处理 if (GetCookie('o_invite') && $db_modes['o']['ifopen'] == 1) { list($o_u, $hash, $app) = explode("\t", GetCookie('o_invite')); if (is_numeric($o_u) && strlen($hash) == 18) { require_once R_P . 'require/o_invite.php'; } } $visitors = unserialize($space['visitors']); is_array($visitors) || ($visitors = array()); if (!isset($visitors[$winduid]) || $timestamp - $visitors[$winduid] > 900) { $visitors[$winduid] = $timestamp; arsort($visitors); if (count($visitors) > 12) { array_pop($visitors); } $db->pw_update("SELECT uid FROM pw_space WHERE uid=" . S::sqlEscape($uid), pwQuery::buildClause("UPDATE :pw_table SET visits=visits+1,visitors=:visitors WHERE uid=:uid", array('pw_space', serialize($visitors), intval($uid))), pwQuery::insertClause('pw_space', array('uid' => $uid, 'visits' => 1, 'visitors' => serialize($visitors)))); } if (perf::checkMemcache()) {
$readdb[] = $read; } $toread && ($urladd .= "&toread={$toread}"); $fpage > 1 && ($urladd .= "&fpage={$fpage}"); $pages = numofpage($count + $topped_count, $page, $numofpage, "read.php?tid={$tid}{$urladd}{$viewbbs}&"); $tpc_locked = $read['locked'] % 3 != 0 ? 1 : 0; //更新帖子点击 if ($db_hits_store == 0) { pwQuery::update('pw_threads', 'tid=:tid', array($tid), null, array(PW_EXPR => array('hits=hits+1'))); } elseif ($db_hits_store == 1) { $db->update('UPDATE pw_hits_threads SET hits=hits+1 WHERE tid=' . S::sqlEscape($tid)); } elseif ($db_hits_store == 2) { pwCache::writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab'); } //帖子浏览记录 $readlog = str_replace(",{$tid},", ',', GetCookie('readlog')); $readlog .= ($readlog ? '' : ',') . $tid . ','; $readlogCount = substr_count($readlog, ','); $readlogCount > 11 && ($readlog = preg_replace("/[\\d]+\\,/i", '', $readlog, $readlogCount - 11)); Cookie('readlog', $readlog); $favortitle = str_replace(array("'", "'", "\"", "\\"), array("‘", "\\'", "\\\"", "\\\\"), $subject); $db_bbsname_a = addslashes($db_bbsname); #模版内用到 if ($readdb[0]['cyid']) { $guidename .= " » <a href=\"thread.php?cyid={$readdb[0][cyid]}\">" . $readdb[0]['cname'] . "</a>"; } $guidename .= " » <a href=\"read.php?tid={$tid}{$viewbbs}\">{$subject}</a>"; list($replies, $hits) = array(intval($read['replies']), intval($read['hits'])); //* 当$db_hits_store为1时,表示点击率采用数据库缓存的模式,每次需要额外从pw_hits_threads获取数据 if ($db_hits_store == 1) { $rt = $db->get_one('SELECT hits FROM pw_hits_threads WHERE tid=' . S::sqlEscape($tid));
/** * 读出所有分类,在类目管理页(list_type)中使用 * * @access public * @param int $channel 频道ID * @param int $nowdir 当前操作ID * @return string */ function ListAllType($channel = 0, $nowdir = 0) { global $cfg_admin_channel, $admin_catalogs; $this->dsql = $GLOBALS['dsql']; //检测用户有权限的顶级栏目 if ($cfg_admin_channel == 'array') { $admin_catalog = join(',', $admin_catalogs); $this->dsql->SetQuery("SELECT reid FROM `#@__arctype` WHERE id in({$admin_catalog}) group by reid "); $this->dsql->Execute(); $topidstr = ''; while ($row = $this->dsql->GetObject()) { if ($row->reid == 0) { continue; } $topidstr .= $topidstr == '' ? $row->reid : ',' . $row->reid; } $admin_catalog .= ',' . $topidstr; $admin_catalogs = explode(',', $admin_catalog); $admin_catalogs = array_unique($admin_catalogs); } $this->dsql->SetQuery("SELECT id,typedir,typename,ispart,sortrank,ishidden FROM `#@__arctype` WHERE reid=0 order by sortrank"); $this->dsql->Execute(0); while ($row = $this->dsql->GetObject(0)) { if ($cfg_admin_channel == 'array' && !in_array($row->id, $admin_catalogs)) { continue; } $typeDir = $row->typedir; $typeName = $row->typename; $ispart = $row->ispart; $id = $row->id; $rank = $row->sortrank; if ($row->ishidden == '1') { $nss = "<font color='red'>[隐]</font>"; } else { $nss = ''; } echo "<table width='100%' border='0' cellspacing='0' cellpadding='2'>\r\n"; //普通列表 if ($ispart == 0) { echo " <tr>\r\n"; echo " <td style='background-color:#FBFCE2;' width='2%' class='bline'><img style='cursor:pointer' id='img" . $id . "' onClick=\"LoadSuns('suns" . $id . "',{$id});\" src='images/dedeexplode.gif' width='11' height='11'></td>\r\n"; echo " <td style='background-color:#FBFCE2;' class='bline'><table width='98%' border='0' cellspacing='0' cellpadding='0'><tr><td width='50%'><input class='np' type='checkbox' name='tids[]' value='{$id}'><a href='catalog_do.php?cid=" . $id . "&dopost=listArchives' oncontextmenu=\"CommonMenu(event,this,{$id},'" . urlencode($typeName) . "')\">{$nss}" . $typeName . "[ID:" . $id . "]</a>(文档:" . $this->GetTotalArc($id) . ") <a onclick=\"AlertMsg('快捷编辑窗口','{$id}');\" href=\"javascript:;\"><img src='images/write2.gif'/></a>"; echo " </td><td align='right'>"; echo "<a href='{$GLOBALS['cfg_phpurl']}/list.php?tid={$id}' target='_blank'>预览</a>"; echo "|<a href='catalog_do.php?cid={$id}&dopost=listArchives'>内容</a>"; echo "|<a href='catalog_add.php?id={$id}'>增加子类</a>"; echo "|<a href='catalog_edit.php?id={$id}'>更改</a>"; echo "|<a href='catalog_do.php?dopost=moveCatalog&typeid={$id}'>移动</a>"; echo "|<a href='catalog_del.php?id={$id}&typeoldname=" . urlencode($typeName) . "'>删除</a>"; echo " <input type='text' name='sortrank{$id}' value='{$rank}' style='width:25px;height:20px'></td></tr></table></td></tr>\r\n"; } else { if ($ispart == 1) { echo " <tr >\r\n"; echo " <td style='background-color:#FBFCE2;' width='2%' class='bline'><img style='cursor:pointer' id='img" . $id . "' onClick=\"LoadSuns('suns" . $id . "',{$id});\" src='images/dedeexplode.gif' width='11' height='11'></td>\r\n"; echo " <td style='background-color:#FBFCE2;' class='bline'><table width='98%' border='0' cellspacing='0' cellpadding='0'><tr><td width='50%'><input class='np' type='checkbox' name='tids[]' value='{$id}'><a href='catalog_do.php?cid=" . $id . "&dopost=listArchives' oncontextmenu=\"CommonMenuPart(event,this,{$id},'" . urlencode($typeName) . "')\">{$nss}" . $typeName . "[ID:" . $id . "]</a> <a onclick=\"AlertMsg('快捷编辑窗口','{$id}');\" href=\"javascript:;\"> <img src='images/write2.gif'/> </a>"; echo " </td><td align='right'>"; echo "<a href='{$GLOBALS['cfg_phpurl']}/list.php?tid={$id}' target='_blank'>预览</a>"; echo "|<a href='catalog_do.php?cid={$id}&dopost=listArchives'>内容</a>"; echo "|<a href='catalog_add.php?id={$id}'>增加子类</a>"; echo "|<a href='catalog_edit.php?id={$id}'>更改</a>"; echo "|<a href='catalog_do.php?dopost=moveCatalog&typeid={$id}'>移动</a>"; echo "|<a href='catalog_del.php?id={$id}&typeoldname=" . urlencode($typeName) . "'>删除</a>"; echo " <input type='text' name='sortrank{$id}' value='{$rank}' style='width:25px;height:20px'></td></tr></table></td></tr>\r\n"; } else { if ($ispart == 2) { echo " <tr height='24' bgcolor='#FBFCE2'>\r\n"; echo " <td width='2%' class='bline2'><img style='cursor:pointer' id='img" . $id . "' onClick=\"LoadSuns('suns" . $id . "',{$id});\" src='images/dedeexplode.gif' width='11' height='11'></td>\r\n"; echo " <td class='bline2'><table width='98%' border='0' cellspacing='0' cellpadding='0'><tr><td width='50%'><input class='np' type='checkbox' name='tids[]' value='{$id}'><a href='catalog_edit.php?id=" . $id . "' oncontextmenu=\"SingleMenu(event,this,{$id},'" . urlencode($typeName) . "')\">{$nss}" . $typeName . "[ID:" . $id . "]</a> <a onclick=\"AlertMsg('快捷编辑窗口','{$id}');\" href=\"javascript:;\"><img src='images/write2.gif'/></a>"; echo " </td><td align='right'>"; echo "<a href='{$typeDir}' target='_blank'>预览</a>"; echo "|<a href='catalog_edit.php?id={$id}'>更改</a>"; echo "|<a href='catalog_do.php?dopost=moveCatalog&typeid={$id}'>移动</a>"; echo "|<a href='catalog_del.php?id={$id}&typeoldname=" . urlencode($typeName) . "'>删除</a>"; echo " <input type='text' name='sortrank{$id}' value='{$rank}' style='width:25px;height:20px'></td></tr></table></td></tr>\r\n"; } } } echo " <tr><td colspan='2' id='suns" . $id . "'>"; $lastid = GetCookie('lastCid'); if ($channel == $id || $lastid == $id || isset($GLOBALS['exallct']) || $cfg_admin_channel == 'array') { echo " <table width='100%' border='0' cellspacing='0' cellpadding='0'>\r\n"; $this->LogicListAllSunType($id, " "); echo " </table>\r\n"; } echo "</td></tr>\r\n</table>\r\n"; } }
function __construct($kptime = -1, $cache = FALSE) { global $dsql; if ($kptime == -1) { $this->M_KeepTime = 3600 * 24 * 7; } else { $this->M_KeepTime = $kptime; } $formcache = FALSE; $this->M_ID = $this->GetNum(GetCookie("DedeUserID")); $this->M_LoginTime = GetCookie("DedeLoginTime"); $this->fields = array(); $this->isAdmin = FALSE; if (empty($this->M_ID)) { $this->ResetUser(); } else { $this->M_ID = intval($this->M_ID); if ($cache) { $this->fields = GetCache($this->memberCache, $this->M_ID); if (empty($this->fields)) { $this->fields = $dsql->GetOne("Select * From `#@__member` where mid='{$this->M_ID}' "); } else { $formcache = TRUE; } } else { $this->fields = $dsql->GetOne("Select * From `#@__member` where mid='{$this->M_ID}' "); } if (is_array($this->fields)) { #api{{ if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) { if ($data = uc_get_user($this->fields['userid'])) { if (uc_check_avatar($data[0]) && !strstr($this->fields['face'], UC_API)) { $this->fields['face'] = UC_API . '/avatar.php?uid=' . $data[0] . '&size=middle'; $dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `face`='" . $this->fields['face'] . "' WHERE `mid`='{$this->M_ID}'"); } } } #/aip}} //间隔一小时更新一次用户登录时间 if (time() - $this->M_LoginTime > 3600) { $dsql->ExecuteNoneQuery("update `#@__member` set logintime='" . time() . "',loginip='" . GetIP() . "' where mid='" . $this->fields['mid'] . "';"); PutCookie("DedeLoginTime", time(), $this->M_KeepTime); } $this->M_LoginID = $this->fields['userid']; $this->M_MbType = $this->fields['mtype']; $this->M_Money = $this->fields['money']; $this->M_UserName = FormatUsername($this->fields['uname']); $this->M_Scores = $this->fields['scores']; $this->M_Face = $this->fields['face']; $this->M_Rank = $this->fields['rank']; $this->M_Spacesta = $this->fields['spacesta']; $sql = "Select titles From #@__scores where integral<={$this->fields['scores']} order by integral desc"; $scrow = $dsql->GetOne($sql); $this->fields['honor'] = $scrow['titles']; $this->M_Honor = $this->fields['honor']; if ($this->fields['matt'] == 10) { $this->isAdmin = TRUE; } $this->M_UpTime = $this->fields['uptime']; $this->M_ExpTime = $this->fields['exptime']; $this->M_JoinTime = MyDate('Y-m-d', $this->fields['jointime']); if ($this->M_Rank > 10 && $this->M_UpTime > 0) { $this->M_HasDay = $this->Judgemember(); } if (!$formcache) { SetCache($this->memberCache, $this->M_ID, $this->fields, 1800); } } else { $this->ResetUser(); } } }
function _checkForum() { $this->tid = $this->attach['tid']; $thread = $this->_db->get_one("SELECT fid,tpcstatus,ifcheck FROM pw_threads WHERE tid=" . S::sqlEscape($this->tid, false)); if (getstatus($thread['tpcstatus'], 1) && !$thread['fid'] && $thread['ifcheck'] == '2') { return true; } L::loadClass('forum', 'forum', false); $pwforum = new PwForum($thread['fid']); if (!$pwforum->isForum()) { return 'forum_purview_erro'; //读取数据错误,原因:您要访问的链接无效,可能链接不完整,或数据已被删除! } if ($pwforum->foruminfo['f_type'] == 'former' && $this->groupid == 'guest' && $_COOKIE) { return 'forum_purview_erro'; //本版块为正规版块,只有注册会员才能进入! } if (!empty($pwforum->foruminfo['style']) && file_exists(D_P . "data/style/{$pwforum->foruminfo[style]}.php")) { $GLOBALS['skin'] = $pwforum->foruminfo['style']; } $pwdcheck = GetCookie('pwdcheck'); if ($pwforum->foruminfo['password'] != '' && ($groupid == 'guest' || $pwdcheck[$pwforum->fid] != $pwforum->foruminfo['password'] && !S::inArray($this->user['username'], $GLOBALS['manager']))) { require_once R_P . 'require/forumpw.php'; } if (!$pwforum->allowvisit($this->user, $this->groupid)) { return 'forum_purview_erro'; //对不起,本版块为认证版块,您没有权限查看此版块的内容! } if (!$pwforum->foruminfo['cms'] && $pwforum->foruminfo['f_type'] == 'hidden' && !$pwforum->foruminfo['allowvisit']) { return 'forum_purview_erro'; //本版块为隐藏版块,您无权进入! } $this->foruminfo =& $pwforum->foruminfo; $this->admincheck = $this->groupid == '3' || $pwforum->isBM($this->username) ? 1 : 0; if (!$this->admincheck && !$pwforum->allowdownload($this->user, $this->groupid)) { //版块权限判断 return 'forum_purview_erro'; //对不起,本版块只有特定用户可以下载附件,请返回 } if (!$this->foruminfo['allowdownload'] && $this->_G['allowdownload'] == 0 && !$this->admincheck) { //用户组权限判断 return 'forum_purview_erro'; //用户组权限:你所属的用户组没有下载附件的权限 } return true; }
function getReturnUrl() { global $scrMap; $scr = unserialize(stripslashes(GetCookie('wap_scr'))); $page = $scr['page']; $extra = $scr['extra']; $url = $scrMap[$page] ? $scrMap[$page] : 'index.php'; if ($extra && S::isArray($extra)) { if ($page == 'read') { $url .= "?tid={$extra['tid']}"; } elseif ($page == "forum") { $url .= "?fid={$extra['fid']}"; } elseif ($page == "reply" || $page == "reply_all") { $url .= "?tid={$extra['tid']}"; } } return $url; }
function banUser() { global $db, $groupid, $winduid, $timestamp; if ($groupid == 6) { $pwSQL = ''; $flag = 0; $bandb = $delban = array(); $query = $db->query("SELECT * FROM pw_banuser WHERE uid=" . pwEscape($winduid) . " AND fid='0'"); while ($rt = $db->fetch_array($query)) { if ($rt['type'] == 1 && $timestamp - $rt['startdate'] > $rt['days'] * 86400) { $delban[] = $rt['id']; } else { $bandb = $rt; } } $delban && $db->update('DELETE FROM pw_banuser WHERE id IN(' . pwImplode($delban) . ')'); $groupid == 6 && !isset($bandb) && ($pwSQL .= "groupid='-1',"); if ($pwSQL = rtrim($pwSQL, ',')) { $db->update("UPDATE pw_members SET {$pwSQL} WHERE uid=" . pwEscape($winduid)); $_cache = getDatastore(); $_cache->delete('UID_' . $winduid); } if ($bandb) { if ($bandb['type'] == 1) { global $s_date, $e_date; $s_date = get_date($bandb['startdate']); $e_date = $bandb['startdate'] + $bandb['days'] * 86400; $e_date = get_date($e_date); Showmsg('ban_info1'); } else { if ($bandb['type'] == 3) { Cookie('force', $winduid); Showmsg('ban_info3'); } else { Showmsg('ban_info2'); } } } } if (GetCookie('force') && $winduid != GetCookie('force')) { $force = GetCookie('force'); $bandb = $db->get_one("SELECT type FROM pw_banuser WHERE uid=" . pwEscape($force) . " AND fid='0'"); if ($bandb['type'] == 3) { Showmsg('ban_info3'); } else { Cookie('force', '', 0); } } /** * 需要验证用户只有通过管理员验证后才能发帖 */ if ($groupid == '7') { Showmsg('post_check'); } }
<?php !defined('P_W') && exit('Forbidden'); S::gp(array('uid', 'sign')); $uid = intval($uid); if (!$sign) { Showmsg('error'); } if ($uid < 1) { $bubble = GetCookie('bubble') ? GetCookie('bubble') : array(); $bubble = unserialize(stripslashes($bubble)); $bubble[$sign] = 1; Cookie("bubble", serialize($bubble)); Showmsg('error'); } if ($uid != $winduid) { Showmsg('undefined_action'); } $cache = perf::gatherCache('pw_members'); $userData = $cache->getMemberDataByUserId($uid); if (!$userData) { Showmsg('error'); } $bubbleInfo = $userData['bubble'] ? unserialize($userData['bubble']) : array(); $bubbleInfo[$sign] = 1; $userService = L::loadClass('userservice', 'user'); $userService->update($uid, array(), array('bubble' => serialize($bubbleInfo))); echo 'success'; ajax_footer();
SELECT * FROM `' . $Prefix . 'statistics` WHERE DaysDate = :DaysDate2 ) ', array('DaysUsers' => $Config['DaysUsers'], 'DaysPosts' => $Config['DaysPosts'], 'DaysTopics' => $Config['DaysTopics'], 'TotalUsers' => $Config['NumUsers'], 'TotalPosts' => $Config['NumPosts'], 'TotalTopics' => $Config['NumTopics'], 'DaysDate' => $Config['DaysDate'], 'DateCreated' => $TimeStamp, 'DaysDate2' => $Config['DaysDate'])); UpdateConfig(array('DaysDate' => $CurrentDate, 'DaysTopics' => 0, 'DaysPosts' => 0, 'DaysUsers' => 0, 'CacheHotTags' => json_encode($DB->query('SELECT ID,Name,Icon,TotalPosts,Followers FROM ' . $Prefix . 'tags WHERE IsEnabled=1 ORDER BY TotalPosts DESC LIMIT ' . $Config['TopicsPerPage'])))); } // Get the infomation of current user $CurUserInfo = null; //当前用户信息,Array,以后判断是否登陆使用if($CurUserID) $CurUserRole = 0; $CurUserID = intval(GetCookie('UserID')); $CurUserExpirationTime = intval(GetCookie('UserExpirationTime')); $CurUserCode = GetCookie('UserCode'); if ($CurUserExpirationTime > $TimeStamp && $CurUserExpirationTime < $TimeStamp + 2678400 && $CurUserID && $CurUserCode) { $TempUserInfo = array(); if ($MCache) { $TempUserInfo = $MCache->get(MemCachePrefix . 'UserInfo_' . $CurUserID); } if (!$TempUserInfo) { $TempUserInfo = $DB->row("SELECT * FROM " . $Prefix . "users WHERE ID = :UserID", array("UserID" => $CurUserID)); if ($MCache && $TempUserInfo) { $MCache->set(MemCachePrefix . 'UserInfo_' . $CurUserID, $TempUserInfo, 86400); } } //Using hash_equals() in the future if ($TempUserInfo && HashEquals(md5($TempUserInfo['Password'] . $TempUserInfo['Salt'] . $CurUserExpirationTime . $SALT), $CurUserCode)) { $CurUserName = $TempUserInfo['UserName']; $CurUserRole = $TempUserInfo['UserRoleID'];
<?php !function_exists('readover') && exit('Forbidden'); $useradsInfo = GetCookie('userads'); $useradsInfo && (list($u, $a) = explode("\t", $useradsInfo)); if (is_numeric($u) || $a && strlen($a) < 16) { PwNewDB(); $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $tmpUser = $u ? $userService->get($u) : $userService->getByUserName($a); if ($tmpUser && advertRecord($tmpUser['uid'], $tmpUser['username'])) { if (!$credit) { require_once R_P . 'require/credit.php'; } $credit->addLog('other_propaganda', array($inv_linkcredit => $inv_linkscore), array('uid' => $tmpUser['uid'], 'username' => $tmpUser['username'], 'ip' => $onlineip)); $credit->set($tmpUser['uid'], $inv_linkcredit, $inv_linkscore); $credit->writeLog(); } } Cookie('userads', '', 0); unset($useradsInfo); /** * Ìí¼Ó * @param int $uid * @param string $username * @return null */ function advertRecord($uid = 0, $username = '') { global $onlineip, $timestamp, $db, $winduid, $inv_linktype, $inv_linkscore, $inv_linkcredit; if (empty($uid) || empty($username)) {
set_time_limit(300); $aid = (int) GetGP('aid'); empty($aid) && wap_msg('job_attach_error', $basename); $pw_attachs = L::loadDB('attachs', 'forum'); $attach = $pw_attachs->get($aid); !$attach && wap_msg('job_attach_error', $basename); if (empty($attach['attachurl']) || strpos($attach['attachurl'], '..') !== false) { wap_msg('job_attach_error', $basename); } $fid = $attach['fid']; $aid = $attach['aid']; $tid = $attach['tid']; $pid = $attach['pid']; $fid = $db->get_value('SELECT fid FROM pw_threads WHERE tid=' . pwEscape($tid, false)); $fid || wap_msg('data_error', $basename); if (!$windid && GetCookie('winduser') && $ol_offset) { $userdb = explode("\t", getuserdb(D_P . "data/bbscache/online.php", $ol_offset)); if ($userdb && $userdb[2] == $onlineip) { $winddb = $db->get_one("SELECT m.uid,m.username,m.groupid,m.memberid,m.groups,md.money,md.rvrc FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE m.uid=" . pwEscape($userdb['8'])); $winduid = $winddb['uid']; $groupid = $winddb['groupid']; $groupid == '-1' && ($groupid = $winddb['memberid']); $userrvrc = round($winddb['rvrc'] / 10, 1); $windid = $winddb['username']; if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) { require_once Pcv(D_P . "data/groupdb/group_{$groupid}.php"); } else { require_once D_P . "data/groupdb/group_1.php"; } } define('FX', 1);
$cate_thread = 'display:none;'; } if (strpos($_COOKIE['deploy'], "\tchildren\t") === false) { $children_img = 'fold'; $cate_children = ''; } else { $children_img = 'open'; $cate_children = 'display:none;'; } $forumdb = array(); if ($foruminfo['childid']) { require_once R_P . "require/thread_child.php"; } if ($managecheck) { S::gp(array('concle')); $concle || ($concle = GetCookie('concle')); if ($concle == 1 && ($isGM || $pwSystem['topped'] || $pwSystem['digestadmin'] || $pwSystem['lockadmin'] || $pwSystem['pushadmin'] || $pwSystem['coloradmin'] || $pwSystem['downadmin'])) { $concle = 2; $managemode = 1; Cookie("concle", "1", 0); } else { $concle = 1; $managemode = 0; Cookie("concle", "", 0); } $trd_adminhide = "<form action=\"mawhole.php\" method=\"post\" name=\"mawhole\"><input type=\"hidden\" name=\"fid\" value=\"{$fid}\">"; } else { $trd_adminhide = ''; } $colspannum = 6; /*分类、团购 start*/