<?php
// $Id: index.php,v 1.4 2005/10/22 08:23:32 ohwada Exp $

// 2005-09-28 K.OHWADA
// change index.php to class

//=========================================================
// What's New Module
// 2004/08/20 K.OHWADA
//=========================================================

// include files
include "../../mainfile.php";

//include_once XOOPS_ROOT_PATH."/modules/whatsnew/include/func.ping.php";
//include_once XOOPS_ROOT_PATH."/modules/whatsnew/class/class.weblog_updates.php";
//include_once XOOPS_ROOT_PATH."/modules/whatsnew/class/class.http_client.php";

include_once XOOPS_ROOT_PATH."/modules/whatsnew/class/whatsnew_show_block.php";
include_once XOOPS_ROOT_PATH."/modules/whatsnew/class/whatsnew_show_main.php";
include_once XOOPS_ROOT_PATH."/modules/whatsnew/class/whatsnew_lang_base.php";

$whatsnew_file_lang_conv = XOOPS_ROOT_PATH."/modules/whatsnew/language/".$xoopsConfig['language']."/whatsnew_lang_conv.php";

if ( file_exists($whatsnew_file_lang_conv) ) 
{
	include_once $whatsnew_file_lang_conv;
}
else
{
	include_once XOOPS_ROOT_PATH."/modules/whatsnew/language/english/whatsnew_lang_conv.php";
}

$whatsnew_file_lang_blocks = XOOPS_ROOT_PATH."/modules/whatsnew/language/".$xoopsConfig['language']."/blocks.php";

if ( file_exists($whatsnew_file_lang_blocks) ) 
{
	include_once $whatsnew_file_lang_blocks;
}
else
{
	include_once XOOPS_ROOT_PATH."/modules/whatsnew/language/english/blocks.php";
}

//class
$class_show =& Whatsnew_Show_Main::getInstance();
$class_lang =& Whatsnew_Lang_Conv::getInstance();

$config_data = $class_show->get_config_data();
$main_tpl = $config_data['main_tpl'];

// start
include XOOPS_ROOT_PATH."/header.php";

// measure time
$class_show->measure_time_start();

// template
if ($main_tpl)
{
	$tpl_main = "whatsnew_bop.html";
}
else
{
	$tpl_main = "whatsnew_index.html";
}

$xoopsOption['template_main'] = $tpl_main;

$xoopsTpl->assign('tpl_main',  $tpl_main );
$xoopsTpl->assign('rss_valid',   _WHATSNEW_RSS_VALID);
$xoopsTpl->assign('module_name', $xoopsModule->getVar('name') );
$xoopsTpl->assign('happy_linux_url',  $class_lang->get_happy_linux_url() );

// main
$block = $class_show->get_main();
$xoopsTpl->assign('whatsnew', $block);

// measure time
$time = sprintf("%6.3f", $class_show->measure_time_end() );
$xoopsTpl->assign('time_excute', $time);

include XOOPS_ROOT_PATH.'/footer.php';
exit();


?>