随便看看里日志部分,我把用户头像换成了日志中的图片,但是没有图片的日志调用出来出来就是个叉叉。我想应该可以在network.php的代码里的SQL查询里加个`picflag`='1'限制,但是我不知道加哪里。哪位可以告诉我,谢谢。
//日志
$cachefile = S_ROOT.'./data/cache_network_blog.txt';
if(check_network_cache('blog')) {
$bloglist = unserialize(sreadfile($cachefile));
} else {
$sqlarr = mk_network_sql('blog',
array('blogid', 'uid'),
array('hot','viewnum','replynum'),
array('dateline'),
array('dateline','viewnum','replynum','hot')
);
extract($sqlarr);
//隐私
$wherearr[] = "main.friend='0'";
//显示数量
$shownum = 6;
$query = $_SGLOBAL['db']->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;
}
|