本帖最后由 fyl00 于 2010-11-18 12:28 编辑
谢谢楼上老兄指点。
index.htm中已添加 network.htm中的 “站长推荐”、“竞价排名”和“在线会员” 相关代码。
index.php中也改为了index.htm作为首页。现在访问网站的首页已是index.htm.
只是 “站长推荐”、“竞价排名”和“在线会员”还是不显示。
本人不太熟悉PHP,我直接把/source/network.php 中的
//站长推荐
$star = array();
$starlist = array();
if($_SCONFIG['spacebarusername']) {
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('space')." WHERE username IN (".simplode(explode(',', $_SCONFIG['spacebarusername'])).")");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']);
$starlist[] = $value;
}
}
if($starlist) {
$star = sarray_rand($starlist, 1);
}
//竞价排名
$showlist = array();
$query = $_SGLOBAL['db']->query("SELECT sh.note, s.* FROM ".tname('show')." sh
LEFT JOIN ".tname('space')." s ON s.uid=sh.uid
ORDER BY sh.credit DESC LIMIT 0,23");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']);
$value['note'] = addslashes(getstr($value['note'], 80, 0, 0, 0, 0, -1));
$showlist[$value['uid']] = $value;
}
if(empty($star) && $showlist) {
$star = sarray_rand($showlist, 1);
}
//在线用户
$onlinelist = array();
$query = $_SGLOBAL['db']->query("SELECT s.*, sf.note FROM ".tname('session')." s
LEFT JOIN ".tname('spacefield')." sf ON sf.uid=s.uid
ORDER BY s.lastactivity DESC LIMIT 0,12");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if(!$value['magichidden']) {
$value['note'] = shtmlspecialchars(strip_tags($value['note']));
realname_set($value['uid'], $value['username']);
$onlinelist[$value['uid']] = $value;
}
}
if(empty($star) && $onlinelist) {
$star = sarray_rand($onlinelist, 1);
foreach ($star as $key => $value) {
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('space')." WHERE uid='$value[uid]'");
if ($subvalue = $_SGLOBAL['db']->fetch_array($query)) {
$star[$key] = array_merge($subvalue, $star[$key]);
}
}
}
//在线人数
$olcount = getcount('session', array());
拷到index.php中,还是不行。
可否详细一点说说index.php和index.htm中还要增加些什么语句?
|