直接上代码: 打开/include/taglib/likearticle.lib.php,找到下面的代码,找到这段代码: if ($keyword != ‘‘ )
{ ……
WHERE arc.arcrank>-1 AND $typeid $orderquery limit 0, $row";
}
修改为: if($keyword != ‘‘) { if(!empty($typeid)) { $typeid ="AND arc.typeid IN($typeid) AND arc.id<>‘$aid‘ "; } $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp ON arc.typeid=tp.id where arc.arcrank>-1 AND ($keyword) $typeid AND arc.id<>‘$aid‘ $orderquery limit 0, $row"; } else { if(!empty($typeid)) { $typeid = " arc.typeid IN($typeid) AND arc.id<>‘$aid‘ "; } $query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule, tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath FROM `dede_archives` arc LEFT JOIN `dede_arctype` tp ON arc.typeid=tp.id WHERE arc.arcrank>-1 AND $typeid AND arc.id<>‘$aid‘ $orderquery limit 0, $row"; }
放到模板里面使用就可以了。 |