Descripción: Comodín que sirve para mostrar las postales de forma individual según su identificador (id). Pudiendo enlazar con el editor o generar la imagen en formato svg.
A continuación mostramos los apuntes asociados a este extra:
// Descripción para sindicación:
/*
[rss]Comodín que sirve para mostrar las postales de forma individual según su identificador (id).
Pudiendo enlazar con el editor o generar la imagen en formato svg.[/rss]
*/
$hoy = getdate();
$año = $hoy["year"];
//$id = $_GET["id"];
$_escala = (isset($_GET["porcentaje"])) ? (int) ($_GET["porcentaje"]) / 100 : 1;
if (isset($_GET["id"])) {
$sql = "select * from $tabla_postales where id='{$_GET[id]}'";
$error = "Postal con id: ";
$res = mysql_query($sql);
if ($res)
$existe = (mysql_num_rows($res) > 0);
if ($existe) {
$id = mysql_result($res, 0, "id");
$error .= $id;
$titulo = mysql_result($res, 0, "titulo");
$autor = mysql_result($res, 0, "autor");
$fondo = mysql_result($res, 0, "fondo");
$datos = mysql_result($res, 0, "elementos");
$_eles = explode("\n", $datos);
$postalita = "\n<div style=\"padding-top: 1em\">\n<div style=\"background-color: $fondo; position: relative; margin: auto; width: ".(480 * $_escala) ."px; height:".(360 * $_escala)."px; border: 3px ridge blue\">\n";
for($i = 0, $total = count($_eles); $i < $total; $i++) {
$desglose = (explode("|", $_eles[$i])); //print_r($desglose);
$tipoPostal = array_shift($desglose);
$_tope_ = substr(array_shift($desglose), 4);
$_tope_ = (int) $_tope_;
$postalita.="\n\t<div class=\"$tipoPostal\" style=\"top: ". ($_tope_ * $_escala);
$_izq_ = (float) substr(array_shift($desglose), 5);
$postalita.="px; left: ". ($_izq_ * $_escala);
$postalita.="px; width: ". (float) substr(array_shift($desglose), 6) * $_escala;
$postalita.="px; height: ". (float) substr(array_shift($desglose), 7) * $_escala. "px; position: absolute\">\n";
if ($tipoPostal == "imagen") {
$postalita.="\t\t<img src=\"".substr(array_shift($desglose), 4). "\" title=\"".substr(array_shift($desglose), 6)."\" style=\"width: 100%; height: 100%\" />";
}
else {
$familia = substr(array_shift($desglose), 4);
$texto = substr(array_shift($desglose), 6);
$postalita.="\t\t<div style=\"font-family: $familia; color: ".substr(array_shift($desglose), 6);
$postalita.="; font-style: ".substr(array_shift($desglose), 11);
$postalita.="; font-weight: ".substr(array_shift($desglose), 12);
$postalita.="; text-align: ".substr(array_shift($desglose), 11);
$postalita.="; font-size: ".((int) substr(array_shift($desglose), 10) * $_escala);
$postalita.="px\" title=\"texto\" >\n\t\t\t$texto\n\t\t</div>";
}
$postalita.="\n\t</div>\n";
}
$postalita.="</div>\n</div>\n";
$titular = $titulo;
$menu = "<p><strong>Opciones:</strong> <a href='?extra=postales'>Volver al menu de postales</a> <a href='postales/postales.php?id=$id'>Editar la postal</a> <a href='?extra=postal_svg&id=$id&url=si'>Generar fichero svg</a></p>";
$contenido = "<div id='la_postal'><h1>Postal Digital</h1><h2>Título: $titular</h2><h2>autor: $autor</h2><h3>$error</h3>$menu$postalita</div><div class='corte'></div>";
}
else {
$titular = "Postal inexistente";
$contenido = "<div id='la_postal'><h1>Postal Digital</h1><h2>¡Advertencia! $titular</h2><div class='corte'></div>";
}
}
else {// if ($res)
$error = mysql_error();
}
//}
ob_start();
echo <<< pie
<div id="copyright">
<h6>
<span style="font-weight: bolder">Copyright © 2002-$año <a href="index.php">www.pepemolina.com</a></span>
<br/>
<a href="diario.rss.xml" >RSS</a>
<a href="diario.rss.xml" ><img src="diario.imagen.php?id=22&max=10" alt="rss" title="rss" longdesc="diario.ficha.php?id=22" /></a>
| Ver
<a href="diario.sitemap.html" >
Mapa del sitio
</a>
</h6>
</div><!-- id="copyright" -->
pie;
$pie = ob_get_clean();
$doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
$links = "<link rel='shortcut icon' href='caricatos.ico' />\n";
//$body = "<div id='la_postal'><h1>$titular</h1><h2>autor: $autor</h2><h3>$error</h3>$postalita</div>$menu<div class='corte'></div>$pie ";
$body = $contenido.$pie;
$css.= "h1 {text-align: center; background-color: #eeeeee; margin: 0;}";
$css .= <<< pata
h6 {
text-align: center;
background-color: #eeeeee;
margin: 0;
padding: .5em;
}
html, body {
min-height: 100%;
height: 90%;
}
ul, li {
display: inline;
list-style-type: none;
float: left;
}
li {
margin: 0 2em;
}
ul {
margin: 0 0 2em 0;
}
#la_postal {
min-height:100%;
height: auto!important;
height:100%;
position: relative;
}
#copyright {
height: 2em;
margin-top: -2em;
}
.corte {
clear: both;
padding: 1em;
}
pata;
Este código ha sido leído en 112 ocasiones.
Esta extra aún no tiene comentarios.
Valoración de esta página: (extra.postal)
Listados: imágenes, categorías, etiquetas, extras | Anuarios: 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 | Otros enlaces: buscador