麻雀的确可爱,它的脑袋很小,只有栗子那么大,眼晴虽小却非常有神,它的身体小巧成蛋状流线型,放在手上只占手掌的一半。它浑身长着灰褐色羽毛,和树皮色相似,是一种保护色,它颈部和腹部的毛发白,显得很匀称,它的尾巴像半张开的小扇子。它飞得很快,也很有趣,那么一窜窜的。
DedeCMS一个SEO优化重要标签likearticle,根据标题、关键字调用本栏目下的相似文章。这意味着为某文章增加了许多带“长尾关键词”的文章,内容相关度增强,为网站增加PV。缺点是不能调用全站相似文章,不支持order by排序属性,做如下修改:
likearticle全站调用相似文章
打开/include/taglib/likearticle.lib.php,找到
$typeid = " And arc.typeid in($typeid) And arc.id<>$arcid "; |
修改为
$typeid = " And arc.id<>$arcid "; |
likearticle支持order by排序
继续找到
extract($ctag->CAttribute->Items, EXTR_SKIP); $revalue = "; |
下面添加
$orderby=$ctag->GetAtt('orderby'); |
找到
if( empty($arcid) || $byabs==0 ) { $orderquery = " order by arc.id desc "; } else { $orderquery = " order by ABS(arc.id – ".$arcid.") "; } |
修改为
$orderquery = "; if($orderby=='hot' || $orderby=='click') $orderquery = " order by arc.click $orderWay"; else if($orderby == 'sortrank' || $orderby=='pubdate') $orderquery = " order by arc.sortrank $orderWay"; else if($orderby == 'id') $orderquery = " order by arc.id $orderWay"; else if($orderby == 'near') $orderquery = " order by ABS(arc.id – ".$arcid.")"; else if($orderby == 'lastpost') $orderquery = " order by arc.lastpost $orderWay"; else if($orderby == 'scores') $orderquery = " order by arc.scores $orderWay"; else if($orderby == 'rand') $orderquery = " order by rand()"; else if($orderby == 'weight') $orderquery = " order by arc.weight asc";//如果没有特定设置排序则按照权重先排序 else $orderquery = " order by arc.sortrank $orderWay"; |
以上就是DedeCMS标签likearticle调用全站相关文章支持排序。永远比对手快一步。更多关于DedeCMS标签likearticle调用全站相关文章支持排序请关注haodaima.com其它相关文章!