From bd1386890b2a376cc93fc81ced62cfdfb158632f Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 15 Apr 2026 19:49:59 +0100 Subject: [PATCH] error html --- apartados.php | 42 ++++++++++++++++++++++++++++++++---------- funciones.php | 23 +++++++++++++++++++++++ slug.php | 4 ++-- 3 files changed, 57 insertions(+), 12 deletions(-) diff --git a/apartados.php b/apartados.php index 7f1899f..2c9d58e 100755 --- a/apartados.php +++ b/apartados.php @@ -1,7 +1,10 @@ $apartado)); include "footer.php"; + $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]; + + $config_apartados = array( + 'portada' => @$portada, + 'apartado' => $apartado + ); + 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); + } } -include("header.php"); -$portada = CocoDB::get("portada","","",1);$portada = @$portada[0]; - -$config_apartados = array( - 'portada' => @$portada, - 'apartado' => $apartado - ); -echo tpl('apartados',$config_apartados); - -include("footer.php"); ?> diff --git a/funciones.php b/funciones.php index 34d5052..81df3cf 100755 --- a/funciones.php +++ b/funciones.php @@ -297,4 +297,27 @@ function muestra_breadcrumb($record = array(), $previousLinks = array(),$class = echo ''; echo ''; } + +function error_html($error){ + $result = ''; + $result.='
+
+ + + + + + + + + + +

Se han encontrado errores en la página.

+ Por favor, contacte con el administrador del sitio. +
+
'; + $result.="\n"; + $result.=""; + return $result; +} ?> diff --git a/slug.php b/slug.php index 0e03a2d..b96a5d4 100755 --- a/slug.php +++ b/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); } ?>