rendered paste body<?php
if (!defined("PN_INIT")) {
header("Location: index.php");
exit();
}
include_once(LANGUAGE_DIR."Spanish.php");
if ($_SERVER["REMOTE_ADDR"] != "127.0.0.1" && $_SERVER["REMOTE_ADDR"] != "200.104.78.21")
$api->log->msg($_SERVER["REMOTE_ADDR"]." has visited us", __FILE__, __LINE__, "i");
$api->uses("tpl");
if ($pn_info["maintenance"]["status"] == 1) {
if (!isset($_COOKIE["pn_admin"]))
$api->redirect(BASE."closed/");
else {
$cookey = $_COOKIE["pn_admin"];
$key = $api->db->getOne("SELECT cookey FROM pn_users WHERE id='1' ");
if ($cookey != $key["cookey"])
$api->redirect(BASE."closed/");
$api->tpl->que("msg", "Recuerde que el sitio se encuentra <strong>cerrado</strong>.");
}
}
$blocks = $api->db->getAll("SELECT * FROM pn_blocks WHERE status='1' ORDER by pos ASC");
if ($blocks)
{
$css_file = $api->tpl->dir."blocks.css";
if (!file_exists($css_file))
$api->log->msg("Missing css file ".$css_file." for blocks", __FILE__, __LINE__, "e");
else $api->tpl->que("css", $css_file);
foreach ($blocks as $block) {
$file = BASE."blocks/".$block["name"].".php";
if (!file_exists($file)) {
$api->log->msg("File ".$file." does not exist!", __FILE__, __LINE__, "e");
continue;
}
require_once($file);
}
unset($blocks, $block, $file);
}
if (isset($html)) unset($html);
$api->tpl->que("css", $api->tpl->dir."layout.css");
?>