<?php
// $Id: build_rss.php,v 1.4 2006/09/11 07:59:26 ohwada Exp $

// 2006-09-01 K.OHWADA
// use build_rss.php

// 2006-07-10 K.OHWADA
// use config_basic

// 2006-06-04 K.OHWADA
// this is new file
// move from rss.php

//================================================================
// Rss center Module
// 2006-06-04 K.OHWADA
//================================================================

include 'admin_header.php';

// system files
include_once XOOPS_ROOT_PATH.'/class/template.php';
include_once XOOPS_ROOT_PATH.'/class/xoopsuser.php';
include_once XOOPS_ROOT_PATH.'/modules/happy_linux/class/build_rss.php';

include_once RSSC_ROOT_PATH."/class/rssc_build_rssc.php";
include_once RSSC_ROOT_PATH."/class/rssc_search_handler.php";

$search_handler =& rssc_get_handler( 'search', RSSC_DIRNAME );
$conf_handler   =& rssc_get_handler( 'config_basic', RSSC_DIRNAME );
$builder        =& rssc_build_rssc::getInstance();

$search_goto_url = RSSC_URL.'/admin/index.php';

$TEMPLATE_RDF  = RSSC_ROOT_PATH.'/templates/xml/rssc_build_rdf.html';
$TEMPLATE_RSS  = RSSC_ROOT_PATH.'/templates/xml/rssc_build_rss.html';
$TEMPLATE_ATOM = RSSC_ROOT_PATH.'/templates/xml/rssc_build_atom.html';

$conf =& $conf_handler->get_conf();
$max_limit = $conf['main_search_perpage'];
$min       = $conf['main_search_min'];

$start = $search_handler->get_get_start();
$limit = $search_handler->get_get_limit();
$mode  = $search_handler->get_get_rss_mode();

if ($limit <= 0)
{
	$limit = $max_limit;
}

$feeds =& $search_handler->getLatest($limit, $start);

$builder->set_mode( $mode );
$builder->set_rdf_template(  $TEMPLATE_RDF );
$builder->set_rss_template(  $TEMPLATE_RSS );
$builder->set_atom_template( $TEMPLATE_ATOM );
$builder->set_items($feeds);
$builder->set_view_goto_url( $search_goto_url );
$builder->view();

exit();
// --- main end ---

?>