Single pages :)

master
pecesama 2007-04-05 00:54:47 +00:00
parent 68253ffe88
commit eadfd21d97
3 changed files with 64 additions and 7 deletions

View File

@ -50,6 +50,11 @@ class gelato extends Conexion_Mysql {
return $this->mid_consulta; return $this->mid_consulta;
} }
function getPost($id="") {
$this->ejecutarConsulta("select * from ".$this->conf->tablePrefix."data WHERE id_post=".$id);
return mysql_fetch_array($this->mid_consulta);
}
function getType($id) { function getType($id) {
if ($this->ejecutarConsulta("select type from ".$this->conf->tablePrefix."data WHERE id_post=".$id)) { if ($this->ejecutarConsulta("select type from ".$this->conf->tablePrefix."data WHERE id_post=".$id)) {
if ($this->contarRegistros()>0) { if ($this->contarRegistros()>0) {

View File

@ -25,7 +25,9 @@
if (isset($_GET["post"])) { if (isset($_GET["post"])) {
$id_post = $_GET["post"]; $id_post = $_GET["post"];
} else { } else {
$id_post = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : null) : null; if (isset($param_url[1]) && $param_url[1]=="post") {
$id_post = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : null) : null;
}
} }
$input = array("{Title}", "{Description}", "{URL_Tumble}"); $input = array("{Title}", "{Description}", "{URL_Tumble}");
@ -109,11 +111,61 @@
$template->renderizaEtiqueta("No posts in this tumblelog.", "div","error"); $template->renderizaEtiqueta("No posts in this tumblelog.", "div","error");
} }
} else { } else {
/* $register = $tumble->getPost($id_post);
$row = $tumble->obtenerArticulo($id_post);
*/ $formatedDate = date("M d", strtotime($register["date"]));
$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
switch ($tumble->getType($register["id_post"])) {
case "1":
$input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_regular_post");
$template->mostrarPlantilla();
break;
case "2":
$input = array("{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $register["url"], "", $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_photo");
$template->mostrarPlantilla();
break;
case "3":
$input = array("{Date_Added}", "{Permalink}", "{Quote}", "{Source}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $register["description"], $register["title"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_quote");
$template->mostrarPlantilla();
break;
case "4":
$input = array("{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_url");
$template->mostrarPlantilla();
break;
case "5":
$input = array("{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $register["title"], $tumble->formatConversation($register["description"]), $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_conversation");
$template->mostrarPlantilla();
break;
case "6":
$input = array("{Date_Added}", "{Permalink}", "{Video}", "{Caption}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $tumble->getVideoPlayer($register["url"]), $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_video");
$template->mostrarPlantilla();
break;
case "7":
$input = array("{Date_Added}", "{Permalink}", "{Mp3}", "{Caption}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $tumble->getMp3Player($register["url"]), $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_mp3");
$template->mostrarPlantilla();
break;
}
} }
$input = array("{URL_Tumble}"); $input = array("{URL_Tumble}");

View File

@ -18,7 +18,7 @@
<div id="container"> <div id="container">
<a href="{URL_Tumble}/rss.php"><img src="{URL_Tumble}/themes/tumblr/img/rss.gif" id="rss" alt="RSS"></a> <a href="{URL_Tumble}/rss.php"><img src="{URL_Tumble}/themes/tumblr/img/rss.gif" id="rss" alt="RSS"></a>
<h1><a href="/">{Title}</a></h1> <h1><a href="{URL_Tumble}/">{Title}</a></h1>
<div id="description"> <div id="description">
{Description} {Description}