dedecms文章怎么同步发到我的微博?
dedecms网站想在微博发信息吗,难道是通过dede标签?NO NO NO只要利用feed找到更新文章,指定feed地址就可以成功关联,即可网站跟微博便能同步.
第一步: 修改dede模板www.phpfensi.com,先建立生成全站XML的php程序,新建feed.php:
<?php require_once (dirname( __FILE__ ) . "/include/common.inc.php" ); require_once DEDEINC. "/arc.partview.class.php" ; $pv = new PartView(); //开源软件:phpfensi.com $pv ->SetTemplet( $cfg_basedir . $cfg_templets_dir . "/feed.htm" ); header( "Content-type:application/xml" ); $pv ->Display(); ?>此时注意:模板的路径,确保在模板跟目录能够找到feed.htm.
第二步: 建立feed.htm模板
<? xml version = "1.0" encoding = "gb2312" ?> < rss version = "2.0" > < channel > < title > {dede:global.cfg_webname/} </ title > < link > {dede:global.cfg_basehost/} </ link > < description > {dede:global.cfg_description/} </ description > < language > zh-cn </ language > < generator > {dede:global.cfg_webname/} </ generator > < webmaster > {dede:global.cfg_adminemail/} </ webmaster > {dede:arclist row =’60′ col =’1′ titlelen =’100′ orderby =’pubdate’} < item > < link > [field:arcurl/] </ link > < title > <![CDATA[[field:title function='html2text(@me)'/]]]> </ title > < author > [field:writer/] </ author > < category > [field:typename/] </ category > < pubDate > [field:pubdate function = 'strftime("%a, %d %b %Y %H:%M:%S +0800",@me)' /] </ pubDate > < guid > [field:arcurl/] </ guid > < description > <![CDATA[[field:description function='html2text(@me)'/] … ]]> </ description > </ item > {/dede:arclist} </ channel > </ rss >第三步: 修改index.htm,加入此代码:
<link rel="alternate" type="application/rss+xml" href="" title="你的标题" />
这样就可以织梦dedecms网站更新同步微博更新了.
查看更多关于dedecms文章怎么同步发到我的微博? - DeDecms的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did5804