Exemplo n.º 1
0
 function checkReplyRight($tid)
 {
     global $isGM, $winddb, $isBM, $timestamp;
     $threadService = L::loadClass('threads', 'forum');
     L::loadClass('forum', 'forum', false);
     $read = $threadService->getByThreadId($tid);
     $pwforum = new PwForum($read['fid']);
     $forumset =& $pwforum->forumset;
     $tpc_locked = $read['locked'] % 3 != 0 ? 1 : 0;
     $admincheck = $isGM || $isBM ? 1 : 0;
     if (getstatus($read['tpcstatus'], 7)) {
         $robbuildService = L::loadClass('RobBuild', 'forum');
         /* @var $robbuildService PW_RobBuild */
         $robbuild = $robbuildService->getByTid($tid);
         if ($robbuild['starttime'] > $timestamp) {
             return false;
         }
     }
     $isAuthStatus = $admincheck || (!$forumset['auth_allowrp'] || $pwforum->authStatus($winddb['userstatus'], $forumset['auth_logicalmethod']) === true);
     if ($isAuthStatus && (!$tpc_locked || $SYSTEM['replylock']) && ($admincheck || $pwforum->allowreply($winddb, $groupid))) {
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
        //* require_once pwCache::getPath(S::escapePath(D_P . "data/groupdb/group_$groupid.php"));
        pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php"));
    } else {
        //* require_once pwCache::getPath(D_P . "data/groupdb/group_1.php");
        pwCache::getData(D_P . "data/groupdb/group_1.php");
    }
    define('FX', 1);
}
$downloadServer = getDownloadFactory($type);
$downloadServer->init($aid);
$attachInfo = $downloadServer->attach;
if ($attachInfo['fid'] && $attachInfo['uid'] != $winduid) {
    //实名认证权限
    L::loadClass('forum', 'forum', false);
    $pwforum = new PwForum($attachInfo['fid']);
    if ($GLOBALS['db_authstate'] && true !== ($authMessage = $pwforum->authStatus($GLOBALS['winddb']['userstatus'], $pwforum->forumset['auth_logicalmethod']))) {
        $msg = getLangInfo('msg', $authMessage . '_upload');
        require_once PrintEot('ajax');
        ajax_footer();
    }
}
if (empty($type) && $check) {
    S::gp(array('mt'));
    $msg = $downloadServer->check();
    require_once PrintEot('ajax');
    ajax_footer();
}
if (($return = $downloadServer->execute()) !== true) {
    Showmsg($return);
}
$attach =& $downloadServer->getInfo();
Exemplo n.º 3
0
    quickPostMessage('undefined_action');
}
L::loadClass('forum', 'forum', false);
$pwforum = new PwForum($fid);
if (!$pwforum->isForum()) {
    quickPostMessage('data_error');
}
list($isGM, $isBM, $forumset, $foruminfo) = array(S::inArray($windid, $manager), $pwforum->isBM($windid), $pwforum->forumset, $pwforum->foruminfo);
$cacheService = Perf::gatherCache('pw_threads');
$read = $cacheService->getThreadAndTmsgByThreadId($tid);
if (!$read) {
    quickPostMessage('illegal_tid');
}
list($tpc_locked, $admincheck) = array($read['locked'] % 3 != 0 ? 1 : 0, $isGM || $isBM ? 1 : 0);
//实名认证权限
if ($db_authstate && !$admincheck && $forumset['auth_allowrp'] && true !== ($authMessage = $pwforum->authStatus($winddb['userstatus'], $forumset['auth_logicalmethod']))) {
    quickPostMessage($authMessage . '_rp');
}
//quote required
require_once R_P . 'require/bbscode.php';
if ($article == '0') {
    $atcarray = $read;
    $userservice = L::loadClass('userservice', 'user');
    $userinfo = $userservice->get($read['authorid']);
    $userinfo && ($atcarray = array_merge($atcarray, $userinfo));
} else {
    !is_numeric($pid) && Showmsg('illegal_tid');
    $pw_posts = GetPtable($read['ptable']);
    $atcarray = $db->get_one("SELECT p.author,p.authorid,p.subject,p.ifsign,p.postdate,p.content,p.ifshield,p.anonymous,m.uid,m.groupid,m.userstatus FROM {$pw_posts} p LEFT JOIN pw_members m ON m.uid=p.authorid WHERE p.pid=" . S::sqlEscape($pid));
}
if ($atcarray['ifshield']) {
Exemplo n.º 4
0
// 同步pw_hits_threads数据到pw_threads, 进行该操作的概率是1/100
if ($db_hits_store == 1 && $timestamp % 100 == 0) {
    $_tids = array();
    foreach ($threaddb as $_threads) {
        $_tids[] = $_threads['tid'];
    }
    $db->update('UPDATE pw_threads t INNER JOIN pw_hits_threads h ON t.tid=h.tid SET t.hits=h.hits WHERE t.tid IN (' . S::sqlImplode($_tids) . ')');
    // 更新memcache缓存
    if (Perf::checkMemcache()) {
        Perf::gatherInfo('changeThreadWithThreadIds', array('tid' => $_tids));
    }
}
//获取列表是否新窗打开的cookie
$newwindows = $_COOKIE['newwindows'];
$tucoolnewwindows = $_COOKIE['tucoolnewwindows'];
$isAuthStatus = $isGM || (!$forumset['auth_allowpost'] || $pwforum->authStatus($winddb['userstatus'], $forumset['auth_logicalmethod']) === true);
//!$isAuthStatus && $N_allowtypeopen = false;
if ($groupid != 'guest' && $db_threadshowpost == 1 && $_G['allowpost'] && $pwforum->allowpost($winddb, $groupid) && $isAuthStatus) {
    $fastpost = 'fastpost';
}
$psot_sta = $titletop1 = '';
$t_exits = 0;
$t_typedb = $t_subtypedb = $withSystemType = $withSystemSubType = array();
if ($t_db) {
    foreach ($t_db as $value) {
        if ($value['upid'] == 0) {
            $withSystemType[$value['id']] = $t_typedb[$value['id']] = $value;
        } else {
            $withSystemSubType[$value['upid']][$value['id']] = $t_subtypedb[$value['upid']][$value['id']] = strip_tags($value['name']);
        }
        if ($value['ifsys'] && $gp_gptype != 'system') {