<?PHP

/* ====================
Seditio - Website engine
Copyright Neocrome
http://www.neocrome.net
[BEGIN_SED]
File=view.php
Version=101
Updated=2006-mar-15
Type=Core
Author=Neocrome
Description=HTML/TXT viewer
[END_SED]
==================== */

if (!defined('SED_CODE')) { die('Wrong URL.'); }

$v = sed_import('v','G','STX');

if (eregi("\.", $v) || eregi("/", $v))
	{ die('Wrong URL.'); }

$incl_html = "datas/html/".$v.".html";
$incl_htm = "datas/html/".$v.".htm";
$incl_txt = "datas/html/".$v.".txt";

if  (file_exists($incl_txt))
	{
	$fd = @fopen ($incl_txt, 'r') or die("Couldn't find a file : ".$incl_txt);
	$vd = fread ($fd, filesize ($incl_txt));
	fclose ($fd);
	}
elseif  (file_exists($incl_htm))
	{
	$fd = @fopen ($incl_htm, 'r') or die("Couldn't find a file : ".$incl_htm);
	$vd = fread ($fd, filesize ($incl_htm));
	fclose ($fd);
	}
elseif  (file_exists($incl_html))
	{
	$fd = @fopen ($incl_html, 'r') or die("Couldn't find a file : ".$incl_html);
	$vd = fread ($fd, filesize ($incl_html));
	fclose ($fd);
	}
else
	{ sed_die(); }

/* ============= */

require("system/header.php");
$t = new XTemplate("skins/".$skin."/plugin.tpl");

$t-> assign(array(
	"PLUGIN_TITLE" => '&nbsp;',
	"PLUGIN_BODY" => $vd	
	));

$t->parse("MAIN");
$t->out("MAIN");

require("system/footer.php");

?>
