error html
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
<?
|
||||
|
||||
require_once ("sesion.php");
|
||||
require_once "funciones.php";
|
||||
|
||||
$resultInclude = null;
|
||||
|
||||
$apartado = CocoDB::get("apartados", "num=".intval(@$_REQUEST["num"]), "num DESC", 1);
|
||||
$apartado = @$apartado[0]; // get first record
|
||||
$configuracionRecord["titulo_de_pagina"] = t($apartado,"name")." - ".$configuracionRecord["titulo_de_pagina"];
|
||||
@@ -11,6 +14,7 @@ if (@$apartado["metatag_descripcion"]!="") $configuracionRecord["metatag_descrip
|
||||
if (@$apartado["metatag_palabras"]!="") $configuracionRecord["metatag_palabras"] = t($apartado,"metatag_palabras");
|
||||
|
||||
if (!@$apartado) {
|
||||
ob_start();
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
include("header.php");
|
||||
$apartado = [
|
||||
@@ -19,8 +23,16 @@ if (!@$apartado) {
|
||||
];
|
||||
echo tpl("apartados",array("apartado" => $apartado));
|
||||
include "footer.php";
|
||||
die();
|
||||
$resultInclude = ob_get_clean();
|
||||
|
||||
if (strpos($resultInclude,".php on line ") === false){
|
||||
echo $resultInclude;
|
||||
}else{
|
||||
echo error_html($resultInclude);
|
||||
}
|
||||
die();
|
||||
} else{
|
||||
ob_start();
|
||||
include("header.php");
|
||||
|
||||
$portada = CocoDB::get("portada","","",1);$portada = @$portada[0];
|
||||
@@ -32,4 +44,14 @@ $config_apartados = array(
|
||||
echo tpl('apartados',$config_apartados);
|
||||
|
||||
include("footer.php");
|
||||
|
||||
$resultInclude = ob_get_clean();
|
||||
|
||||
if (strpos($resultInclude,".php on line ") === false){
|
||||
echo $resultInclude;
|
||||
}else{
|
||||
echo error_html($resultInclude);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -297,4 +297,27 @@ function muestra_breadcrumb($record = array(), $previousLinks = array(),$class =
|
||||
echo '</ol>';
|
||||
echo '</nav>';
|
||||
}
|
||||
|
||||
function error_html($error){
|
||||
$result = '';
|
||||
$result.='<div style="display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-family:Arial, sans-serif;">
|
||||
<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;color:#607d8b;">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 24 24" fill="none" stroke="#607d8b" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M4 8v-2a2 2 0 0 1 2 -2h2" />
|
||||
<path d="M4 16v2a2 2 0 0 0 2 2h2" />
|
||||
<path d="M16 4h2a2 2 0 0 1 2 2v2" />
|
||||
<path d="M16 20h2a2 2 0 0 0 2 -2v-2" />
|
||||
<path d="M9 10h.01" />
|
||||
<path d="M15 10h.01" />
|
||||
<path d="M9.5 15.05a3.5 3.5 0 0 1 5 0" />
|
||||
</svg>
|
||||
|
||||
<p>Se han encontrado errores en la página. </p>
|
||||
<small style="margin-top:10px;display:block;">Por favor, contacte con el administrador del sitio.</small>
|
||||
</div>
|
||||
</div>';
|
||||
$result.="<!-- Error details: -->\n";
|
||||
$result.="<!--\n$error\n-->";
|
||||
return $result;
|
||||
}
|
||||
?>
|
||||
|
||||
4
slug.php
4
slug.php
@@ -392,10 +392,10 @@ addPlugins("pre_render",$resultInclude);
|
||||
if (class_exists("CocoDB") && isset(CocoDB::$force_redis_html) && CocoDB::$force_redis_html && @$hash){
|
||||
CocoDB::cacheSet(@$hash,$resultInclude);
|
||||
}
|
||||
if (strpos(".php on line", $resultInclude) === false){
|
||||
if (strpos($resultInclude,".php on line ") === false){
|
||||
echo $resultInclude;
|
||||
}else{
|
||||
echo "Error en la ruta solicitada.";
|
||||
echo error_html($resultInclude);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user