linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file rss2.php

Documentation is available at rss2.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage public
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. include_once('../config/define.php');
  12. include_once('../lib/no_cache.php');
  13. distInclude('../public/'.SQL.'.inc.php'THEME_PUBLIC_DIST);
  14. include_once('../languages/' U_L'/lang_common.' CHARSET '.php');
  15.  
  16. $data=$sql_object -> DBSelect(SQL_getRSS2formatedNews());
  17.  
  18. $content='';
  19. if($data!=0{
  20.  
  21.   for($i=0$i<count($data)$i++{
  22.     $news_id=$data[$i]['news_id'];
  23.     $news_title=$data[$i]['news_title'];
  24.     $news_posted_by=$data[$i]['user_login'];
  25.     $news_header=$data[$i]['news_header'];
  26.     $news_body=$data[$i]['news_body'];
  27.     $news_theme=$data[$i]['theme_name'];
  28.     $news_date=date_rfc2822($data[$i]['news_published_date_display']);
  29.     $link_news=array ('rub'=>$GLOBALS['links'][U_L]['news']['linkvalue']'id'=>$news_id'name' => $news_title);
  30.     
  31.     if(!empty($news_header)) $news_content $news_header;
  32.     else   $news_content $news_body;
  33.  
  34.     $content.='<item>'.END_LINE;
  35.     $content.='    <title>'.$news_title.'</title>'.END_LINE;
  36.     $content.='    <link>'.CURRENT_APP_URL HrefMaker($link_news).'</link>'.END_LINE;
  37.     $content.='    <pubDate>'.$news_date.'</pubDate>'.END_LINE;
  38.     $content.='    <category>'.$news_theme.'</category>'.END_LINE;
  39.     $content.='    <guid isPermaLink="false">'.$news_id.'@'CURRENT_APP_URL .'</guid>'.END_LINE;
  40.     $content.='    <description>'.END_LINE;
  41.     $content.='    <![CDATA[ '.$news_header.' ]]>';
  42.     $content.='    </description>'.END_LINE;
  43.     $content.='    <content:encoded><![CDATA['.$news_body.']]></content:encoded>';
  44.     $content.='</item>'.END_LINE;
  45.   }
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52. /**
  53.  * HEADER RSS
  54.  ****************************************************************/
  55.  
  56. header('Content-Type: application/rss+xml');
  57. echo '<?xml version="1.0" encoding="UTF-8"?>';
  58. echo '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
  59.     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  60.     xmlns:admin="http://webns.net/mvcb/"
  61.     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  62.     xmlns:atom="http://www.w3.org/2005/Atom" 
  63.     xmlns:content="http://purl.org/rss/1.0/modules/content/">'.END_LINE;
  64.  
  65. echo '<channel>'.END_LINE;
  66. echo '    <title>'.SITE_NAME.'</title>'.END_LINE;
  67. echo '    <link>'.CURRENT_APP_URL.'</link>'.END_LINE;
  68. echo '    <atom:link href="'.CURRENT_APP_URL.'rss2.php" rel="self" type="application/rss+xml" />'.END_LINE;
  69. echo '    <description>'.CURRENT_APP_URL.'</description>'.END_LINE;
  70. echo '    <language>'.strtolower(U_L).'</language>'.END_LINE;
  71. echo '    <copyright>Copyright '.date('Y').' - '.SITE_NAME.'</copyright>'.END_LINE;
  72. echo '    <managingEditor>'.SITE_MAIL.'</managingEditor>'.END_LINE;
  73. echo '    <webMaster>'.SITE_MAIL.'</webMaster>'.END_LINE;
  74. echo '    <lastBuildDate>'.date('r').'</lastBuildDate>'.END_LINE;
  75. echo '    <generator>'.SITE_LINEA_NAME.'</generator>'.END_LINE;
  76. echo '    <sy:updatePeriod>hourly</sy:updatePeriod>'.END_LINE;
  77. echo '    <sy:updateFrequency>1</sy:updateFrequency>'.END_LINE;
  78. echo '    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>'.END_LINE;
  79. echo '    <image>'.END_LINE;
  80. echo '        <url>http://www.linea21.com/logo_linea.gif</url>'.END_LINE;
  81. echo '      <link>http://www.linea21.com</link>'.END_LINE;
  82. echo '        <title>linea21.com</title>'.END_LINE;
  83. echo '    </image>'.END_LINE;
  84.  
  85.  
  86.  
  87. echo $content;
  88.  
  89.  
  90. /**
  91.  * FOOTER RSS
  92.  **********************************************************/
  93.  
  94. echo '</channel>'.END_LINE;
  95. echo '</rss>';
  96. ?>

Documentation generated on Thu, 20 Mar 2014 16:49:28 +0100 by phpDocumentor 1.4.1