<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
if ($acces == 1) {
if($admintest && $adminsecu)  {

		$bid = $db->XMFnum($bid);
		$ThemeSel = get_theme();
		//include_once ("themes/$ThemeSel/theme.php");
		include_once ("kernel/templates/themes_maximus.php");
		title(""._BLOCKSADMIN."");
		$row = $db->sql_fetchrow($db->sql_query("select `bid`, `bkey`, `title`, `content`, `url`, `bposition`, `blockfile` from `".TABLE_BLOCKS."` where `bid`='$bid'"));
		$bid       = $db->XMFnum($row['bid']);
		$bkey      = stripslashes($row['bkey']);
		$title     = stripslashes($row['title']);
		$content   = stripslashes($row['content']);
		$url       = stripslashes($row['url']);
		$bposition = stripslashes($row['bposition']);
		$blockfile = stripslashes($row['blockfile']);
		echo "<title>Block: $title</title><center>";
		if ($bkey == "main") {
			mainblock();
		} elseif ($bkey == "admin") {
			adminblock();
		} elseif ($bkey == "modules") {
			modules_block();
		} elseif ($bkey == "category") {
			category();
		} elseif ($bkey == "userbox") {
			userblock();
		} elseif ($bkey == "") {
			if ($url == "") {
				if ($blockfile == "") {
					if ($bposition == "c") {
						themecenterbox($title, $content);
					} else {
						themesidebox($title, $content);
					}
				} else {
					if ($bposition == "c") {
						blockfileinc($title, $blockfile, 1);
					} else {
						blockfileinc($title, $blockfile);
					}
				}
			} else {
				headlines($bid);
			}
		}
		echo "</center>";
		die();

}
}else {
	echo "Access Denied";
}