您好,欢迎访问电脑技术吧-电脑开不了机_电脑开机黑屏_电脑开机后不显示桌面_计算机入门基础知识教程,在这里您可以从一个电脑新手转变成一个电脑高手或网络高手。

主页 | 收藏本站

当前位置:主页 > 网站源码 > dedecms问题库 >

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

关键字描述:显示 问题 图片 关于 新闻 协议 百度   " <

图片:
图片:
[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 );



本素材资源仅供个人学习与参考,请勿用于商业用途,后果由使用者自己承担...


相关阅读

电脑技术吧-电脑开不了机_电脑开机黑屏_电脑开机后不显示桌面_计算机入门基础知识教程
返回顶部