コード例 #1
0
ファイル: forum_forumdisplay.php プロジェクト: kleitz/sports
    $navtitle = get_title_page($_G['forum']['name'], $_G['page']);
    $nobbname = false;
} else {
    $nobbname = true;
}
if (!empty($_G['gp_typeid']) && !empty($_G['forum']['threadtypes']['types'][$_G['gp_typeid']])) {
    $navtitle = strip_tags($_G['forum']['threadtypes']['types'][$_G['gp_typeid']]) . ' - ' . $navtitle;
}
if (!$metakeywords) {
    $metakeywords = $_G['forum']['name'];
}
if (!$metadescription) {
    $metadescription = $_G['forum']['name'];
}
if ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm']) && !$_G['forum']['allowview']) {
    showmessagenoperm('viewperm', $_G['fid'], $_G['forum']['formulaperm']);
} elseif ($_G['forum']['formulaperm']) {
    formulaperm($_G['forum']['formulaperm']);
}
if ($_G['forum']['password']) {
    if ($_G['gp_action'] == 'pwverify') {
        if ($_G['gp_pw'] != $_G['forum']['password']) {
            showmessage('forum_passwd_incorrect', NULL);
        } else {
            dsetcookie('fidpw' . $_G['fid'], $_G['gp_pw']);
            showmessage('forum_passwd_correct', "forum.php?mod=forumdisplay&fid={$_G['fid']}");
        }
    } elseif ($_G['forum']['password'] != $_G['cookie']['fidpw' . $_G['fid']]) {
        include template('forum/forumdisplay_passwd');
        exit;
    }
コード例 #2
0
ファイル: forum_post.php プロジェクト: Kingson4Wu/php_demo
    if ($_G['forum']['type'] == 'sub') {
        $fup = DB::fetch_first("SELECT name, fid FROM " . DB::table('forum_forum') . " WHERE fid='" . $_G['forum']['fup'] . "'");
        $navigation = '&rsaquo; <a href="forum.php?mod=forumdisplay&fid=' . $fup['fid'] . '">' . $fup['name'] . '</a> ' . $navigation;
        $navtitle = $navtitle . strip_tags($fup['name']) . ' - ';
    }
    $navigation = ' &rsaquo; <a href="forum.php">' . $_G['setting']['navs'][2]['navname'] . '</a> ' . $navigation;
}
periodscheck('postbanperiods');
if ($_G['forum']['password'] && $_G['forum']['password'] != $_G['cookie']['fidpw' . $_G['fid']]) {
    showmessage('forum_passwd', "forum.php?mod=forumdisplay&fid={$_G['fid']}");
}
if (empty($_G['forum']['allowview'])) {
    if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) {
        showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
    } elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) {
        showmessagenoperm('viewperm', $_G['fid']);
    }
} elseif ($_G['forum']['allowview'] == -1) {
    showmessage('forum_access_view_disallow');
}
formulaperm($_G['forum']['formulaperm']);
if (!$_G['adminid'] && $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 3600)) {
    if (TIMESTAMP - DB::result_first("SELECT regdate FROM " . DB::table('common_member') . " WHERE uid='{$_G['uid']}'") < $_G['setting']['newbiespan'] * 3600) {
        showmessage('post_newbie_span', '', array('newbiespan' => $_G['setting']['newbiespan']));
    }
}
$special = $special > 0 && $special < 7 || $special == 127 ? intval($special) : 0;
$_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : '';
$_G['group']['allowpostattach'] = $_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || !$_G['forum']['postattachperm'] && $_G['group']['allowpostattach'] || $_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm']));
$_G['forum']['allowpostimage'] = isset($_G['forum']['allowpostimage']) ? $_G['forum']['allowpostimage'] : '';
$_G['group']['allowpostimage'] = $_G['forum']['allowpostimage'] != -1 && ($_G['forum']['allowpostimage'] == 1 || !$_G['forum']['postimageperm'] && $_G['group']['allowpostimage'] || $_G['forum']['postimageperm'] && forumperm($_G['forum']['postimageperm']));
コード例 #3
0
ファイル: post_newreply.php プロジェクト: lemonstory/bbs
$quotemessage = '';
if ($special == 5) {
    $debate = array_merge($thread, daddslashes(C::t('forum_debate')->fetch($_G['tid'])));
    $firststand = C::t('forum_debatepost')->get_firststand($_G['tid'], $_G['uid']);
    $stand = $firststand ? $firststand : intval($_GET['stand']);
    if ($debate['endtime'] && $debate['endtime'] < TIMESTAMP) {
        showmessage('debate_end');
    }
}
if (!$_G['uid'] && !(!$_G['forum']['replyperm'] && $_G['group']['allowreply'] || $_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm']))) {
    showmessage('replyperm_login_nopermission', NULL, array(), array('login' => 1));
} elseif (empty($_G['forum']['allowreply'])) {
    if (!$_G['forum']['replyperm'] && !$_G['group']['allowreply']) {
        showmessage('replyperm_none_nopermission', NULL, array(), array('login' => 1));
    } elseif ($_G['forum']['replyperm'] && !forumperm($_G['forum']['replyperm'])) {
        showmessagenoperm('replyperm', $_G['forum']['fid']);
    }
} elseif ($_G['forum']['allowreply'] == -1) {
    showmessage('post_forum_newreply_nopermission', NULL);
}
if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) {
    showmessage('replyperm_login_nopermission', NULL, array(), array('login' => 1));
}
if (empty($thread)) {
    showmessage('thread_nonexistence');
} elseif ($thread['price'] > 0 && $thread['special'] == 0 && !$_G['uid']) {
    showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
}
checklowerlimit('reply', 0, 1, $_G['forum']['fid']);
if ($_G['setting']['commentnumber'] && !empty($_GET['comment'])) {
    if (!submitcheck('commentsubmit', 0, $seccodecheck, $secqaacheck)) {
コード例 #4
0
    exit;
}
$filename = $_G['setting']['attachdir'] . '/forum/' . $attach['attachment'];
if (!$attach['remote'] && !is_readable($filename)) {
    if (!$requestmode) {
        showmessage('attachment_nonexistence');
    } else {
        exit;
    }
}
if (!$requestmode) {
    if (!$ispaid && !$forum['allowgetattach']) {
        if (!$forum['getattachperm'] && !$allowgetattach) {
            showmessage('getattachperm_none_nopermission', NULL, array(), array('login' => 1));
        } elseif ($forum['getattachperm'] && !forumperm($forum['getattachperm']) || $forum['viewperm'] && !forumperm($forum['viewperm'])) {
            showmessagenoperm('getattachperm', $forum['fid']);
        }
    }
    $exemptvalue = $ismoderator ? 32 : 4;
    if (!$isimage && !($_G['group']['exempt'] & $exemptvalue)) {
        $creditlog = updatecreditbyaction('getattach', $_G['uid'], array(), '', 1, 0, $thread['fid']);
        if ($creditlog['updatecredit']) {
            if ($_G['uid']) {
                $k = $_G['gp_ck'];
                $t = $_G['gp_t'];
                if (empty($k) || empty($t) || $k != substr(md5($aid . $t . md5($_G['config']['security']['authkey'])), 0, 8) || TIMESTAMP - $t > 3600) {
                    dheader('location: forum.php?mod=misc&action=attachcredit&aid=' . $attach['aid'] . '&formhash=' . FORMHASH);
                    exit;
                }
            } else {
                showmessage('attachment_forum_nopermission', NULL, array(), array('login' => 1));
コード例 #5
0
if($forum['type'] == 'forum') {
	$navigation = '&raquo; '.$forum['name'];
	$navtitle = $forum['name'];
} else {
	$forumup = $_DCACHE['forums'][$forum['fup']]['name'];
	$navigation = '&raquo; <a href="forumdisplay.php?fid='.$forum['fup'].'">'.$forumup.'</a> &raquo; '.$forum['name'];
	$navtitle = $forum['name'].' - '.strip_tags($forumup);
}

$rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.' - '.$navtitle.'" href="'.$boardurl.'rss.php?fid='.$fid.'&amp;auth='.$rssauth."\" />\n") : '';
$navtitle .= ' - ';
$metakeywords = !$forum['keywords'] ? $forum['name'] : $forum['keywords'];
$metadescription = !$forum['description'] ? $forum['name'] : strip_tags($forum['description']);

if($forum['viewperm'] && !forumperm($forum['viewperm']) && !$forum['allowview']) {
	showmessagenoperm('viewperm', $fid);
} elseif ($forum['formulaperm'] && $adminid != 1) {
	formulaperm($forum['formulaperm']);
}

if($forum['password']) {
	if($action == 'pwverify') {
		if($pw != $forum['password']) {
			showmessage('forum_passwd_incorrect', NULL, 'HALTED');
		} else {
			dsetcookie('fidpw'.$fid, $pw);
			showmessage('forum_passwd_correct', "forumdisplay.php?fid=$fid");
		}
	} elseif($forum['password'] != $_DCOOKIE['fidpw'.$fid]) {
		include template('forumdisplay_passwd');
		exit();
コード例 #6
0
ファイル: newreply.inc.php プロジェクト: lilhorse/cocoa
$discuz_action = 12;
if ($special == 5) {
    $debate = array_merge($thread, $db->fetch_first("SELECT * FROM {$tablepre}debates WHERE tid='{$tid}'"));
    $standquery = $db->query("SELECT stand FROM {$tablepre}debateposts WHERE tid='{$tid}' AND uid='{$discuz_uid}' AND stand<>'0' ORDER BY dateline LIMIT 1");
    $firststand = $db->result_first("SELECT stand FROM {$tablepre}debateposts WHERE tid='{$tid}' AND uid='{$discuz_uid}' AND stand<>'0' ORDER BY dateline LIMIT 1");
    if ($debate['endtime'] && $debate['endtime'] < $timestamp) {
        showmessage('debate_end');
    }
}
if (!$discuz_uid && !(!$forum['replyperm'] && $allowreply || $forum['replyperm'] && forumperm($forum['replyperm']))) {
    showmessage('replyperm_login_nopermission', NULL, 'NOPERM');
} elseif (empty($forum['allowreply'])) {
    if (!$forum['replyperm'] && !$allowreply) {
        showmessage('replyperm_none_nopermission', NULL, 'NOPERM');
    } elseif ($forum['replyperm'] && !forumperm($forum['replyperm'])) {
        showmessagenoperm('replyperm', $forum['fid']);
    }
} elseif ($forum['allowreply'] == -1) {
    showmessage('post_forum_newreply_nopermission', NULL, 'HALTED');
}
if (empty($thread)) {
    showmessage('thread_nonexistence');
} elseif ($thread['price'] > 0 && $thread['special'] == 0 && !$discuz_uid) {
    showmessage('group_nopermission', NULL, 'NOPERM');
}
checklowerlimit($replycredits);
if ($special == 127) {
    $postinfo = $db->fetch_first("SELECT message FROM {$tablepre}posts WHERE tid='{$tid}' AND first='1'");
    $sppos = strrpos($postinfo['message'], chr(0) . chr(0) . chr(0));
    $specialextra = substr($postinfo['message'], $sppos + 3);
    if (!array_key_exists($specialextra, $threadplugins) || !in_array($specialextra, unserialize($forum['threadplugin'])) || !in_array($specialextra, $allowthreadplugin)) {
コード例 #7
0
ファイル: post_newthread.php プロジェクト: v998/discuzx-en
    showmessage('forum_nonexistence');
}
if ($special == 1 && !$_G['group']['allowpostpoll'] || $special == 2 && !$_G['group']['allowposttrade'] || $special == 3 && !$_G['group']['allowpostreward'] || $special == 4 && !$_G['group']['allowpostactivity'] || $special == 5 && !$_G['group']['allowpostdebate']) {
    showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
}
if (!$_G['uid'] && !(!$_G['forum']['postperm'] && $_G['group']['allowpost'] || $_G['forum']['postperm'] && forumperm($_G['forum']['postperm']))) {
    if (!defined('IN_MOBILE')) {
        showmessage('postperm_login_nopermission', NULL, array(), array('login' => 1));
    } else {
        showmessage('postperm_login_nopermission_mobile', NULL, array('referer' => rawurlencode(dreferer())), array('login' => 1));
    }
} elseif (empty($_G['forum']['allowpost'])) {
    if (!$_G['forum']['postperm'] && !$_G['group']['allowpost']) {
        showmessage('postperm_none_nopermission', NULL, array(), array('login' => 1));
    } elseif ($_G['forum']['postperm'] && !forumperm($_G['forum']['postperm'])) {
        showmessagenoperm('postperm', $_G['fid'], $_G['forum']['formulaperm']);
    }
} elseif ($_G['forum']['allowpost'] == -1) {
    showmessage('post_forum_newthread_nopermission', NULL);
}
if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) {
    showmessage('postperm_login_nopermission', NULL, array(), array('login' => 1));
}
checklowerlimit('post', 0, 1, $_G['forum']['fid']);
if (!submitcheck('topicsubmit', 0, $seccodecheck, $secqaacheck)) {
    $savethreads = array();
    $savethreadothers = array();
    $query = DB::query("SELECT dateline, fid, tid, pid, subject FROM " . DB::table(getposttable()) . " WHERE authorid='{$_G['uid']}' AND invisible='-3' AND first='1'");
    while ($savethread = DB::fetch($query)) {
        $savethread['dateline'] = dgmdate($savethread['dateline'], 'u');
        if ($_G['fid'] == $savethread['fid']) {
コード例 #8
0
ファイル: newthread.inc.php プロジェクト: lilhorse/cocoa
    exit('Access Denied');
}
$discuz_action = 11;
if (empty($forum['fid']) || $forum['type'] == 'group') {
    showmessage('forum_nonexistence');
}
if ($special == 1 && !$allowpostpoll || $special == 2 && !$allowposttrade || $special == 3 && !$allowpostreward || $special == 4 && !$allowpostactivity || $special == 5 && !$allowpostdebate) {
    showmessage('group_nopermission', NULL, 'NOPERM');
}
if (!$discuz_uid && !(!$forum['postperm'] && $allowpost || $forum['postperm'] && forumperm($forum['postperm']))) {
    showmessage('postperm_login_nopermission', NULL, 'NOPERM');
} elseif (empty($forum['allowpost'])) {
    if (!$forum['postperm'] && !$allowpost) {
        showmessage('postperm_none_nopermission', NULL, 'NOPERM');
    } elseif ($forum['postperm'] && !forumperm($forum['postperm'])) {
        showmessagenoperm('postperm', $fid);
    }
} elseif ($forum['allowpost'] == -1) {
    showmessage('post_forum_newthread_nopermission', NULL, 'HALTED');
}
if ($url && !empty($qihoo['relate']['webnum'])) {
    $from = in_array($from, array('direct', 'iframe')) ? $from : '';
    if ($data = @implode('', file("http://search.qihoo.com/sint/content.html?surl={$url}&md5={$md5}&ocs={$charset}&ics={$charset}&from={$from}"))) {
        preg_match_all("/(\\w+):([^\\>]+)/i", $data, $data);
        if (!$data[2][1]) {
            $subject = trim($data[2][3]);
            $message = !$editormode ? str_replace('[br]', "\n", trim($data[2][4])) : str_replace('[br]', '<br />', trim($data[2][4]));
        } else {
            showmessage('reprint_invalid');
        }
    }
コード例 #9
0
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if (empty($_G['forum']['fid']) || $_G['forum']['type'] == 'group') {
    showmessage('forum_nonexistence');
}
if ($special == 1 && !$_G['group']['allowpostpoll'] || $special == 2 && !$_G['group']['allowposttrade'] || $special == 3 && !$_G['group']['allowpostreward'] || $special == 4 && !$_G['group']['allowpostactivity'] || $special == 5 && !$_G['group']['allowpostdebate']) {
    showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
}
if (!$_G['uid'] && !(!$_G['forum']['postperm'] && $_G['group']['allowpost'] || $_G['forum']['postperm'] && forumperm($_G['forum']['postperm']))) {
    showmessage('postperm_login_nopermission', NULL, array(), array('login' => 1));
} elseif (empty($_G['forum']['allowpost'])) {
    if (!$_G['forum']['postperm'] && !$_G['group']['allowpost']) {
        showmessage('postperm_none_nopermission', NULL, array(), array('login' => 1));
    } elseif ($_G['forum']['postperm'] && !forumperm($_G['forum']['postperm'])) {
        showmessagenoperm('postperm', $_G['fid']);
    }
} elseif ($_G['forum']['allowpost'] == -1) {
    showmessage('post_forum_newthread_nopermission', NULL);
}
if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) {
    showmessage('postperm_login_nopermission', NULL, array(), array('login' => 1));
}
checklowerlimit('post');
if (!submitcheck('topicsubmit', 0, $seccodecheck, $secqaacheck)) {
    $isfirstpost = 1;
    $tagoffcheck = '';
    $showthreadsorts = !empty($sortid) || $_G['forum']['threadsorts']['required'];
    if ($special == 2 && $_G['group']['allowposttrade']) {
        $expiration_7days = date('Y-m-d', TIMESTAMP + 86400 * 7);
        $expiration_14days = date('Y-m-d', TIMESTAMP + 86400 * 14);