| 1 | 9 | ryan | <?php
 | 
      
        | 2 |  |  | 
 | 
      
        | 3 |  |  | // $Id$
 | 
      
        | 4 |  |  | 
 | 
      
        | 5 |  |  | /*
 | 
      
        | 6 |  |  | 
 | 
      
        | 7 |  |  |  Website Baker Project <http://www.websitebaker.org/>
 | 
      
        | 8 | 399 | Ruebenwurz |  Copyright (C) 2004-2007, Ryan Djurovich
 | 
      
        | 9 | 9 | ryan | 
 | 
      
        | 10 |  |  |  Website Baker is free software; you can redistribute it and/or modify
 | 
      
        | 11 |  |  |  it under the terms of the GNU General Public License as published by
 | 
      
        | 12 |  |  |  the Free Software Foundation; either version 2 of the License, or
 | 
      
        | 13 |  |  |  (at your option) any later version.
 | 
      
        | 14 |  |  | 
 | 
      
        | 15 |  |  |  Website Baker is distributed in the hope that it will be useful,
 | 
      
        | 16 |  |  |  but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
      
        | 17 |  |  |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
      
        | 18 |  |  |  GNU General Public License for more details.
 | 
      
        | 19 |  |  | 
 | 
      
        | 20 |  |  |  You should have received a copy of the GNU General Public License
 | 
      
        | 21 |  |  |  along with Website Baker; if not, write to the Free Software
 | 
      
        | 22 |  |  |  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 | 
      
        | 23 |  |  | 
 | 
      
        | 24 |  |  | */
 | 
      
        | 25 |  |  | 
 | 
      
        | 26 |  |  | // Check that GET values have been supplied
 | 
      
        | 27 |  |  | if(isset($_GET['page_id']) AND is_numeric($_GET['page_id'])) {
 | 
      
        | 28 |  |  | 	$page_id = $_GET['page_id'];
 | 
      
        | 29 | 270 | ryan | 	define('PAGE_ID', $page_id);
 | 
      
        | 30 | 9 | ryan | } else {
 | 
      
        | 31 |  |  | 	header('Location: '.WB_URL);
 | 
      
        | 32 | 286 | stefan | 	exit(0);
 | 
      
        | 33 | 9 | ryan | }
 | 
      
        | 34 |  |  | if(isset($_GET['group_id']) AND is_numeric($_GET['group_id'])) {
 | 
      
        | 35 |  |  | 	$group_id = $_GET['group_id'];
 | 
      
        | 36 | 270 | ryan | 	define('GROUP_ID', $group_id);
 | 
      
        | 37 | 9 | ryan | }
 | 
      
        | 38 |  |  | 
 | 
      
        | 39 | 270 | ryan | // Include WB files
 | 
      
        | 40 |  |  | require_once('../../config.php');
 | 
      
        | 41 |  |  | require_once(WB_PATH.'/framework/class.frontend.php');
 | 
      
        | 42 |  |  | $database = new database();
 | 
      
        | 43 |  |  | $wb = new frontend();
 | 
      
        | 44 |  |  | $wb->page_id = $page_id;
 | 
      
        | 45 |  |  | $wb->get_page_details();
 | 
      
        | 46 |  |  | $wb->get_website_settings();
 | 
      
        | 47 |  |  | 
 | 
      
        | 48 | 9 | ryan | // Sending XML header
 | 
      
        | 49 | 414 | Ruebenwurz | header("Content-type: text/xml; charset=utf-8" );
 | 
      
        | 50 | 9 | ryan | 
 | 
      
        | 51 |  |  | // Header info
 | 
      
        | 52 |  |  | // Required by CSS 2.0
 | 
      
        | 53 | 414 | Ruebenwurz | ?>
 | 
      
        | 54 |  |  | <rss version="2.0" >
 | 
      
        | 55 |  |  | <channel>
 | 
      
        | 56 |  |  | <title><?php echo PAGE_TITLE; ?></title>
 | 
      
        | 57 |  |  | <link>http://<?php echo $_SERVER['SERVER_NAME']; ?></link>
 | 
      
        | 58 |  |  | <description> <?php echo PAGE_DESCRIPTION; ?></description>
 | 
      
        | 59 |  |  | <?php
 | 
      
        | 60 |  |  | // Optional header info
 | 
      
        | 61 |  |  | ?>
 | 
      
        | 62 |  |  | <language><?php echo DEFAULT_LANGUAGE; ?></language>
 | 
      
        | 63 |  |  | <copyright><?php echo WB_URL.$_SERVER['REQUEST_URI']; ?></copyright>
 | 
      
        | 64 |  |  | <managingEditor><?php echo SERVER_EMAIL; ?></managingEditor>
 | 
      
        | 65 |  |  | <webMaster><?php echo SERVER_EMAIL; ?></webMaster>
 | 
      
        | 66 |  |  | <category><?php echo WEBSITE_TITLE; ?></category>
 | 
      
        | 67 |  |  | <generator>Website Baker Content Management System</generator>
 | 
      
        | 68 | 9 | ryan | 
 | 
      
        | 69 | 414 | Ruebenwurz | <?php
 | 
      
        | 70 | 9 | ryan | // Get news items from database
 | 
      
        | 71 |  |  | 
 | 
      
        | 72 |  |  | //Query
 | 
      
        | 73 |  |  | if(isset($group_id)) {
 | 
      
        | 74 |  |  | 	$query = "SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE group_id=".$group_id." AND page_id = ".$page_id." AND active=1 ORDER BY posted_when DESC";
 | 
      
        | 75 |  |  | } else {
 | 
      
        | 76 |  |  | 	$query = "SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE page_id=".$page_id." AND active=1 ORDER BY posted_when DESC";
 | 
      
        | 77 |  |  | }
 | 
      
        | 78 | 32 | ryan | $result = $database->query($query);
 | 
      
        | 79 | 9 | ryan | 
 | 
      
        | 80 |  |  | //Generating the news items
 | 
      
        | 81 | 414 | Ruebenwurz | while($item = $result->fetchRow($result)){ ?>
 | 
      
        | 82 | 9 | ryan | 
 | 
      
        | 83 | 414 | Ruebenwurz | <item>
 | 
      
        | 84 |  |  | <title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
 | 
      
        | 85 |  |  | <description><![CDATA[<?php echo stripslashes($item["content_short"]); ?>]]></description>
 | 
      
        | 86 |  |  | <guid><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></guid>
 | 
      
        | 87 |  |  | <link><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></link>
 | 
      
        | 88 |  |  | </item>
 | 
      
        | 89 | 9 | ryan | 
 | 
      
        | 90 | 414 | Ruebenwurz | <?php } ?>
 | 
      
        | 91 | 9 | ryan | 
 | 
      
        | 92 | 414 | Ruebenwurz | </channel>
 | 
      
        | 93 |  |  | </rss>
 |