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

Source for file rss.php

Documentation is available at rss.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('../config/server.php');
  13. distInclude('../public/'.SQL.'.inc.php')
  14. include_once('../languages/' LANGUAGE'/lang_common.' CHARSET '.php');
  15. include_once('../lib/items.php');
  16. include_once('../lib/lib_common.php');
  17.  
  18. ////////////////////////////////////////
  19. /// Connexion Mysql
  20. ///////////////////
  21. include_once('../class/system/class.'.SQL.'.php');
  22. $sql_entity=SQL;
  23. $sql_object new $sql_entity;
  24. $sql_object -> DBInitialise();
  25. $sql_object -> DBConnexion();
  26. ///////////////////
  27.     
  28. $data=$sql_object -> DBSelect(SQL_getRSSformatedNews());
  29.  
  30. $li_items='';
  31. $content='';
  32. if($data!=0{
  33.     
  34.     for($i=0$i<count($data)$i++{
  35.         $news_id=$data[$i]['news_id'];
  36.         $news_title=$data[$i]['news_title'];
  37.         $news_posted_by=$data[$i]['user_login'];
  38.         $news_description=$data[$i]['news_description'];
  39.         $news_theme=$data[$i]['theme_name'];
  40.         $news_date=$data[$i]['news_published_date_display'];
  41.         $link_news=array ('rub'=>$GLOBALS['links'][LANGUAGE]['news']['linkvalue']'id'=>$news_id'name' => $news_title);
  42.         
  43.         $li_items.='<rdf:li resource="'.SITE_CITY_URL.HrefMaker($link_news).'" />'.END_LINE;
  44.  
  45.  
  46.         $content.='<item rdf:about="'.SITE_CITY_URL.HrefMaker($link_news).'">'.END_LINE;
  47.         $content.='<title>'.$news_title.'</title>'.END_LINE;
  48.         $content.='<link>'.SITE_CITY_URL.HrefMaker($link_news).'</link>'.END_LINE;
  49.         $content.='<dc:date>'.$news_date.'</dc:date>'.END_LINE;
  50.         $content.='<dc:subject>'.$news_theme.'</dc:subject>'.END_LINE;
  51.         $content.='<dc:publisher>'.SITE_CITY_NAME.'</dc:publisher>'.END_LINE;
  52.         $content.='<dc:creator>'.$news_posted_by.'</dc:creator>'.END_LINE;
  53.         $content.='<description>'.END_LINE;
  54.         $content.=$news_description;
  55.         $content.='</description>'.END_LINE;
  56.         $content.='</item>'.END_LINE;
  57.     }
  58. }
  59.  
  60.  
  61.  
  62.  
  63.  
  64. /**
  65. * HEADER RSS
  66. ****************************************************************/
  67.  
  68. header('Content-Type: text/xml');
  69. echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>".END_LINE;
  70.  
  71.  
  72. echo '<rdf:RDF
  73.     xmlns="http://purl.org/rss/1.0/"
  74.     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  75.     xmlns:dc="http://purl.org/dc/elements/1.1/"
  76.     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  77.     xmlns:admin="http://webns.net/mvcb/"
  78.     xmlns:content="http://purl.org/rss/1.0/modules/content/"
  79.   
  80. echo '<channel rdf:about="'.SITE_CITY_URL.'">'.END_LINE;
  81. echo '<title>'.$GLOBALS['lang']['divers']['actu_left'' - '.SITE_CITY_NAME.'</title>'.END_LINE;
  82. echo '<link>'.SITE_CITY_URL.'</link>'.END_LINE;
  83. echo '<description>'.$GLOBALS['lang']['divers']['actu_left'' - '.SITE_CITY_NAME.'</description>'.END_LINE;
  84. echo '<dc:language>'.strtolower(LANGUAGE).'</dc:language>'.END_LINE;
  85. echo '<dc:publisher>'.SITE_CITY_NAME.'</dc:publisher>'.END_LINE;
  86. echo '<dc:creator>'.SITE_LINEA_NAME.' (mailto:'.MAIL_LINEA.')'.'</dc:creator>'.END_LINE;
  87. echo '<dc:rights>Copyrights '.date("Y").'</dc:rights>'.END_LINE;
  88. echo '<dc:date>'.date('Y-m-d\\TH:i:s+00:00').'</dc:date>'.END_LINE;
  89. echo '<admin:generatorAgent rdf:resource="'.SITE_LINEA_URL.'"/>'.END_LINE;
  90. echo '<admin:errorReportsTo rdf:resource="mailto:'.SITE_CITY_MAIL.'"/>'.END_LINE;
  91. echo '<sy:updatePeriod>daily</sy:updatePeriod>'.END_LINE;
  92. echo '<sy:updateFrequency>2</sy:updateFrequency>'.END_LINE;
  93. echo '<sy:updateBase>2000-01-01</sy:updateBase>'.END_LINE;
  94.  
  95. echo '<image rdf:resource="http://www.linea21.com/logo_linea.gif" />'.END_LINE;
  96.  
  97. # LISTES ITEMS
  98. echo '<items>'.END_LINE;
  99. echo '<rdf:Seq>'.END_LINE;
  100. echo $li_items.END_LINE;
  101. echo '</rdf:Seq>'.END_LINE;
  102. echo '</items>'.END_LINE;
  103. echo '</channel>'.END_LINE;
  104.  
  105.  
  106. echo $content;
  107.  
  108.   
  109. /**
  110. * FOOTER RSS
  111. **********************************************************/
  112.  
  113.  
  114. echo '</rdf:RDF>'.END_LINE;
  115. ?>

Documentation generated on Sat, 08 Nov 2008 14:54:19 +0100 by phpDocumentor 1.4.1