/* [Discuz!] (C)2001-2007 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: index.php 13764 2008-05-19 03:14:01Z heyond $ */ define('CURSCRIPT', 'index');//定义当前运行脚本名 require_once './include/common.inc.php';//引入common文件 require_once DISCUZ_ROOT.'./include/forum.func.php';//引入版块处理函数forum.func.php $discuz_action = 1;//? if($cacheindexlife && !$discuz_uid && $showoldetails != 'yes' && (!$_DCACHE['settings']['frameon'] || $_DCACHE['settings']['frameon'] && $_GET['frameon'] != 'yes') && empty($gid)) { //分析:$cacheindexlife-首页缓存有效期,$discuz_uid存在,$showoldetails-显示在线详情,$_DCACHE['settings']['frameon']-左右分栏模式开关,$gid-版块组id,自己看看吧,大概就是判断是否使用一个静态htm页面的条件,这个由后台是否开启首页缓存时间来决定的 $indexcache = getcacheinfo(0);//得到首页缓存,此函数见include/forum.func.php 157行,主要是处理index.htm //下面一段就是判断是否过期咯,如果过期,就删除index.htm,否则读取文件,并根据系统配置决定是否显示debug信息 if($timestamp - $indexcache['filemtime'] > $cacheindexlife) { @unlink($indexcache['filename']); define('CACHE_FILE', $indexcache['filename']); $styleid = $_DCACHE['settings']['styleid']; } elseif($indexcache['filename']) { @readfile($indexcache['filename']); $debug && debuginfo(); $debug ? die('<mce:script type="text/javascript"><!-- document.getElementById("debuginfo").innerHTML = " '.($debug ? 'Updated at '.gmdate("H:i:s", $indexcache['filemtime'] + 3600 * 8).', Processed in '.$debuginfo['time'].' second(s), '.$debuginfo['queries'].' Queries'.($gzipcompress ? ', Gzip enabled' : '') : '').'"; // --></mce:script>') : die(); } } //$validdays?用户组有效时间? $validdays = $discuz_uid && !empty($groupexpiry) && $groupexpiry >= $timestamp ? ceil(($groupexpiry - $timestamp) / 86400) : 0; //是否显示在线情况 if(isset($showoldetails)) { switch($showoldetails) { case 'no': dsetcookie('onlineindex', 0, 86400 * 365); break; case 'yes': dsetcookie('onlineindex', 1, 86400 * 365); break; } } else { $showoldetails = false; } $currenttime = gmdate($timeformat, $timestamp + $timeoffset * 3600);//当前时间 $lastvisittime = gmdate("$dateformat $timeformat", $lastvisit + $timeoffset * 3600);//上次访问时间 $memberenc = rawurlencode($lastmember);//最后注册用户-对URL进行了编码 $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;//这个变量不知道干啥的? $rsshead = $rssstatus ? ('<link rel="alternate" type="application/rss+xml" title="'.$bbname.'" href="'.$boardurl.'rss.php?auth='.$rssauth." mce_href="'.$boardurl.'rss.php?auth=&#