\n";
$baidunews .= "\n";
$baidunews .= "$cfg_webname \n";
$baidunews .= "$cfg_adminemail \n";
$baidunews .= "$cfg_updateperi \n";
$limit = $cfg_baidunews_limit;
if($limit > 100 || $limit < 1)
{
$limit = 100;
}
$query = "SELECT maintable.*, addtable.body, arctype.typename
FROM #@__archives maintable
LEFT JOIN #@__addonarticle addtable ON addtable.aid=maintable.id
LEFT JOIN #@__arctype arctype ON arctype.ID=maintable.typeid
WHERE maintable.channel=1 and maintable.arcrank!=-1 ORDER BY maintable.pubdate DESC LIMIT $limit
";
$dsql->SetQuery($query);
$dsql->Execute();
while($row = $dsql->GetArray())
{
$title = dede_htmlspecialchars($row['title']);
$row1 = GetOneArchive($row['id']);
if(strpos($row1['arcurl'],'http://') === false)
{
$link = ($cfg_basehost=='' ? 'http://'.$_SERVER["HTTP_HOST"].$cfg_cmspath : $cfg_basehost).$row1['arcurl'];
}else
{
$link = $row1['arcurl'];
}
$link = dede_htmlspecialchars($link);
$description = dede_htmlspecialchars(strip_tags($row['description']));
$text = dede_htmlspecialchars(strip_tags($row['body']));
$image = $row['litpic'] =='' ? '' :$row['litpic'];
if($image != '' && strpos($image, 'http://') === false)
{
$image = ($cfg_basehost=='' ? 'http://'.$_SERVER["HTTP_HOST"].$cfg_cmspath : $cfg_basehost).$image;
}
//$headlineimg = '';
$keywords = dede_htmlspecialchars($row['keywords']);
$category = dede_htmlspecialchars($row['typename']);
$author = dede_htmlspecialchars($row['writer']);
$source = dede_htmlspecialchars($row['source']);
$pubdate = dede_htmlspecialchars(gmdate('Y-m-d H:i',$row['pubdate'] + $cfg_cli_time * 3600));
$baidunews .= "- \n";
$baidunews .= "$title \n";
$baidunews .= "$link \n";
$baidunews .= "$description \n";
$baidunews .= "$text \n";
$baidunews .= "$image \n";
//$baidunews .= "\n";
$baidunews .= "$keywords \n";
$baidunews .= "$category \n";
$baidunews .= "$author \n";
$baidunews .= "$source \n";
$baidunews .= "$pubdate \n";
$baidunews .= "
\n";
}
$baidunews .= "\n";
$fp = fopen(dirname(__FILE__).'/'.$filename,'w');
fwrite($fp,$baidunews);
fclose($fp);
showmsg("{$filename} make success",'javascript:;');
}