Advertisement
diabliyo

rss_feed_gen.php

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