diabliyo

rss_feed_gen.php

Jun 26th, 2012
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.32 KB | None | 0 0
  1. <?php
  2. #
  3. # RSS Feed PHP
  4. # M.S.I Angel Cantu Jauregui
  5. # Date Mar 2, 2009 17:21
  6. #
  7.  
  8. include( "admin/config.php" );
  9. include( "modulos/base.php" );
  10. include( "admin/tema.php" );
  11. include( "admin/desktop_functions.php" );
  12.  
  13. deamon_logd(); # recolector de visitas y sesiones
  14.  
  15. header( 'Content-Type: text/xml; charset=UTF-8');
  16. # header( 'Content-Type: text/html; charset=ISO-8859-4');
  17. echo '<?xml version="1.0" encoding="UTF-8"?>
  18. <?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2spanishfull.xsl"?>
  19. <?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?>
  20. <rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">';
  21.  
  22. //echo "<rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' version='2.0'>";
  23.  
  24. echo '<channel>';
  25. echo '<title>'. TITULO_WEB. '</title>
  26. <link>http://'. $_SERVER['HTTP_HOST']. '</link>
  27. <description>'. consultar_datos_general( "SERVER_CONFIG", "ID='1'", "META_DESCRIPCION" ). '</description>';
  28. //<lastBuildDate>Tue, 02 Feb 2010 09:53:15 +0000</lastBuildDate>
  29. echo '<generator>http://onefloor.sie-group.net/?v='. VERSION. '</generator>
  30. <language>es</language>
  31. <sy:updatePeriod>hourly</sy:updatePeriod>
  32. <sy:updateFrequency>1</sy:updateFrequency>
  33.  
  34. <itunes:summary>'. consultar_datos_general( "SERVER_CONFIG", "ID='1'", "META_DESCRIPCION" ). '</itunes:summary>
  35. <itunes:author>'. TITULO_WEB. '</itunes:author>
  36. <itunes:explicit>yes</itunes:explicit>
  37. <itunes:image href="http://'. $_SERVER['HTTP_HOST']. '/'. TEMA_URL. '/banners/'. consultar_datos_general( "SERVER_CONFIG", "ID='1'", "BANNER" ). '" />
  38. <managingEditor>'. consultar_datos_general( "USUARIOS", "TIPO_USR='Administrador'", "EMAIL" ). ' ('. consultar_datos_general( "USUARIOS", "TIPO_USR='Administrador'", "NOMBRE" ). ')</managingEditor>
  39. <copyright>'. date( "Y", time()). '</copyright>
  40. <itunes:subtitle>'. noticia_cortada(consultar_datos_general( "SERVER_CONFIG", "ID='1'", "META_DESCRIPCION" ), 255). '</itunes:subtitle>
  41. <itunes:keywords>'. noticia_cortada(consultar_datos_general( "SERVER_CONFIG", "ID='1'", "META_CLAVES" ), 255 ). '</itunes:keywords>';
  42.  
  43. //<image>
  44. // <title>Kafelog</title>
  45. // <url>http://www.kafelog.com/wp-content/themes/kafelog2/images/kafelog.jpg</url>
  46. // <link>http://www.kafelog.com</link>
  47. //</image>
  48.  
  49. //<feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="kafelog" />
  50. echo '<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://'. $_SERVER['HTTP_HOST']. '/rss.php" />';
  51. //<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" />
  52. echo '<itunes:owner><itunes:email>'. consultar_datos_general( "USUARIOS", "TIPO_USR='Administrador'", "EMAIL" ). '</itunes:email>
  53. <itunes:name>'. TITULO_WEB. '</itunes:name></itunes:owner>
  54. <itunes:category text="Technology"><itunes:category text="Tech News" /></itunes:category>';
  55. //<itunes:category text="Comedy" /><itunes:category text="TV &amp; Film" />
  56. //<itunes:category text="Games &amp; Hobbies">
  57. //<itunes:category text="Video Games" /></itunes:category>
  58. echo '<itunes:category text="Technology">
  59. <itunes:category text="Gadgets" /></itunes:category>
  60. <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
  61. <feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http://'. $_SERVER['HTTP_HOST']. '/rss.php" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare>
  62. ';
  63.  
  64. # $cons= consultar_enorden( "NOTICIAS", "FECHA DESC" );
  65. $cons= consultar_limite_enorden( "NOTICIAS", "0, 24", "FECHA DESC");
  66.  
  67. while( $buf= mysql_fetch_array($cons) )
  68. {
  69. echo '<item>
  70. <title>'. desproteger_cadena_xml($buf["TITULO"]). '</title>
  71. <link>'. url_amigable($buf["ID"], $buf["TITULO"], "contenido", 0). '</link>';
  72. if( $buf["IMAGENES_NOMBRE"] )
  73. {
  74. $ext= substr( strtolower($buf["IMAGENES_NOMBRE"]), -3 ); # extraemos extencion
  75. $img= substr( $buf["IMAGENES_NOMBRE"], 0, -4 ). '_post.'. $ext; # extraemos nombre real
  76. echo '
  77. <images>
  78. <url>'. HTTP_SERVER.$tmp["IMAGENES_URL"].$img. '</url>
  79. <link>'. url_amigable($buf["ID"], $buf["TITULO"], "contenido", 0). '</link>
  80. </images>
  81. ';
  82. }
  83. echo '<comments>'. url_amigable($buf["ID"], $buf["TITULO"], "contenido", 0). '</comments>
  84. <pubDate>'. date( "D, d M Y h:i:s", $buf["FECHA"] ). ' GMT</pubDate>
  85. <dc:creator>'. consultar_datos_general( "USUARIOS", "ID='". $buf["AUTOR"]. "'", "email" ). '</dc:creator>';
  86. //<category><![CDATA[Kafelog Podcast]]></category>
  87. //<category><![CDATA[070]]></category>
  88. //<category><![CDATA[anime]]></category>
  89. //<category><![CDATA[bakuman]]></category>
  90. //<category><![CDATA[beck]]></category>
  91. //<category><![CDATA[como conoci a vuestra madre]]></category>
  92. //<category><![CDATA[fotos personales]]></category>
  93. //<category><![CDATA[frotteurismo]]></category>
  94. //<category><![CDATA[gallinas]]></category>
  95. //<category><![CDATA[kafelog]]></category>
  96. //<category><![CDATA[manga]]></category>
  97. //<category><![CDATA[redes sociales]]></category>
  98. //<category><![CDATA[sexo]]></category>
  99.  
  100. #echo '<guid isPermaLink="false">http://'. $_SERVER['HTTP_HOST']. '/?hoja='. $buf["ID"]. '</guid>
  101. #<description><![CDATA['. proteger_cadena(noticia_cortada( strip_tags(desproteger_cadena_xml($buf["MENSAJE"])), 255 )). ']]></description>';
  102.  
  103. echo '<guid isPermaLink="false">'. url_amigable($buf["ID"], $buf["TITULO"], "contenido", 0). '</guid>
  104. <description><![CDATA['. strip_tags(desproteger_cadena_xml($buf["MENSAJE"])). ']]></description>';
  105. //<wfw:commentRss>http://www.kafelog.com/2010/02/podcast-070/feed/</wfw:commentRss>
  106. //<slash:comments>6</slash:comments>
  107.  
  108. if( strcmp( $buf["ARCHIVOS_NOMBRE"], "" ) && strcmp( $buf["ARCHIVOS_NOMBRE"], "0" ) )
  109. {
  110. if( strstr( $buf["ARCHIVOS_NOMBRE"], ".mp3" ) )
  111. echo '<enclosure url="http://'. $_SERVER['HTTP_HOST']. '/'. $buf["ARCHIVOS_URL"].$buf["ARCHIVOS_NOMBRE"]. '" length="'. filesize($buf["ARCHIVOS_URL"].$buf["ARCHIVOS_NOMBRE"]). '" type="audio/mpeg" />';
  112. }
  113. //<itunes:keywords>070,anime,bakuman,beck,como conoci a vuestra madre,fotos personales,frotteurismo,gallinas,kafelog,Kafelog Podcast,manga,redes sociales</itunes:keywords>
  114. echo '<itunes:subtitle>'. noticia_cortada(strip_tags(desproteger_cadena_xml($buf["MENSAJE"])), 250). '</itunes:subtitle>
  115. <itunes:summary>'. noticia_cortada(strip_tags(desproteger_cadena_xml($buf["MENSAJE"])), 250). '</itunes:summary>
  116. <itunes:author>'. consultar_datos_general( "USUARIOS", "ID='". $buf["AUTOR"]. "'", "NOMBRE" ). '</itunes:author>
  117. <itunes:explicit>yes</itunes:explicit>';
  118. //<itunes:duration>1:01:41</itunes:duration>
  119. echo '</item>';
  120. }
  121.  
  122. echo '</channel>';
  123. echo '</rss>';
  124. unset($buf);
  125. limpiar($cons);
  126. ?>
Advertisement
Add Comment
Please, Sign In to add comment