本帖最后由 沉默的站长 于 2010-6-13 01:33 编辑
版主出来帮下-首页调用活动内容
我好像不知道代码怎么写,我network.htm里面写了调用的代码但不知道为什么不行
network.htm中代码- <div class="nboxh_c">
- <h2 class="ntitle"><span class="r_option"><a href="space.php?do=event&view=recommend">更多活动</a></span> 活动 »
- <!--{loop $_SGLOBAL[eventclass] $value}-->
- <a href="space.php?do=event&view=all&type=going&classid=$value[classid]">$value[classname]</a></li>
- <!--{/loop}-->
- </h2>
- <ul class="elist">
- <!--{loop $eventlist $value}-->
- <li>
- <h3><a href="space.php?do=event&id=$value[eventid]" target="_blank">$value[title]</a></h3>
- <p class="eimage"><a href="space.php?do=event&id=$value[eventid]" target="_blank"><img src="$value[pic]" alt=""/></a></p>
- <p><span class="gray">时间:</span> <!--{date('n-j H:i',$value[starttime])}--> - <!--{date('n-j H:i',$value[endtime])}--></p>
- <p><span class="gray">地点:</span> $value[province] $value[city] $value[location]</p>
- <p><span class="gray">发起:</span> <a href="space.php?uid=$value[uid]">{$_SN[$value[uid]]}</a></p>
- <p class="egz">$value[membernum] 人参加<span class="pipe">|</span>$value[follownum] 人关注</p>
- </li>
- <!--{/loop}-->
- </ul>
- </div>
复制代码 是不是要在index.php里面加呢。但我在index.php里面加了
index.php中代码:- //活动
- 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;
- }
复制代码 加了以后。首页就无法打开了!不知道为什么!
请大家帮下
联系QQ:85998169 小弟先谢谢了 |