query("SELECT main.*, field.* FROM ".tname('blog')." main LEFT JOIN ".tname('blogfield')." field ON field.blogid=main.blogid WHERE ".implode(' AND ', $wherearr)." ORDER BY main.{$order} $sc LIMIT 0,$shownum"); $bloglist = array(); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $value['message'] = getstr($value['message'], 86, 0, 0, 0, 0, -1); $value['subject'] = getstr($value['subject'], 50, 0, 0, 0, 0, -1); $bloglist[] = $value; } if($_SGLOBAL['network']['blog']['cache']) { swritefile($cachefile, serialize($bloglist)); } } foreach($bloglist as $key => $value) { realname_set($value['uid'], $value['username']); $bloglist[$key] = $value; } //图片 $cachefile = S_ROOT.'./data/cache_network_pic.txt'; if(check_network_cache('pic')) { $piclist = unserialize(sreadfile($cachefile)); } else { $sqlarr = mk_network_sql('pic', array('picid', 'uid'), array('hot'), array('dateline'), array('dateline','hot') ); extract($sqlarr); //显示数量 $shownum = 28; $piclist = array(); $query = $_SGLOBAL['db']->query("SELECT album.albumname, album.friend, space.username, space.name, space.namestatus, main.* FROM ".tname('pic')." main LEFT JOIN ".tname('album')." album ON album.albumid=main.albumid LEFT JOIN ".tname('space')." space ON space.uid=main.uid WHERE ".implode(' AND ', $wherearr)." ORDER BY main.{$order} $sc LIMIT 0,$shownum"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if(empty($value['friend'])) { $value['pic'] = pic_get($value['filepath'], $value['thumb'], $value['remote']); $piclist[] = $value; } } if($_SGLOBAL['network']['pic']['cache']) { swritefile($cachefile, serialize($piclist)); } } foreach($piclist as $key => $value) { realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']); $piclist[$key] = $value; } //话题 $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 = 8; $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')) { $pol |