Hola David
el código que utilizo para general el XML es el siguiente :
Código PHP:
//---------Reescribir el XML-----------------------
$carpeta_sel= $_POST['carpeta_sel'];
$nombre_promo= $_POST['nombre_sel'];
$tipo_galeria="Galería de imágenes (Entornos)";
$ruta_XML = "../entornos/" . $carpeta_sel . "/";
//echo $ruta_XML."-------------><br>";
//
funcion_cabecera_XML($nombre_promo,$tipo_galeria);
funcion_pie_XML();
$gestor = fopen($ruta_XML . "gallery.xml", "w");
fwrite($gestor,$cab_XML."\n");
$valor_texto="<album title=\"".$nombre_promo."\" description=\"\">\n";
fwrite($gestor,$valor_texto);
for ($kxml=0;$kxml<count($imagen);$kxml++){
$valor_texto="<image title=\"".trim($nombre_im[$kxml])."\" date=\"".trim($fecha_im[$kxml])."\" thumbnail=\"".trim($imagen[$kxml])."\" image=\"".trim($imagen[$kxml])."\">".trim($text_im[$kxml])."</image>\n";
fwrite($gestor,$valor_texto);
}
$valor_texto="</album>\n";
fwrite($gestor,$valor_texto);
fwrite($gestor, $pie_XML);
fclose($gestor);
/*------------ Fin del Código ----------------*/
tanto $cab_XML, como $pie_XML son la cabecera y el pie del fichero y no cambian, los leo de dos funciones como verás en el código. y su contenido es;
Código PHP:
/*------------ Comienzo del Código de las Funciones ----------------*/
function funcion_cabecera_XML($nombre_promo,$tipo_galeria){
global $cab_XML;
global $imagenes_grandes;
global $imagenes_peques;
$cab_XML="
<?xml version="1.0\" encoding=\"iso-8859-1\"?>
<gallery>
<!-- configure the gallery in this xml-node -->
<config>
<!-- set the title of the album -->
<title>Promoción : ".$nombre_promo." ( ".$tipo_galeria." )</title>
<!-- set the location of the thumbnails relative to the gallery.swf -->
<thumbnail_dir>../".$imagenes_peques."</thumbnail_dir>
<!-- set the actlocation of the actual high-res images relative to the gallery.swf -->
<image_dir>../".$imagenes_grandes."</image_dir>
<!-- the time interval for each image to display, this value is in seconds
default value : 5
-->
<slideshow_interval>5</slideshow_interval>
<!-- pause slideshow at start
default value : false
-->
<pause_slideshow>false</pause_slideshow>
<!-- set true if you want the application to scale the images while using RSS feeds
default value : true
-->
<rss_scale_images>true</rss_scale_images>
<!-- set the path of the mp3 file that should loop as a background music while playing the slideshow.
default value : none
-->
<background_music>Johnny Quest.mp3</background_music>
<!-- percentage of the volume to set while playing the music
default value : 50
-->
<background_music_volume>50</background_music_volume>
<!-- add links to images, and allow the views to click on images from flickr, picasa,and
view the page where the actual image is found.
If you dont want views to visit the picasa, or flickr or other sites keep this value false.
default value : false
-->
<link_images>false</link_images>
<!--
Photographers will like to disable printscreen for their pictures
to increase the security of their photographs.
Set this value to true if you wish to disable print screen in the application.
While the application is running the print screen option will be completely disabled in
all other applications that the visitor is using.
default value : false
-->
<disable_printscreen>false</disable_printscreen>
</config>
<!-- this node contains all the albums -->
<albums>
";
}
function funcion_pie_XML(){
global $pie_XML;
$pie_XML="
</albums>
<!-- language support added in v 1.0b -->
<language>
<string id=\"please wait\" value=\"Por favor espere ..-\" />
<string id=\"loading\" value=\"Cargando\" />
<string id=\"previous page\" value=\"Pagina Anterior\" />
<string id=\"page % of %\" value=\"Pagina % de %\" />
<string id=\"next page\" value=\"Pagina Siguiente\" />
</language>
</gallery>
";
}
/*------------ Fin del Código de las Funciones ----------------*/