百度新闻协议 关于图片显示的问题

所属分类: CMS教程 / dedecms 阅读数: 1870
收藏 0 赞 0 分享
关键字描述:显示 问题 图片 关于 新闻 协议 百度   " <

图片:
图片:
[attachment=16890] [attachment=16890] [attachment=16890] <?php
require_once(dirname(__FILE__)."/config.php");
if(empty($do)){
include './templets/baidunews.htm';
}else{
$baidunews = "<?xml version=\"1.0\" encoding=\"gb18030\" ?>\n";
$baidunews .= "<document>\n";
$baidunews .= "<webSite>$cfg_webname </webSite>\n";
$baidunews .= "<webMaster>$cfg_adminemail </webMaster>\n";
$baidunews .= "<updatePeri>$cfg_updateperi </updatePeri>\n";
$limit = $cfg_baidunews_limit;
if($limit > 100 || $limit < 1) $limit = 100;
$query = "select maintable.*, addtable.body, arctype.typename, arc.writer,arc.source
from [url=mailto:xkzzz_full_search]xkzzz_full_search[/url] maintable
left join [url=mailto:xkzzz_addonarticle]xkzzz_addonarticle[/url] addtable on addtable.aid=maintable.aid
left join [url=mailto:xkzzz_arctype]xkzzz_arctype[/url] arctype on arctype.ID=maintable.typeid
left join [url=mailto:xkzzz_archives]xkzzz_archives[/url] arc on arc.ID=maintable.aid
where maintable.channelid=1 order by maintable.uptime desc limit $limit
";
$dsql->SetQuery($query);
$dsql->execute();
while($row = $dsql->getarray()){
$title = htmlspecialchars($row['title']);

if(strpos($row['url'],'http://') === false){
$link = $cfg_basehost.$row['url'];
}else{
$link = $row['url'];
}
$link = htmlspecialchars($link);
$description = htmlspecialchars($row['addinfos']);
$description =str_replace("  ","", $description);//去除中文tab键产生的空白
$text = trim($row['body']);
//处理内容块;
$text =nl2br($text );
$text =strip_tags($text );
$text =str_replace("  ","", $text);
$text =str_replace("<","<", $text);
$text =str_replace(">",">", $text);
$text =str_replace("—","-", $text);
$text = preg_replace("/\ \;/i", " ", $text );
#p# 关键字描述:显示 问题 图片 关于 新闻 协议 百度   " <


$text =preg_replace("/\&hellip\;/i","",$text );
$text =str_replace(" >",">", $text);
$text =str_replace("“","'", $text);
$text =str_replace("”","'", $text);
$text = htmlspecialchars($text );
$text =preg_replace ("/(\s )/", " ", $text );
$text =preg_replace("/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/",'',$text );
//处理内容块结束;
$image = '';
$headlineimg = '';
$keywords = htmlspecialchars($row['keywords']);
$category = htmlspecialchars($row['typename']);
$author = htmlspecialchars($row['writer']);
$source = htmlspecialchars($row['source']);
$pubdate = htmlspecialchars(gmdate('Y-m-d H:i',$row['pubdate'] $cfg_cli_time * 3600));
$baidunews .= "<item>\n";
$baidunews .= "<title>$title </title>\n";
$baidunews .= "<link>$link </link>\n";
$baidunews .= "<description>$description </description>\n";
$baidunews .= "<text>$text </text>\n";
$baidunews .= "<image>$image </image>\n";
$baidunews .= "<headlineImg />\n";
$baidunews .= "<keywords>$keywords </keywords>\n";
$baidunews .= "<category>$category </category>\n";
$baidunews .= "<author>$author </author>\n";
$baidunews .= "<source>$source </source>\n";
$baidunews .= "<pubDate>$pubdate </pubDate>\n";
$baidunews .= "</item>\n";

}
$baidunews .= "</document>\n";
$fp = fopen(dirname(__FILE__).'/'.$filename,'w');
fwrite($fp,$baidunews);
fclose($fp);
showmsg("<a href='{$filename}' target=\"_blank\">{$filename}生成成功</a>",'javascript:;');
}

此内容是在坛子里的一位朋友发的.完全OK,但是生成xml 的时候,有图片的(包括有缩略图)都无法把地址显示出来
更多精彩内容其他人还在看

织梦DedeCms取消后台登陆验证码的方法示例

经常建站和做优化的站长朋友们都很清楚网站的优化和客户体验度是永远需要排在第一位的,这篇文章主要介绍了织梦DedeCms取消后台登陆验证码的方法示例,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享

织梦栏目有缓存导致刚发布的文章条数和分页不同步处理方法

这篇文章主要介绍了织梦栏目有缓存导致刚发布的文章条数和分页不同步处理方法的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享

加快织梦dedeCMS内容生成速度方法

最近有位站长朋友咨询一个十几万数据的DedeCMS系统,发现用Dedecms生成速度,慢的跟蜗牛一样,CPU达到100%,有时候半天都不动。这让大数据的网站的站长非常头疼,下面为大家解决这个问题
收藏 0 赞 0 分享

织梦dedecms的arclist循环中判断第一个li,则添加固定的css否则不加

这篇文章主要介绍了织梦dedecms的arclist循环中,判断如果是第一个li,则添加固定的css,否则不加,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

dedecms织梦模板里显示当前登录会员名

有时我们只是需要在网站某个地方显示一下当前登录的会员名字,这篇文章主要介绍了dedecms织梦模板里显示当前登录会员名,非常具有实用价值,需要的朋友可以参考下
收藏 0 赞 0 分享

dedecms织梦模板中plus文件作用介绍及安全设置详解

很多新手用户在使用织梦CMS程序过程中,难免会碰到挂马中毒现象,所以事先我们要对网站及服务器安全做好预防备份处理,这篇文章主要介绍了dedecms织梦模板中plus文件作用介绍及安全设置详解,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

详解织梦DedeCms的安全问题优化解决办法(安全设置)

这篇文章主要介绍了详解织梦DedeCms的安全问题优化解决办法(安全设置)的相关资料,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
收藏 0 赞 0 分享

详解dedecms后台编辑器将回车<br>改为<p>的方法

DEDECMS编辑器默认回车[确认键]是返回<br />这样的。有时候我们需要返回<p> </p>这样的,今天我们就讲讲后台编辑器将回车将<br>改为<p>的有效教程吧,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

解决dedecms多域名和站点的绑定的问题

dedecms可以实现多级域名,不同域名的绑定.这篇文章主要介绍了解决dedecms多域名和站点的绑定的问题,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
收藏 0 赞 0 分享

DedeCMS调用相关文章likearticle附加自定义字段

DedeCMS非常灵活,可以根据关键词、文章标题调用文章,以提高内容之间的相关度,提高页面权重。这篇文章主要介绍了DedeCMS调用相关文章likearticle附加自定义字段,非常具有实用价值,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多