Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/03/2010, 19:03
Avatar de backend
backend
 
Fecha de Ingreso: mayo-2004
Ubicación: chile
Mensajes: 135
Antigüedad: 20 años
Puntos: 0
Exclamación Precarga XML en PHP!!!

Hola estimados
La verdad no se donde poner este tema pero me parecio que aca en php ya que de eso se trata...

Haber resulta que tengo un script en php que me carga archivos XML la intencion es cargar feeds...
Pero quiero ver si se puede hacer una especie de precarga de esos xml ya que la web no abre hasta que recoge todos los feeds...

Osea lo que quiero es que la pagina abra pero cuando abra que aparezca cargando feeds o algo asi ...
Ej: http://www.cristalab.com/files/ejemplos/rssReaderAjax/

No se si me explico
Haber les dejo el codigo del script y la web para que vean a que me refiero.
http://www.chileinforma.co.c


A TODO lo que aparece en el centro de la pagina son feeds cargados!
aca el codigo que quiero hacer que precargue
Código PHP:
<?php
function ShowOneRSS($url) {
$rss = new lastRSS;
$rss->cp 'ISO-8859-1';  // Definimos la códificación de nuestro sitio web.
$rss->items_limit 4// Definimos el número de titulos a desplegar.
$rss->stripHTML True// Eliminamos el HTML del RSS
$rss->CDATA 'strip'// Eliminamos la información CDATA
    
if ($rs $rss->get($url)) {
        echo 
"<big><b><a href=\"$rs[link]\">$rs[title]</a></b></big><br />\n";
        echo 
"$rs[description]<br />\n";

            echo 
"<ul>\n";
            foreach (
$rs['items'] as $item) {
                echo 
"\t<li><a href=\"$item[link]\"><br><br>".$item['title']."</a><br>".$item['description']."<br></li>\n";
            }
            if (
$rs['items_count'] <= 0) { echo "<li>Lo sentimos, no hemos encontrado Rss para este Feed :-(</li>"; }
            echo 
"</ul>\n";
    }
    else {
        echo 
"Sorry: It's not possible to reach RSS file $url\n<br />";
        
// you will probably hide this message in a live version
    
}
}

// ===============================================================================

// incluir lastRSS
include "./lastRSS.php";

// Lista de RSS

$rss_left = array(
    
'http://teletrece.canal13.cl/t13/html/Itplqrss_chile_tpl.html',
    
'http://www.cooperativa.cl/prontus_nots/site/tax/rss/all/6_0_0.xml'
);
$rss_right = array(
    
'http://www.lanacion.cl/noticias/site/tax/port/all/rss____1.xml',
    
'http://rss.emol.com/rss.asp'
);

// Create lastRSS object
$rss = new lastRSS;

// Set cache dir and cache time limit (5 seconds)
// (don't forget to chmod cahce dir to 777 to allow writing)
$rss->cache_dir './temp';
$rss->cache_time 1200;


// Show all rss files
echo "<table cellpadding=\"10\" border=\"0\"><tr><td width=\"50%\" valign=\"top\">";
foreach (
$rss_left as $url) {
    
ShowOneRSS($url);
}
echo 
"</td><td width=\"50%\" valign=\"top\">";
foreach (
$rss_right as $url) {
    
ShowOneRSS($url);
}
echo 
"</td></tr></table>";
?>