Beispiel #1
0
	<section class="seccion-titulo">
		<h3>Título <?php 
echo $infoTit[2];
?>
: <?php 
echo $infoTit[1];
?>
</h3>
<?php 
if ($cap == 0) {
    // So pro... It works with an array or an element.
    $capitulos = getCapitulos($idTit);
} else {
    $idCap = getIdCapActivo($cap, $tit);
    if ($idCap) {
        $capitulos[0] = getInfoCap($idCap);
    } else {
        header('Location: ../404.html');
    }
}
for ($j = 0; $j < sizeof($capitulos); ++$j) {
    escribirCapitulo($capitulos[$j]);
}
?>
	</section>	


<?php 
function escribirCapitulo($infoCap)
{
    ?>
Beispiel #2
0
<?php

include 'scripts/funciones.php';
if (haIniciadoSesion()) {
    if (isset($_GET['cap'])) {
        $nro = intval($_GET['cap']);
        if ($nro <= 1) {
            $nro = 1;
        }
    } else {
        $nro = 1;
    }
    $articulos = getArticulos($nro);
    $infoCap = getInfoCap($nro);
    $infoTit = getInfoTit($infoCap[4]);
    if (empty($infoTit)) {
        header('Location: 404.html');
    }
} else {
    header('Location: login.php');
}
?>
<!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="UTF-8">
	<title>Artículos</title>
	<link rel="stylesheet" href="css/estilos.css">
</head>
<body>
	<?php 
if (haIniciadoSesion()) {
    // Se recibe el nroArt
    if (isset($_GET['art'])) {
        $nro = intval($_GET['art']);
    } else {
        $nro = 0;
    }
    if ($nro <= 0) {
        header('Location: 404.html');
    }
    /*  Info capturada al cargar la página, 
        permitirá reconocer si hubo cambios mientras se editaba. */
    $idArt = getIdArtActivo($nro);
    $infoArt = getInfoArt($idArt);
    $artPrevios = getArtPrev($infoArt[2]);
    $infoCap = getInfoCap($infoArt[4]);
    $infoTit = getInfoTit($infoCap[4]);
    if (empty($infoTit)) {
        header('Location: 404.html');
    }
} else {
    header('Location: login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Edición de artículo</title>
	<link rel="stylesheet" href="css/estilos.css">
</head>