source: temp/test-xoops.ec-cube.net/html/backend.php @ 405

Revision 405, 3.9 KB checked in by root, 20 years ago (diff)
Line 
1<?php
2// $Id: backend.php,v 1.2 2005/03/18 12:51:55 onokazu Exp $
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
28include 'mainfile.php';
29include_once XOOPS_ROOT_PATH.'/class/template.php';
30include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
31if (function_exists('mb_http_output')) {
32    mb_http_output('pass');
33}
34header ('Content-Type:text/xml; charset=utf-8');
35$tpl = new XoopsTpl();
36$tpl->xoops_setCaching(2);
37$tpl->xoops_setCacheTime(3600);
38if (!$tpl->is_cached('db:system_rss.html')) {
39    $sarray = NewsStory::getAllPublished(10, 0);
40    if (is_array($sarray)) {
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        $count = $sarray;
65        foreach ($sarray as $story) {
66            $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))));
67        }
68    }
69}
70$tpl->display('db:system_rss.html');
71?>
Note: See TracBrowser for help on using the repository browser.