Código HTML:
<gallery title="Navdeeps Gallery" thumbDir="img/galeria/thumb/" imageDir="img/galeria/" random="False"> <category name=""> </category> <category name=""> </category> <category name=""> </category> </gallery>
aqui dejo el codigo:
Código PHP:
$texto="<gallery title=\"Navdeeps Gallery\" thumbDir=\"img/galeria/thumb/\" imageDir=\"img/galeria/\" random=\"False\">\n";
$maximcat="SELECT Max(id) FROM xmlcategories";
$maximcat=mysql_query($maximcat);
$maximcat=mysql_result($maximcat,0,0);
for ($i = 1; $i <= $maximcat; $i++){
$nomcat="SELECT name,dbase FROM xmlcategories WHERE id='$i'";
$nomcat=mysql_query($nomcat);
$nomcat=mysql_fetch_object($nomcat,0,0);
$texto.="<category name=\"$nomcat->name\">\n";
$maximimg="SELECT Max(id) FROM $nomcat->dbase";
$maximimg=mysql_query($maximimg);
$maximimg=mysql_result($maximimg,0,0);
for ($x = 1; $x <= $maximimg; $x++){
$texto.="<image>\n";
$base=$nomcat->dbase;
$datos="SELECT date,title,thumb,img FROM $base WHERE id='$x'";
$datos=mysql_query($datos);
$datos=mysql_fetch_object($datos,0,0);
$texto.="<date>$datos->date</date>\n";
$texto.="<title>$datos->title</title>\n";
$texto.="<desc>$datos->title</desc>\n";
$texto.="<thumb>$datos->thumb</thumb>\n";
$texto.="<img>$datos->img</img>\n";
$texto.="</image>\n";
}
$texto.="</category>\n";
}
$texto.="</gallery>\n";
//echo $texto;
$name_file="gallery_micropixel.xml";
$file=fopen($name_file,"w+");
fwrite ($file,$texto);
fclose($file);
agredezco la ayuda merciii...