dedecms織夢文章管理系統SEO功能優化的幾個小技巧

來源:互聯網
上載者:User

仲介交易 HTTP://www.aliyun.com/zixun/aggregation/6858.html">SEO診斷 淘寶客 雲主機 技術大廳

 dedecms織夢文章管理系統的使用功能中的部分調整,使用技巧,對於SEO優化,功能擴展都很有效果,有使用織夢的朋友,可以看看,本人在蘇州SEO使用了織夢dedecms系統,效果還不錯。 也是搜集了一些網上公佈的功能調整的小技巧與大家分享。

1、在{dede:artlist}{/dede:artlist}中把time的顯示格式由0000-00-00改為其他格式
[field:pubdate function='strftime("%m-%d",@me)'/] 格式00-00
[field:pubdate function='strftime("%m/%d",@me)'/] 格式00/00
[field:pubdate function='strftime("%y/%m/%d",@me)'/] 0000/00/00
2、欄目名稱邊上加(文章條數)功能
方法: 打開 \include\inc_arcpart_view.php 在 "//獲得一個類目的連結資訊" 下面找到
if(!is_array($row)) return "";
在其上面加上兩行:
$countarc = $this->dsql->GetOne("Select count(ID) as dd From #@__archives where typeid='$typeid'");
$row['totalarc']=$countarc['dd'];
然後 在 模版的 [field:typename /] 後加上 ( [field:totalarc /] ) 調用即可!

3、相關文章更相關的修改方法
相關的含義是:文章的關鍵字和其它文章的關鍵字相同或者文章的關鍵字在其它文章題目中。
在inc_fun_SpGetArcList.php中可以看出來
$orwhere .= " And CONCAT(arc.title,arc.keywords) REGEXP '$rstr' ";
原帖mylove2046寫的:
"相關文章"的正確修改方法
無論是V3版還是V4版,"相關文章"都不相關,修改方法如下:
includeinc_archives_view.php
在第330行附近找到
if($tagname=="likeart") $keywords = ""; str_replace(" ",",",trim($this->Fields['keywords']));
改為
if($tagname=="likeart") $keywords = str_replace(" ",",",trim($this->Fields['keywords']));
在335行附近找到
else if($tagname=="likeart") $orderby = "near";
改為
else if($tagname=="likeart") $orderby = "id";

其實改動一下代碼和系統組態,其它配置裡面的系統變數,使用關鍵字關連文章:

if($tagname=="likeart") $keywords = ""; str_replace(" ",",",trim($this->Fields['keywords']));
改為
if($tagname=="likeart") $keywords = str_replace(" ",",",trim($this->Fields['keywords']));

4、dedecms會員登錄後修改個人資料報錯
現象
member\index_do.php on line 262
解決辦法
在 $dsql->SetQuery($query);之前加上一段
$dsql = new DedeSql();

5、Tag加連結
{dede:field name='keywords' runphp='yes' }
if(!empty(@me)){
$kws = explode(' ',@me);
@me = "";
foreach($kws as $k){
@me .= "<a href='/plus/search.php?keyword=$k' target='blank'>$k</a> ";
}
@me= str_replace('+', ' ',trim(@me));
}
{/dede:field}

6、欄目合併:
update dede_archives set typeid=新ID where typeid=原ID
update dede_addonarticle set typeid=新ID where typeid=原ID

6、新文章帶NEW
[field:senddate runphp='yes']
$ntime = time();
$oneday = 3600 * 24;
if(($ntime - @me)<$oneday) @me = "<font color='red'>[new]</font>";
else @me = "";
[/field:senddate]

7、LOOP標記調用最新評論
{dede:loop table="dede_feedback" sort="dtime" row="5"}
<a href='HTTP://xxxxx/plus/view.php?aid=[field:aid /]' target="_blank" title='文章標題:[field:arctitle/]
評論時間:[field:dtime function="GetDateMk('@me')"/]
發佈作者:[field:username /]'>
[field:msg function="cn_substr('@me',50)" /]
</a>
<br>
{/dede:loop}

來源:demoseo

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.