前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >自动下载forumdisplay.php,forumdisplay.php

自动下载forumdisplay.php,forumdisplay.php

作者头像
全栈程序员站长
发布2022-09-14 11:39:33
1.4K0
发布2022-09-14 11:39:33
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

/*

[Discuz!] (C)2001-2009 Comsenz Inc.

This is NOT a freeware, use is subject to license terms

Id: forumdisplay.php 16946 2008-11-28 05:30:28Z tiger

*/

define(‘CURSCRIPT’, ‘forumdisplay’);

require_once ‘./include/common.inc.php’;

require_once DISCUZ_ROOT.’./include/forum.func.php’;

$discuz_action = 2;

if($forum[‘redirect’]) {

dheader(“Location: $forum[redirect]”);

} elseif($forum[‘type’] == ‘group’) {

dheader(“Location: {indexname}?gid=fid”);

} elseif(empty($forum[‘fid’])) {

showmessage(‘forum_nonexistence’, NULL, ‘HALTED’);

}

showoldetails = isset(showoldetails) ?

switch($showoldetails) {

case ‘no’: dsetcookie(‘onlineforum’, 0, 86400 * 365); break;

case ‘yes’: dsetcookie(‘onlineforum’, 1, 86400 * 365); break;

}

forum[‘name’] = strip_tags(forum[‘name’]) ? strip_tags(forum[‘name’]) : forum[‘name’];

if($forum[‘type’] == ‘forum’) {

navigation = ‘» ‘.forum[‘name’];

navtitle = forum[‘name’];

} else {

forumup = _DCACHE[‘forums’][

navigation = ‘» ‘.forumup.’ » ‘.

navtitle = forum[‘name’].’ – ‘.strip_tags(

}

rsshead = rssstatus ? (‘\n”) : ”;

$navtitle .= ‘ – ‘;

metakeywords = !forum[‘keywords’] ? forum[‘name’] : forum[‘keywords’];

metadescription = !forum[‘description’] ? forum[‘name’] : strip_tags(forum[‘description’]);

if(forum[‘viewperm’] && !forumperm(

showmessage(‘forum_nopermission’, NULL, ‘NOPERM’);

} elseif ($forum[‘formulaperm’]) {

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’.

include template(‘forumdisplay_passwd’);

exit();

}

}

$sdb = loadmultiserver();

foreach(array(‘modarea_c’, ‘sidebar’) as $key) {

if(!isset(_COOKIE[‘discuz_collapse’]) || strpos(_COOKIE[‘discuz_collapse’],

collapseimg[key] = ‘collapsed_no’;

collapse[key] = ”;

} else {

collapseimg[key] = ‘collapsed_yes’;

collapse[key] = ‘display: none’;

}

}

forum[‘modrecommend’] = forum[‘modrecommend’] ? unserialize(

if(forum[‘modrecommend’] &&

forum[‘recommendlist’] = recommendupdate(fid,

}

toptablewidth = forum[‘rules’] &&

infosidestatus[0] = !empty(infosidestatus[‘f’.fid][0]) ? infosidestatus[‘f’.fid][0] : infosidestatus[0];

infosidestatus[‘allow’] = infosidestatus[‘allow’] && infosidestatus[0] &&

forum[‘typemodels’] = forum[‘typemodels’] ? unserialize(

moderatedby = moddisplay(forum[‘moderators’], ‘forumdisplay’);

highlight = empty(highlight) ? ” : htmlspecialchars(

if($forum[‘autoclose’]) {

closedby = forum[‘autoclose’] > 0 ? ‘dateline’ : ‘lastpost’;

forum[‘autoclose’] = abs(forum[‘autoclose’]) * 86400;

}

$subexists = 0;

foreach(_DCACHE[‘forums’] as sub) {

if(sub[‘type’] == ‘sub’ && fid && (!sub[‘viewperm’] || forumperm(sub[‘viewperm’]) || strstr(sub[‘users’], “\tdiscuz_uid\t”))) {

$subexists = 1;

$sublist = array();

sql = accessmasks ? “SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, ff.description, ff.moderators, ff.icon, ff.viewperm, a.allowview FROM {

LEFT JOIN {$tablepre}forumfields ff ON ff.fid=f.fid

LEFT JOIN {tablepre}access a ON a.uid=’discuz_uid’ AND a.fid=f.fid

WHERE fup=’$fid’ AND status>0 AND type=’sub’ ORDER BY f.displayorder”

: “SELECT f.fid, f.fup, f.type, f.name, f.threads, f.posts, f.todayposts, f.lastpost, ff.description, ff.moderators, ff.icon, ff.viewperm FROM {$tablepre}forums f

LEFT JOIN {$tablepre}forumfields ff USING(fid)

WHERE f.fup=’$fid’ AND f.status>0 AND f.type=’sub’ ORDER BY f.displayorder”;

query = sdb->query(

while(sub = sdb->fetch_array(

if(forum($sub)) {

sub[‘orderid’] = count(sublist);

sublist[] = sub;

}

}

break;

}

}

if($subexists) {

if($forum[‘forumcolumns’]) {

forum[‘forumcolwidth’] = floor(100 / forum[‘forumcolumns’]).’%’;

forum[‘subscount’] = count(sublist);

$forum[‘endrows’] = ”;

if(colspan = forum[‘subscount’] %

while((forum[‘forumcolumns’] – colspan) > 0) {

$forum[‘endrows’] .= ‘

‘;

$colspan ++;

}

$forum[‘endrows’] .= ”;

}

}

if(empty(_COOKIE[‘discuz_collapse’]) || strpos(_COOKIE[‘discuz_collapse’], ‘subforum_’.

$collapse[‘subforum’] = ”;

$collapseimg[‘subforum’] = ‘collapsed_no.gif’;

} else {

$collapse[‘subforum’] = ‘display: none’;

$collapseimg[‘subforum’] = ‘collapsed_yes.gif’;

}

}

if($forum[‘simple’] & 1) {

$forummenu = ”;

if($forumjump) {

$forummenu = forumselect(FALSE, 1);

}

include template(‘forumdisplay_simple’);

exit();

}

page = isset(page) ? max(1, intval(

page = threadmaxpages && page >

start_limit = (page – 1) *

if($page == 1) {

if($_DCACHE[‘announcements_forum’]) {

announcement = _DCACHE[‘announcements_forum’];

announcement[‘starttime’] = gmdate(dateformat, announcement[‘starttime’] + (timeoffset * 3600));

} else {

$announcement = NULL;

}

}

forumdisplayadd = filteradd = sortadd = typeadd = ”;

$specialtype = array(‘poll’ => 1, ‘trade’ => 2, ‘reward’ => 3, ‘activity’ => 4, ‘debate’ => 5, ‘video’ => 6);

if(isset($filter)) {

if($filter == ‘digest’) {

$forumdisplayadd .= ‘&filter=digest’;

$filteradd = “AND digest>’0′”;

} elseif(filter == ‘type’ && typeid && isset(

forumdisplayadd .= “&filter=type&typeid=

typeadd = “&typeid=

filteradd = “AND typeid=’typeid'”;

filteradd .= sortid ? “AND sortid=’

} elseif(filter == ‘sort’ && sortid && isset(

forumdisplayadd .= “&filter=sort&sortid=

sortadd = “&sortid=

filteradd = “AND sortid=’sortid'”;

filteradd .= typeid ? “AND typeid=’

} elseif(preg_match(“/^\d+/”, filter)) {

forumdisplayadd .= “&filter=

filteradd = filter ? “AND lastpost>='”.(timestamp – filter).”‘” : ”;

} elseif(isset(specialtype[filter])) {

forumdisplayadd .= “&filter=

filteradd = “AND special=’specialtype[

} else {

$filter = ”;

}

} else {

$filter = ”;

}

isset(orderby) && in_array(forumdisplayadd .= “&orderby=orderby = _DCACHE[‘forums’][fid][‘orderby’] ? _DCACHE[‘forums’][

isset(ascdesc) && in_array(forumdisplayadd .= “&ascdesc=ascdesc = _DCACHE[‘forums’][fid][‘ascdesc’] ? _DCACHE[‘forums’][

$check = array();

check[filter] = check[orderby] = check[ascdesc] = ‘selected=”selected”‘;

if(whosonlinestatus == 2 || whosonlinestatus == 3) {

$whosonlinestatus = 1;

onlineinfo = explode(“\t”, onlinerecord);

detailstatus = showoldetails == ‘yes’ || (((!isset(_DCOOKIE[‘onlineforum’]) && !_DCOOKIE[‘onlineforum’]) &&

if($detailstatus) {

updatesession();

@include language(‘actions’);

$whosonline = array();

forumname = strip_tags(forum[‘name’]);

guestwhere = isset(_DCACHE[‘onlinelist’][7]) ? ” : “uid>’0′ AND”;

query = db->query(“SELECT uid, groupid, username, invisible, lastactivity, action FROM {tablepre}sessions WHERE guestwhere fid=’

if(db->num_rows(

$whosonlinestatus = 1;

while(online = db->fetch_array(

if($online[‘uid’]) {

online[‘icon’] = isset(_DCACHE[‘onlinelist’][online[‘groupid’]]) ? _DCACHE[‘onlinelist’][online[‘groupid’]] : _DCACHE[‘onlinelist’][0];

} else {

online[‘icon’] = _DCACHE[‘onlinelist’][7];

online[‘username’] = _DCACHE[‘onlinelist’][‘guest’];

}

online[‘action’] = actioncode[

online[‘lastactivity’] = gmdate(timeformat, online[‘lastactivity’] + (timeoffset * 3600));

whosonline[] = online;

}

}

unset($online);

}

} else {

$whosonlinestatus = 0;

}

if(empty($filter)) {

threadcount = forum[‘threads’];

} else {

threadcount = sdb->result_first(“SELECT COUNT(*) FROM {tablepre}threads WHERE fid=’fid’

}

thisgid = forum[‘type’] == ‘forum’ ? forum[‘fup’] : _DCACHE[‘forums’][

if(globalstick &&

stickytids = _DCACHE[‘globalstick’][‘global’][‘tids’].(empty(_DCACHE[‘globalstick’][‘categories’][thisgid][‘count’]) ? ” : ‘,’._DCACHE[‘globalstick’][‘categories’][thisgid][‘tids’]);

stickycount = _DCACHE[‘globalstick’][‘global’][‘count’] + _DCACHE[‘globalstick’][‘categories’][thisgid][‘count’];

} else {

stickycount = stickytids = 0;

}

filterbool = !empty(filter) && in_array(

threadcount += filterbool ? 0 :

multipage = multi(threadcount, tpp, page, “forumdisplay.php?fid=fidforumdisplayadd”,

extra = rawurlencode(“page=page

$separatepos = 0;

$threadlist = array();

$colorarray = array(”, ‘#EE1B2E’, ‘#EE5023’, ‘#996600’, ‘#3C9D40’, ‘#2897C5’, ‘#2B65B7’, ‘#8F2A90’, ‘#EC1282’);

displayorderadd = !filterbool &&

if((start_limit && stickycount) || !stickycount ||

$querysticky = ”;

query = sdb->query(“SELECT t.* FROM {

WHERE t.fid=’fid’ filteradd AND

ORDER BY t.displayorder DESC, t.orderby ascdesc

LIMIT “.(filterbool ? start_limit : start_limit – stickycount).”,

} else {

querysticky = sdb->query(“SELECT t.* FROM {

WHERE t.tid IN ($stickytids) AND t.displayorder IN (2, 3)

ORDER BY displayorder DESC, orderby ascdesc

LIMIT start_limit, “.(stickycount – start_limit < stickycount – start_limit :

if(tpp – stickycount +

query = sdb->query(“SELECT t.* FROM {

WHERE t.fid=’fid’ filteradd AND

ORDER BY displayorder DESC, orderby ascdesc

LIMIT “.(tpp – stickycount +

} else {

$query = ”;

}

}

if(page < 4 && !(empty(thisgid]) && empty(

queryfloat = sdb->query(“SELECT t.* FROM {

WHERE t.tid IN (“.(!empty(_DCACHE[‘floatthreads’][‘categories’][thisgid]) ? _DCACHE[‘floatthreads’][‘categories’][thisgid] : 0).’,’.(!empty(_DCACHE[‘floatthreads’][‘forums’][fid]) ? _DCACHE[‘floatthreads’][‘forums’][fid] : 0).”) AND t.displayorder IN (4, 5)

ORDER BY displayorder DESC”);

} else {

$queryfloat = ”;

}

ppp = forum[‘threadcaches’] && !discuz_uid ? _DCACHE[‘settings’][‘postperpage’] :

while((querysticky && sdb->fetch_array(query && sdb->fetch_array(queryfloat && sdb->fetch_array(

thread[‘icon’] = isset(_DCACHE[‘icons’][

thread[‘lastposterenc’] = rawurlencode(thread[‘lastposter’]);

thread[‘typeid’] = thread[‘typeid’] && !empty(forum[‘threadtypes’][‘prefix’]) && isset(

‘[‘.forum[‘threadtypes’][‘types’][thread[‘typeid’]].’]‘ : ”;

thread[‘sortid’] = thread[‘sortid’] && !empty(forum[‘threadsorts’][‘prefix’]) && isset(

‘[‘.forum[‘threadsorts’][‘types’][thread[‘sortid’]].’]‘ : ”;

$thread[‘multipage’] = ”;

topicposts = thread[‘special’] ? thread[‘replies’] : thread[‘replies’] + 1;

thread[‘special’] == 3 &&

if(topicposts >

$pagelinks = ”;

thread[‘pages’] = ceil(topicposts /

for(i = 2; i <= 6 && i <=

pagelinks .= “i “;

}

if($thread[‘pages’] > 6) {

pagelinks .= ” .. thread[pages] “;

}

thread[‘multipage’] = ‘… ‘.pagelinks;

}

if($thread[‘highlight’]) {

string = sprintf(‘%02d’, thread[‘highlight’]);

stylestr = sprintf(‘%03b’, string[0]);

$thread[‘highlight’] = ‘ style=”‘;

thread[‘highlight’] .= stylestr[0] ? ‘font-weight: bold;’ : ”;

thread[‘highlight’] .= stylestr[1] ? ‘font-style: italic;’ : ”;

thread[‘highlight’] .= stylestr[2] ? ‘text-decoration: underline;’ : ”;

thread[‘highlight’] .= string[1] ? ‘color: ‘.colorarray[string[1]] : ”;

$thread[‘highlight’] .= ‘”‘;

} else {

$thread[‘highlight’] = ”;

}

$thread[‘moved’] = 0;

if(thread[‘closed’] || (forum[‘autoclose’] && timestamp – thread[closedby] >

$thread[‘new’] = 0;

if($thread[‘closed’] > 1) {

thread[‘moved’] = thread[‘tid’];

thread[‘tid’] = thread[‘closed’];

$thread[‘replies’] = ‘-‘;

$thread[‘views’] = ‘-‘;

}

$thread[‘folder’] = ‘lock’;

} else {

$thread[‘folder’] = ‘common’;

if(lastvisit < _DCOOKIE[‘oldtopics’]) || strpos(_DCOOKIE[‘oldtopics’], ‘D’.

$thread[‘new’] = 1;

$thread[‘folder’] = ‘new’;

} else {

$thread[‘new’] = 0;

}

if(thread[‘replies’] >

thread[‘views’] = thread[‘replies’];

}

if(thread[‘replies’] >=

$thread[‘folder’] = ‘hot’;

}

}

thread[‘dateline’] = gmdate(dateformat, thread[‘dateline’] + timeoffset * 3600);

thread[‘lastpost’] = dgmdate(“dateformat timeformat”, thread[‘lastpost’] +

if(in_array($thread[‘displayorder’], array(1, 2, 3))) {

thread[‘id’] = ‘stickthread_’.thread[‘tid’];

$separatepos++;

} elseif(in_array($thread[‘displayorder’], array(4, 5))) {

thread[‘id’] = ‘floatthread_’.thread[‘tid’];

} else {

thread[‘id’] = ‘normalthread_’.thread[‘tid’];

}

threadlist[] = thread;

}

separatepos = separatepos ? separatepos + 1 : (announcement ? 1 : 0);

visitedforums = visitedforums ? visitedforums() : ”;

$forummenu = ”;

usesigcheck = discuz_uid &&

allowpost = (!forum[‘postperm’] && allowpost) || (forum[‘postperm’] && forumperm(forum[‘postperm’])) || (forum[‘allowpost’] == 1 &&

fastpost = fastpost && !

allowpost = forum[‘allowpost’] != -1 ?

addfeedcheck = customaddfeed & 1 ? ‘checked=”checked”‘: ”;

showpoll = showtrade = showreward = showactivity = showdebate = showvideo = 0;

if($forum[‘allowpostspecial’]) {

showpoll = forum[‘allowpostspecial’] & 1;

showtrade = forum[‘allowpostspecial’] & 2;

showreward = isset(extcredits[creditstransextra[2]]) && (

showactivity = forum[‘allowpostspecial’] & 8;

showdebate = forum[‘allowpostspecial’] & 16;

showvideo = (forum[‘allowpostspecial’] & 32) &&

}

if($allowpost) {

allowpostpoll = allowpostpoll &&

allowposttrade = allowposttrade &&

allowpostreward = allowpostreward &&

allowpostactivity = allowpostactivity &&

allowpostdebate = allowpostdebate &&

allowpostvideo = allowpostvideo &&

}

if($forumjump) {

$forummenu = forumselect(FALSE, 1);

}

include template(‘forumdisplay’);

function arrayslice(array, offset,

if(empty(array) || !is_array(array)) return array();

if(PHP_VERSION >= ‘5.0.2’) {

return array_slice(array, offset,

} else {

array = array_chunk(array,

return array[offset /

}

}

?>

一键复制

编辑

Web IDE

原始数据

按行查看

历史

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/158346.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年7月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
Discuz!
Discuz! 是全球领先的论坛社区应用系统,自2001年6月面世以来,服务超过300多万网站用户案例。现在,借助 Discuz! ,您不仅可以使用搭建传统的社区论坛,更可轻易的构建面向移动互联网时代的私域流量和社交圈子类的应用,并快速启动业务。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档