<?php
// $Id: single_feed.php,v 1.7 2006/09/20 00:22:25 ohwada Exp $

// 2006-09-15 K.OHWADA
// use main_search_title_html
// page title
// highlight_keyword

// 2006-07-10 K.OHWADA
// use happy_linux_post happy_linux_system
// support podcast
// bread crumb

// 2006-06-04 K.OHWADA
// rename file name single.php to single_link.php
// use header.php

//================================================================
// Rss center Module
// 2006-01-01 K.OHWADA
//================================================================

include 'header.php';
include_once RSSC_ROOT_PATH."/class/rssc_view_handler.php";

$view_handler =& rssc_get_handler( 'view',         RSSC_DIRNAME );
$conf_handler =& rssc_get_handler( 'config_basic', RSSC_DIRNAME );

// --- template start ---
// xoopsOption[template_main] should be defined before including header.php
$xoopsOption['template_main'] = RSSC_DIRNAME.'_single_feed.html';
include XOOPS_ROOT_PATH.'/header.php';

$conf =& $conf_handler->get_conf();

$view_handler->setFlagSanitize(1);	// sanitize

$view_handler->set_title_html(   $conf['main_single_title_html'] );
$view_handler->set_content_html( $conf['main_single_content_html'] );
$view_handler->set_max_title(    $conf['main_single_max_title'] );
$view_handler->set_max_content(  $conf['main_single_max_content'] );
$view_handler->set_max_summary(  $conf['main_single_max_summary'] );

$view_handler->set_highlight( true );
$view_handler->set_keyword_by_request();
$urlencode = $view_handler->get_keywords_urlencode();

$module_name = $view_handler->get_module_name();
$is_admin    = $view_handler->is_module_admin();
$fid         = $view_handler->get_get_fid();

$feed  = array();
$link  = array();
$error = '';
$show  = 0;

if ( $view_handler->exists_feed($fid) )
{
	$feed =& $view_handler->getFeedByFid($fid);

	if ( is_array($feed) && isset($feed['lid']) )
	{
		$show = 1;
		$link =& $view_handler->getLink( $feed['lid'] );
	}
}

// bread crumb
$xoopsTpl->assign('lang_home', _HOME);

$xoopsTpl->assign('lang_main',      _RSSC_MAIN);
$xoopsTpl->assign('lang_headline',  _RSSC_HEADLINE);
$xoopsTpl->assign('lang_single',    _RSSC_SINGLE);
$xoopsTpl->assign('lang_no_record', _NO_RECORD);
$xoopsTpl->assign('lang_no_feed',   _RSSC_NO_FEED);

// podcast
$xoopsTpl->assign('lang_podcast', _RSSC_PODCAST);
$xoopsTpl->assign('unit_kb',      RSSC_UNIT_KB);

$xoopsTpl->assign('dirname',     RSSC_DIRNAME);
$xoopsTpl->assign('is_admin',    $is_admin);
$xoopsTpl->assign('rssc_show',   $show);
$xoopsTpl->assign('rssc_error',  $error);
$xoopsTpl->assign('link',  $link);
$xoopsTpl->assign('feed',  $feed);
$xoopsTpl->assign('rssc_keywords', $urlencode);

// page title
$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$feed['title']);

include XOOPS_ROOT_PATH.'/footer.php';
exit();
// --- main end ---

?>