<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: forum_forumdisplay.php 17186 2010-09-26 02:22:54Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
require_once libfile('function/forumlist');
if($_G['forum']['redirect']) {
dheader("Location: {$_G[forum][redirect]}");
} elseif($_G['forum']['type'] == 'group') {
dheader("Location: forum.php?gid=$_G[fid]");
} elseif(empty($_G['forum']['fid'])) {
showmessage('forum_nonexistence', NULL);
}
$_G['action']['fid'] = $_G['fid'];
$_G['gp_specialtype'] = isset($_G['gp_specialtype']) ? $_G['gp_specialtype'] : '';
$_G['gp_dateline'] = isset($_G['gp_dateline']) ? intval($_G['gp_dateline']) : 0;
$_G['gp_digest'] = isset($_G['gp_digest']) ? 1 : '';
$_G['gp_archiveid'] = isset($_G['gp_archiveid']) ? intval($_G['gp_archiveid']) : 0;
$showoldetails = isset($_G['gp_showoldetails']) ? $_G['gp_showoldetails'] : '';
switch($showoldetails) {
case 'no': dsetcookie('onlineforum', ''); break;
case 'yes': dsetcookie('onlineforum', 1, 31536000); break;
}
$_G['forum']['name'] = strip_tags($_G['forum']['name']) ? strip_tags($_G['forum']['name']) : $_G['forum']['name'];
$_G['forum']['extra'] = unserialize($_G['forum']['extra']);
if(!is_array($_G['forum']['extra'])) {
$_G['forum']['extra'] = array();
}
$threadtable_info = !empty($_G['cache']['threadtable_info']) ? $_G['cache']['threadtable_info'] : array();
//存档信息查询
$forumarchive = array();
if($_G['forum']['archive']) {
$query = DB::query("SELECT * FROM ".DB::table('forum_forum_threadtable')." WHERE fid='{$_G['fid']}'");
while($archive = DB::fetch($query)) {
$forumarchive[$archive['threadtableid']] = array(
'displayname' => htmlspecialchars($threadtable_info[$archive['threadtableid']]['displayname']),
'threads' => $archive['threads'],
'posts' => $archive['posts'],
);
if(empty($forumarchive[$archive['threadtableid']]['displayname'])) {
$forumarchive[$archive['threadtableid']]['displayname'] = lang('forum/template', 'forum_archive').' '.$archive['threadtableid'];
}
}
}
//导航
if($_G['forum']['type'] == 'forum') {
if(empty($_G['gp_archiveid'])) {
$navigation = '› '.$_G['setting']['navs'][2]['navname'].' › '.$_G['forum']['name'].'';
} else {
$navigation = '› '.$_G['setting']['navs'][2]['navname'].' › '.''.$_G['forum']['name'].' › '.$forumarchive[$_G['gp_archiveid']]['displayname'];
}
$navtitle = $_G['forum']['name'];
} else {
$forumup = $_G['forum']['status'] == 3 ? '' : $_G['cache']['forums'][$_G['forum']['fup']]['name'];
if(empty($_G['gp_archiveid'])) {
$navigation = '› '.$_G['setting']['navs'][2]['navname'].' › '.$forumup.' › '.$_G['forum']['name'];
} else {
$navigation = '› '.$_G['setting']['navs'][2]['navname'].' › '.$forumup.' › '.''.$_G['forum']['name'].' › '.$forumarchive[$_G['gp_archiveid']]['displayname'];
}
$navtitle = $_G['forum']['name'].' - '.strip_tags($forumup);
}
$metakeywords = $_G['forum']['keywords'];
if(!$metakeywords) {
$metakeywords = $_G['forum']['name'];
}
$metadescription = $_G['forum']['description'];
if(!$metadescription) {
$metadescription = $_G['forum']['name'];
}
$rssauth = $_G['rssauth'];
$rsshead = $_G['setting']['rssstatus'] ? ('\n") : '';
$metakeywords = !$_G['forum']['keywords'] ? $_G['forum']['name'] : $_G['forum']['keywords'];
$metadescription = !$_G['forum']['description'] ? $_G['forum']['name'] : strip_tags($_G['forum']['description']);
//俱乐部信息初始化,包含有标题,SEO字段,会员访问