Descripción: Comodín que sirve para mostrar las postales de forma individual según su identificador (id).
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).[/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: ";
}
else {
$sql = "select * from $tabla_postales order by rand() limit 1";
$error = "Postal aleatoria, id: ";
}
$res = mysql_query($sql);
if ($res) {
$existe = (mysql_num_rows($res) > 0);
if (!$existe) {
$sql = "select * from $tabla_postales order by rand() limit 1";
$res = mysql_query($sql);
//$id = mysql_result($res, 0, "id");
$error = "Postal con id: {$_GET[id]} inexistente. Nuevo id: ";
}
$id = mysql_result($res, 0, "id");
$error .= "<a href='?extra=postal&id=$id'>$id</a>";
$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;
$titular = "<a href=\"?extra=postal&id=$id\">$titulo</a>";
$nota = "<div id='nota'><strong>Nota:</strong>Para editar y/o enviar la postal activa, pulse sobre su id.</div>";
$menu = "<h3 style='text-align: center;'>Otras Postales</h3><ul id='menu_postales'>\n";
$sql = "select * from $tabla_postales order by id";
$res = mysql_query($sql);
if ($res) {
$todas = mysql_num_rows($res);
$postalitas = "";
$_escala = .2;
$vid = $id;
for ($k = 0; $k < $todas; $k++) if ($id = mysql_result($res, $k, "id") != $vid) {
$id = mysql_result($res, $k, "id");
$titulo = mysql_result($res, $k, "titulo");
$autor = mysql_result($res, $k, "autor");
$fondo = mysql_result($res, $k, "fondo");
$datos = mysql_result($res, $k, "elementos");
$_eles = explode("\n", $datos);
$postalitas .= "\n<a href='?extra=postales&id=$id'><li><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_;
$postalitas.="\n\t<div class=\"$tipoPostal\" style=\"top: ". ($_tope_ * $_escala);
$_izq_ = (float) substr(array_shift($desglose), 5);
$postalitas.="px; left: ". ($_izq_ * $_escala);
$postalitas.="px; width: ". (float) substr(array_shift($desglose), 6) * $_escala;
$postalitas.="px; height: ". (float) substr(array_shift($desglose), 7) * $_escala. "px; position: absolute\">\n";
if ($tipoPostal == "imagen") {
$postalitas.="\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);
$postalitas.="\t\t<div style=\"font-family: $familia; color: ".substr(array_shift($desglose), 6);
$postalitas.="; font-style: ".substr(array_shift($desglose), 11);
$postalitas.="; font-weight: ".substr(array_shift($desglose), 12);
$postalitas.="; text-align: ".substr(array_shift($desglose), 11);
$postalitas.="; font-size: ".((int) substr(array_shift($desglose), 10) * $_escala);
$postalitas.="px\" title=\"texto\" >\n\t\t\t$texto\n\t\t</div>";
}
$postalitas.="\n\t</div>\n";
}
$postalitas.="</div>\n</div></li></a>\n";
}
$menu.= "$postalitas</ul>\n";
}
}
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>$nota\n$menu<div class='corte'></div>$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;
}
#nota {
border: 2px ridge blue;
background-color: #ecdfec;
margin: 1em 10em .5em;
text-align: center;
padding: 5px 2em;
}
#la_postal {
min-height:100%;
height: auto!important;
height:100%;
position: relative;
}
#copyright {
height: 2em;
margin-top: -2em;
}
.corte {clear: both; padding-top: 1em;}
pata;
Este código ha sido leído en 110 ocasiones.
Esta extra aún no tiene comentarios.
Valoración de esta página: (extra.postales)
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