<?php
/**
XML GENERATOR
MADE BY IBRAHIM ARGUN
[URL="http://www.melibo.de"]www.melibo.de[/URL]
*/
require_once("includes/globalinclude.php");
$i = 13;
//header('Content-Type: text/xml');
header("Content-Type: text/xml; charset=UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<icons>
<?php
/*
* Define the uniform node function
*/
function GenerateNode($data){
$content = '';
$array_old = array('nbsp','iexcl','cent','pound','curren','yen','brvbar','sect','uml','copy','ordf','laquo','not','shy','reg','macr','deg','plusmn','sup2','sup3','acute','micro','para','middot','cedil','sup1','ordm','raquo','frac14','frac12','frac34','iquest','Agrave','Aacute','Acirc','Atilde','Auml','Aring','AElig','Ccedil','Egrave','Eacute','Ecirc','Euml','Igrave','Iacute','Icirc','Iuml','ETH','Ntilde','Ograve','Oacute','Ocirc','Otilde','Ouml','times','Oslash','Ugrave','Uacute','Ucirc','Uuml','Yacute','THORN','szlig','agrave','aacute','acirc','atilde','auml','aring','aelig','ccedil','egrave','eacute','ecirc','euml','igrave','iacute','icirc','iuml','eth','ntilde','ograve','oacute','ocirc','ouml','devide','oslash','ugrave','uacute','ucirc','uuml','yacute','thorn','yuml');
$array_new = array('160','161','162','163','164','165','166','167','168','169','170','171','172','173','174','175','176','177','178','179','180','181','182','183','184','185','186','187','188','189','190','191','192','193','194','195','196','197','198','199','200','201','202','203','204','205','206','207','208','209','210','211','212','213','214','215','216','217','218','219','220','221','222','223','224','225','226','227','228','229','230','231','232','233','234','235','236','237','238','239','240','241','242','245','246','247','248','249','250','251','252','253','254','255');
$xx = htmlentities($data['name']);
for($x = 0; $x < 95; $x++){
$xx = str_replace("&".$array_old[$x].";", "&#".$array_new[$x].";", $xx);
}
$content .= "\t" . '<icon image="bilder/produkte/klein/'.$data['bildurl'].'" tooltip="'.$xx.'" link="' .$data['link'].'"></icon>' . "\n";
return $content;
} # end function
$sql = "SELECT a.cName, b.cPfad, a.kArtikel, c.fVKNetto, a.cSeo
FROM tartikel a
LEFT JOIN tartikelpict b on a.kArtikel=b.kArtikel
LEFT JOIN tpreise c on a.kArtikel=c.kArtikel
WHERE a.cTopArtikel = 'Y'
GROUP BY b.kArtikel
ORDER BY rand(), b.nNr ASC";
/*
* Execute the query
*/
$query = mysql_query($sql);
if ( mysql_num_rows($query) > 0 ){
/*
* Initialize the container
*/
$container = array();
/*
* Loop query result and populate container
*/
while( $result = mysql_fetch_array($query) ){
$mwst = $result['fVKNetto']*0.20;
$preis = $result['fVKNetto']+$mwst;
$preis = number_format($preis,2, ',', '.');
$container = array('name' => $result['cName'],
'link' => $result['cSeo'],
'bildurl' => $result['cPfad'],
'preis' => $preis
);
if($i>0){//lilmit start
echo generateNode($container);
$i--;
} //limit ende
} # end while
}
?>
</icons>