Cita:
He intentado ver que es lo que mapas pero no hallo el problema, espero que me ayuden para poder tenerlo validado.his feed does not validate.
*
line 2, column 0: Undefined root element: gallery [help]
<gallery>
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.
*
"application/xml" media type is not specific enough [help]:
*
line 2, column 0: Undefined root element: gallery [help]
<gallery>
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.
*
"application/xml" media type is not specific enough [help]:
Código HTML:
<gallery> <album title="Enciclopedia" description="Imagenes de las nuevas fichas de la enciclopedia" lgPath="enciclopedia/fichas/"> <img src="manga84.jpg" title="First Girl" caption="First Girl" tn="enciclopedia/thumbs/manga84.jpg" link="http://manganimart.net/enciclopedia/manga/n84-first-girl.htm"/> <img src="manga83.jpg" title="A Cat that Loved a fish" caption="A Cat that Loved a fish" tn="enciclopedia/thumbs/manga83.jpg" link="http://manganimart.net/enciclopedia/manga/n83-a-cat-that-loved-a-fish.htm"/> <img src="manga82.jpg" title="Sekai no Chuushin de, Ai wo Sakebu" caption="Sekai no Chuushin de, Ai wo Sakebu" tn="enciclopedia/thumbs/manga82.jpg" link="http://manganimart.net/enciclopedia/manga/n82-sekai-no-chuushin-de-ai-wo-sakebu.htm"/> <img src="manga81.jpg" title="Kinjirareta Ai no Kajitsu" caption="Kinjirareta Ai no Kajitsu" tn="enciclopedia/thumbs/manga81.jpg" link="http://manganimart.net/enciclopedia/manga/n81-kinjirareta-ai-no-kajitsu.htm"/> <img src="manga80.jpg" title="Gosick" caption="Gosick" tn="enciclopedia/thumbs/manga80.jpg" link="http://manganimart.net/enciclopedia/manga/n80-gosick.htm"/> </album> </gallery>
El codigo PHP es este
Código PHP:
<? header("Content-type: text/xml");
include("../../foro/config.php");
include("../../funciones/func_foro.php");
//haciendo consulta de la base de datos
$conexion = mysql_connect($dbhost,$dbuser,$dbpasswd);
mysql_select_db($dbname,$conexion) or die('Error, No conecto');
$consulta = consulta de sql;
$resultado = mysql_query($consulta);
$myFile = "../../images.xml";
//abriendo para sobreescribir
$fh = fopen($myFile, 'w') or die("Error!!");
fwrite($fh, '<?xml version="1.0" encoding="UTF-8"?>
<gallery>
<album title="Enciclopedia" description="Imagenes de las nuevas fichas de la enciclopedia" lgPath="enciclopedia/fichas/">');
fclose($fh);
//Abriendo para escribir al final
$fhr = fopen($myFile, 'a') or die("Error!!");
//Recorriendo fichas
while($rows = mysql_fetch_array($resultado)){
if ($i <= $rows) {
//creando url amigable con una funcion especial
$url=url_amig('enciclopedia',$rows[tipo],$rows[man_id],$rows[man_name]);
//creando elemento dentro de album
$contenido ='<img src="'.substr($rows[man_imagen],43).'" title="'.$rows[man_name].'" caption="'.$rows[man_name].'" tn="'.substr($rows[man_thumb],23).'" link="'.$url.'"/>';
//escribiendo elemento
fwrite($fhr, $contenido);
$i++;
}
}
//cerrando el archivo
fclose($fhr);
$fhc = fopen($myFile, 'a') or die("Error!!");
//defino el cierre del xml
$xml_fini = '</album></gallery>';
//lo escribo en el xml
fwrite($fhc, $xml_fini);
//cierro el xml
fclose($fhc);?>