Ver Mensaje Individual
  #5 (permalink)  
Antiguo 28/07/2005, 14:11
Avatar de MaBoRaK
MaBoRaK
 
Fecha de Ingreso: abril-2003
Ubicación: La Paz - Bolivia
Mensajes: 2.003
Antigüedad: 21 años
Puntos: 35
loading..............


Y así procedo a lanzar el rss

file: sindicar_procesador.php
Código PHP:
<?php
include("kernel.php");
logger_live();
/***************************************************************************
*                         sindicar.php
*                            -------------------
*   copyright            : (C) 2004 maborak design
*   email                : [email protected]
*   Revision Actual      : $Revision: 1.18 $
*   Ultima Modificacion  : $Date: 2005/05/15 00:36:35 $
*
*
***************************************************************************/

/***************************************************************************
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
***************************************************************************/
if(isset($_GET['sindicar']))
{
/**************************************************************************
* Definir formatos de sindicacion BEGIN
**************************************************************************/
$_formatos_de_RSS[]="rss";
$_formatos_de_RSS[]="rdf";
$_formatos_de_RSS[]="atom";
define("FORMATO",(in_array($_GET['sindicar'],$_formatos_de_RSS))?$_GET['sindicar']:"rss");
/**************************************************************************
* Definir formatos de sindicacion END
**************************************************************************/
/**************************************************************************
* Definir forma, nuevos-actualizados BEGIN
**************************************************************************/
$_forma[]="nuevo";
$_forma[]="actualizado";
if(isset(
$_GET['forma']) )
{
define("RSS_FORMA",(in_array($_GET['forma'],$_forma))?$_GET['forma']:$_forma[0]);
}
else
{
define("RSS_FORMA",$_forma[0]);
}
/**************************************************************************
* Definir forma, nuevos-actualizados END
**************************************************************************/
/**************************************************************************
* Definir por cat BEGIN
**************************************************************************/
if(isset($_GET['categoria']) )
{
define("RSS_CATEGORIA",(CATEGORIA_existe_ID($_GET['categoria'])==true)?$_GET['categoria']:false);
$_title_cat=(RSS_CATEGORIA==false)?"":"[".CATEGORIA_pedircategoria(RSS_CATEGORIA)."]";
}
else
{
define("RSS_CATEGORIA",false);
$_title_cat="";
}
/**************************************************************************
* Definir por cat END
**************************************************************************/



/*******************************************************************************
*Armando la consulta SQL BEGIN
*******************************************************************************/
$__c=(RSS_CATEGORIA==false)?" ":" WHERE categoria=".RSS_CATEGORIA;
if(
RSS_FORMA=='nuevo')
{
$__a="ID";
$_sub="[news]";
}
elseif(
RSS_FORMA=='actualizado')
{
$__a="ultimo_update";
$_sub="[updates]";
}

$_consulta_rss="SELECT * FROM ".ARTICULOS." ".$__c." ORDER BY ".$__a." DESC LIMIT ".LIMIT_RSS_WRITE;




$rss_query=SQL_query($_consulta_rss,file_name(),__LINE__);
/*******************************************************************************
*Armando la consulta SQL END
*******************************************************************************/

$titulo_rss=$_sub.$_title_cat."Leimnud";




/**************************************************************************
* Lanzamos sindicacion BEGIN
**************************************************************************/
if(FORMATO=='rss')
{
$_texto=rss_enviar("rss",$rss_query,"RSS-".$titulo_rss);
}
if(
FORMATO=='rdf')
{
$_texto=rss_enviar("rdf",$rss_query,"RDF-".$titulo_rss);
}
if(
FORMATO=='atom')
{
$_texto=rss_enviar("atom",$rss_query,"ATOM-".$titulo_rss);
}
header("Accept-Ranges: bytes");
header("Content-Length: ".strlen($_texto));
header("Content-Type: text/xml");
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Disposition: inline; filename=\"".FORMATO.".xml\";");
echo 
$_texto;
/**************************************************************************
* Lanzamos sindicacion END
**************************************************************************/
}
else
{
header("Location: ".INDEX);
exit();
}
?>

... dudas, hazmela saber con gusto ayudaré



connection closed.
__________________

Maborak Technologies