DedeCMS标签likearticle调用全站相关文章支持排序
时间:2023-08-09 12:03
浏览:0
评论:0
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";1. 本站所有资源来源于用户上传或网络,仅作为参考研究使用,如有侵权请邮件联系站长!
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. dedecms > DedeCMS标签likearticle调用全站相关文章支持排序
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. dedecms > DedeCMS标签likearticle调用全站相关文章支持排序