就是资讯里的页面。游客身份打开文章后,包括附件也是不能下载的。
是不是要改 viewnews.php 这个页面啊?
我查了下,觉得是这段代码对游客身份进行识别,然后不给附件下载权限,包括缩略图也是。
if ($listcount > 1) {
$urlarr = array('action'=>'viewnews', 'itemid'=>$itemid);
$multipage = multi($listcount, 1, $page, $urlarr, 0);
} else {
if($page == 1 && $news['haveattach']) {
$query = $_SGLOBAL['db']->query('SELECT * FROM '.tname('attachments').' WHERE itemid=\''.$itemid.'\'');
while ($attach = $_SGLOBAL['db']->fetch_array($query)) {
if(strpos($news['message'], $attach['thumbpath']) === false && strpos($news['message'], $attach['filepath']) === false && strpos($news['message'], 'batch.download.php?aid='.$attach['aid']) === false) {
$attach['filepath'] = A_URL.'/'.$attach['filepath'];
$attach['thumbpath'] = A_URL.'/'.$attach['thumbpath'];
$attach['url'] = S_URL.'/batch.download.php?aid='.$attach['aid'];
$news['attacharr'][] = $attach;
}
}
}
} |