<?php
/*
[Discuz!] (C)2001-2006 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
<!--Jie.daniel;
http://www.hi0088.com/blog/-->
$RCSfile: index.php,v $
$Revision: 1.9 $
$Date: 2006/02/23 13:44:02 $
*/
require_once './include/common.inc.php';
if(!empty($_GET['left']) && in_array($_GET['left'], array('on', 'off'))) {
setcookie('left', $_GET['left']);
}
$referer = dreferer();
$fromurl = empty($referer) ? $indexname : (preg_match("/admincp/", $referer) ? $indexname : $referer);
if($_GET['left'] == 'off' || empty($_GET['left']) && $_COOKIE['left'] == 'off') {
exit('<script language="JavaScript">top.location.href="'.$fromurl.'"</script>');
}
if($page == 'nav') {
if(!file_exists(DISCUZ_ROOT.'./forumdata/cache/cache_forums.php')) {
require_once DISCUZ_ROOT.'./include/cache.func.php';
updatecache();
}
require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
/**
* 一下23-30行的代码为获得搜藏的板块列表
*/
if(!empty($discuz_uid)) {
$query = $db->query("SELECT f.fid, f.name, f.threads, f.posts, f.todayposts
FROM {$tablepre}forums f, {$tablepre}favorites fav
WHERE fav.fid=f.fid AND fav.uid='$discuz_uid'");
while($fav = $db->fetch_array($query)) {
$favlist[] = $fav;
}
}
include template('navigation');
} else {
$main_url = $fromurl;
include template('index');
}
?>