All pastes #809945 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-09 11:37 UTC
rendered paste body
//dfxmle_conf.php
<?php

//HEDERZ
$head1="http://purl.org/dc/elements/1.1/";

//General
$about="http://www.xml.com/cs/xml/query/q/19";
$title="Kolcsey Ferenc hirrendszer (by DjDarkman)";
$link="http://kolcsey.tx.hu/";
$description="Kolcsey Ferenc hirrendszer";
$language="en-us";
?>

//dfxml_write.php

<?php
include "news/dfxmle_conf.php";
//write head
$dxff="rss.xml";
$dxmlf=fopen($dxff,"w");
$dxcont="<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>
<rss version=\"2.0\" xmlns:dc=\"".$head1."\">
  <channel>
    <title>".$title."</title>
    <link>".$link."</link>
    <description>".$description."</description>
    <language>".$language."</language>
"
;
//contents
$c=0;
while ($c<count($links))
{
$dxcont.="<item>
    <title>".$titles[$c]."</title>
    <link>".$links[$c]."</link>
    <description>".$descriptions[$c]."</description>
    <dc:creator>".$creators[$c]."</dc:creator>
    <dc:date>".$dates[$c]."</dc:date>
  </item>
"
;
$c++;
}
$dxcont.="  </channel>
</rss>";
fwrite($dxmlf,$dxcont);
fclose($dxmlf);
?>

//news.php



// Functions
function refresh_rss() {
$p="SELECT * FROM `news` ORDER BY `id` DESC";
$sor=mysql_query($p);
  $nowpage = 0;
  $links=array();
  $titles=array();
  $descriptions=array();
  $creators=array();
  $dates=array();
  while ($s=mysql_fetch_array($sor))
  { $nowpage++;
    if ( $nowpage <= 5 )
    {
	$links[]="http://www.kolcsey.tx.hu/index.php?f=news&amp;mode=show&amp;t=".$s[id];
	$titles[]=$s[name];
	$descriptions[]=htmlspecialchars(substr($s[msg],0,256))."...";
	$creators[]="www.kolcsey.tx.hu";
	$dates[]=substr($s[date],0,10);
    } else { break; }
  }
include("news/dfxmle_write.php");
}