今天在弄独立模型的时候发现文章无法生成上下篇的链接,看了一下代码,是因为没有对独立表进行操作。
打开/include/arc.archives.class 找到 prenext函数修改
复制代码
$next = (is_array($nextR) ? " where arc.id={$nextR['id']} " : ' where 1>2 ');
$pre = (is_array($preR) ? " where arc.id={$preR['id']} " : ' where 1>2 ');
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,
t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath
from `dede_archives` arc left join dede_arctype t on arc.typeid=t.id ";
替换为:
复制代码
$next = $pre = "";
//添加对独立表的支持 by korui
if($this->ChannelUnit->ChannelInfos['issystem']!=-1)
{
$next .= (is_array($nextR) ? " where arc.id={$nextR['id']} " : ' where 1>2 ');
$pre .= (is_array($preR) ? " where arc.id={$preR['id']} " : ' where 1>2 ');
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,
t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath
from `dede_archives` arc left join dede_arctype t on arc.typeid=t.id ";
}
else
{
$next .= (is_array($nextR) ? " where arc.aid={$nextR['id']} " : ' where 1>2 ');
$pre .= (is_array($preR) ? " where arc.aid={$preR['id']} " : ' where 1>2 ');
$query = "Select arc.aid as id,arc.title,arc.typeid,arc.senddate,arc.arcrank,
t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath
from `".$this->ChannelUnit->ChannelInfos['addtable']."` arc left join dede_arctype t on arc.typeid=t.id ";
}
0536-8800925