home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / CMS / xoops-2.0.18.1.exe / xoops-2.0.18.1 / htdocs / backend.php < prev    next >
Encoding:
PHP Script  |  2007-12-08  |  4.0 KB  |  75 lines

  1. <?php
  2. // $Id: backend.php 1159 2007-12-08 06:25:14Z phppp $
  3. //  ------------------------------------------------------------------------ //
  4. //                XOOPS - PHP Content Management System                      //
  5. //                    Copyright (c) 2000 XOOPS.org                           //
  6. //                       <http://www.xoops.org/>                             //
  7. //  ------------------------------------------------------------------------ //
  8. //  This program is free software; you can redistribute it and/or modify     //
  9. //  it under the terms of the GNU General Public License as published by     //
  10. //  the Free Software Foundation; either version 2 of the License, or        //
  11. //  (at your option) any later version.                                      //
  12. //                                                                           //
  13. //  You may not change or alter any portion of this comment or credits       //
  14. //  of supporting developers from this source code or any supporting         //
  15. //  source code which is considered copyrighted (c) material of the          //
  16. //  original comment or credit authors.                                      //
  17. //                                                                           //
  18. //  This program is distributed in the hope that it will be useful,          //
  19. //  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
  20. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
  21. //  GNU General Public License for more details.                             //
  22. //                                                                           //
  23. //  You should have received a copy of the GNU General Public License        //
  24. //  along with this program; if not, write to the Free Software              //
  25. //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
  26. //  ------------------------------------------------------------------------ //
  27.  
  28. include 'mainfile.php';
  29. $GLOBALS['xoopsLogger']->activated = false;
  30. if (function_exists('mb_http_output')) {
  31.     mb_http_output('pass');
  32. }
  33. header ('Content-Type:text/xml; charset=utf-8');
  34.  
  35. include_once XOOPS_ROOT_PATH.'/class/template.php';
  36. $tpl = new XoopsTpl();
  37. $tpl->xoops_setCaching(2);
  38. $tpl->xoops_setCacheTime(3600);
  39.         
  40. if (!$tpl->is_cached('db:system_rss.html')) {
  41.     $tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
  42.     $tpl->assign('channel_link', XOOPS_URL.'/');
  43.     $tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
  44.     $tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
  45.     $tpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
  46.     $tpl->assign('channel_editor', $xoopsConfig['adminmail']);
  47.     $tpl->assign('channel_category', 'News');
  48.     $tpl->assign('channel_generator', 'XOOPS');
  49.     $tpl->assign('channel_language', _LANGCODE);
  50.     $tpl->assign('image_url', XOOPS_URL.'/images/logo.gif');
  51.     $dimention = getimagesize(XOOPS_ROOT_PATH.'/images/logo.gif');
  52.     if (empty($dimention[0])) {
  53.         $width = 88;
  54.     } else {
  55.         $width = ($dimention[0] > 144) ? 144 : $dimention[0];
  56.     }
  57.     if (empty($dimention[1])) {
  58.         $height = 31;
  59.     } else {
  60.         $height = ($dimention[1] > 400) ? 400 : $dimention[1];
  61.     }
  62.     $tpl->assign('image_width', $width);
  63.     $tpl->assign('image_height', $height);
  64.     
  65.     if (@include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php') {
  66.         $sarray = NewsStory::getAllPublished(10, 0);
  67.     } 
  68.     if ( !empty($sarray) && is_array($sarray) ) {
  69.         foreach ($sarray as $story) {
  70.             $tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), 'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(), 'pubdate' => formatTimestamp($story->published(), 'rss'), 'description' => xoops_utf8_encode(htmlspecialchars($story->hometext(), ENT_QUOTES))));
  71.         }
  72.     }
  73. }
  74. $tpl->display('db:system_rss.html');
  75. ?>