代理加盟 2020全新代理計劃 賺錢+省錢雙管齊下,獨立平臺,豐厚利潤!

您現在的位置: 秀站網 > 織夢大學 > 使用教程 >

DedeCMS標簽likearticle調用全站相關文章支持排序

來源:本站原創 發布時間:2019-03-30 00:00:00熱度:我要評論(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";

轉載請注明來源網址:http://www.yxrxyy.live/dedecms_jq/1386.html

    發表評論

    評論列表(條)

      北京28是什么彩票