function mkRSS () {
//CONFIGURATION
$news_aid = 54; //ARTICLEID OF NEWSARTICLE
$news_alias = "de_news-aktuel"; //ARTICLEALIAS OF NEWSARTICLE
$title = "RSS FEED";
$description = "Newsfeed - ".$_SERVER['SERVER_NAME'];
//END OF CONFIGURATION
//=======================================================
require_once ('config/phpwcms/conf.inc.php');
$itemTitle = "cnt_title";
$itemText = "cnt_teasertext";
$itemDate = "cnt_created";
$itemOwner = "cnt_editor";
$itemAlias = "cnt_alias";
$sql="SELECT * FROM cms_phpwcms_content WHERE cnt_module = 'news' AND cnt_status = 1 ORDER BY cnt_created DESC;";
//Erzeugen des RSS-Inhaltes: encoding='UTF-8'
$rssHeader='
'.$title.'
'.$description.'
'.$phpwcms['default_lang'].'
'.$phpwcms['site'].'
';
$rssFooter='
';
//GET DATA
$dbLink = mysql_connect ($phpwcms['db_host'],$phpwcms['db_user'],$phpwcms['db_pass']) or die (mysql_error());
$setdb = mysql_select_db($phpwcms['db_table'],$dbLink) or die (mysql_error());
$result=mysql_query($sql,$dbLink) or die(mysql_error());
$content=$rssHeader;
while($row=mysql_fetch_array($result)){
$row[$itemText] = str_replace("ü","ü",$row[$itemText]);
$row[$itemText] = str_replace("ü","ü",$row[$itemText]);
$row[$itemText] = str_replace("ö","ö",$row[$itemText]);
$row[$itemText] = str_replace("ä","ä",$row[$itemText]);
$row[$itemText] = str_replace("ä","ä",$row[$itemText]);
$row[$itemText] = str_replace("ß","ss",$row[$itemText]);
$row[$itemText] = str_replace("
","",$row[$itemText]);
$row[$itemText] = str_replace("
","",$row[$itemText]);
//$row[$itemText] = str_replace(" />",">",$row[$itemText]);
//$row[$itemText] = str_replace("
","",$row[$itemText]);
//$row[$itemText] = str_replace("","",$row[$itemText]);
//$row[$itemText] = preg_replace("()","",$row[$itemText]);
$titel=substr ($row[$itemTitle], 0, 150);
$text=substr ($row[$itemText], 0, 1000);
$itemLink= $phpwcms['site'];
$itemdate1 = date("Ymd", $row[$itemDate]);
$itemDate2 = date("D, d M Y H:i:s O", $row[$itemDate]);
$itemLink = $phpwcms['site'].'cms/index.php?'.$news_alias.'&newsdetail='.$itemdate1.'-'.$news_aid.'_'.rawurlencode($row[$itemAlias]);
$content .= "-
".$titel."
$itemLink
$row[$itemOwner]
$itemDate2
";
}
$content.=$rssFooter;
htmlspecialchars($content);
header('Content-Type: text/xml');
print($content);
return;
}
mkRSS();
?>