本帖最后由 huluwa8899 于 2010-5-27 17:22 编辑
我把默认默认模板的 活动和话题删除了,是否需要删除source/network.php里对应部分删除?
是否需要把以下代码删除?
不删除,是不是会导致首页打开慢?- //话题
- $cachefile = S_ROOT.'./data/cache_network_thread.txt';
- if(check_network_cache('thread')) {
- $threadlist = unserialize(sreadfile($cachefile));
- } else {
- $sqlarr = mk_network_sql('thread',
- array('tid', 'uid'),
- array('hot','viewnum','replynum'),
- array('dateline','lastpost'),
- array('dateline','viewnum','replynum','hot')
- );
- extract($sqlarr);
- //显示数量
- $shownum = 10;
-
- $threadlist = array();
- $query = $_SGLOBAL['db']->query("SELECT main.*, m.tagname
- FROM ".tname('thread')." main
- LEFT JOIN ".tname('mtag')." m ON m.tagid=main.tagid
- WHERE ".implode(' AND ', $wherearr)."
- ORDER BY main.{$order} $sc LIMIT 0,$shownum");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- $value['tagname'] = getstr($value['tagname'], 20);
- $value['subject'] = getstr($value['subject'], 50);
- $threadlist[] = $value;
- }
- if($_SGLOBAL['network']['thread']['cache']) {
- swritefile($cachefile, serialize($threadlist));
- }
- }
- foreach($threadlist as $key => $value) {
- realname_set($value['uid'], $value['username']);
- $threadlist[$key] = $value;
- }
- //活动
- include_once(S_ROOT.'./data/data_eventclass.php');
- $cachefile = S_ROOT.'./data/cache_network_event.txt';
- if(check_network_cache('event')) {
- $eventlist = unserialize(sreadfile($cachefile));
- } else {
- $sqlarr = mk_network_sql('event',
- array('eventid', 'uid'),
- array('hot','membernum','follownum'),
- array('dateline'),
- array('dateline','membernum','follownum','hot')
- );
- extract($sqlarr);
- //显示数量
- $shownum = 4;
-
- $eventlist = array();
- $query = $_SGLOBAL['db']->query("SELECT main.*
- FROM ".tname('event')." main
- WHERE ".implode(' AND ', $wherearr)."
- ORDER BY main.{$order} $sc LIMIT 0,$shownum");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- $value['title'] = getstr($value['title'], 45);
- if($value['poster']){
- $value['pic'] = pic_get($value['poster'], $value['thumb'], $value['remote']);
- } else {
- $value['pic'] = $_SGLOBAL['eventclass'][$value['classid']]['poster'];
- }
- $eventlist[] = $value;
- }
- if($_SGLOBAL['network']['event']['cache']) {
- swritefile($cachefile, serialize($eventlist));
- }
- }
- foreach($eventlist as $key => $value) {
- realname_set($value['uid'], $value['username']);
- $eventlist[$key] = $value;
- }
- //投票
- $cachefile = S_ROOT.'./data/cache_network_poll.txt';
- if(check_network_cache('poll')) {
- $polllist = unserialize(sreadfile($cachefile));
- } else {
- $sqlarr = mk_network_sql('poll',
- array('pid', 'uid'),
- array('hot','voternum','replynum'),
- array('dateline'),
- array('dateline','voternum','replynum','hot')
- );
- extract($sqlarr);
- //显示数量
- $shownum = 9;
-
- $polllist = array();
- $query = $_SGLOBAL['db']->query("SELECT main.*
- FROM ".tname('poll')." main
- WHERE ".implode(' AND ', $wherearr)."
- ORDER BY main.{$order} $sc LIMIT 0,$shownum");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'], $value['username']);
- $polllist[] = $value;
- }
- if($_SGLOBAL['network']['poll']['cache']) {
- swritefile($cachefile, serialize($polllist));
- }
- }
- foreach($polllist as $key => $value) {
- realname_set($value['uid'], $value['username']);
- $polllist[$key] = $value;
- }
复制代码 还有个问题:第一次在电脑没有缓存的情况下,打开站很快,但是登陆以后,退出,再打开就会很慢,甚至打不开,是不是COOKIE的原因?
而且有时候退出很慢一直不跳转! |