check_version){
$present = version();
$lastest = _file_get_contents("http://www.gelatocms.com/vgel.txt");
if ($present < $lastest) {
echo "
";
}
}
if (isset($_GET["deleted"])) {
if ($_GET["deleted"]=="true") {
echo "
".__("The post has been eliminated successfully.")."
";
}
}
if (isset($_GET["modified"])) {
if ($_GET["modified"]=="true") {
echo "
".__("The post has been modified successfully.")."
";
}
}
if (isset($_GET["added"])) {
if ($_GET["added"]=="true") {
echo "
".__("The post has been added successfully.")."
";
}
}
if (isset($_GET["error"])) {
if ($_GET["error"]==2) {
echo "
".__("Error on the database server:")." ".$_GET["des"]."
";
}
}
if (isset($_GET["mp3"])) {
if ($_GET["mp3"]=="false") {
echo "
".__("Not an MP3 file or an upload problem.")."
";
}
}
if (isset($_GET["photo"])) {
if ($_GET["photo"]=="false") {
echo "
".__("Not a photo file or an upload problem.")."
";
}
}
?>
postLimit;
if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric?
$from = (($page_num-1) * $limit);
} else {
$from = 0;
}
$rs = $tumble->getPosts($limit, $from);
if ($tumble->contarRegistros()>0) {
while($register = mysql_fetch_array($rs)) {
$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
$register["title"] = stripslashes($register["title"]);
$register["description"] = stripslashes($register["description"]);
switch ($tumble->getType($register["id_post"])) {
case "1":
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
$output = array($register["id_post"], $formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_regular_post");
$template->mostrarPlantilla();
break;
case "2":
$fileName = "../uploads/".getFileName($register["url"]);
$x = @getimagesize($fileName);
if ($x[0] > 100) {
$photoPath = $conf->urlGelato."/classes/imgsize.php?w=100&img=".$register["url"];
} else {
$photoPath = $register["url"];
}
$effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{Effect}", "{URL_Tumble}");
$output = array($register["id_post"], $formatedDate, $permalink, $photoPath, strip_tags($register["description"]), $register["description"], $effect, $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_photo");
$template->mostrarPlantilla();
break;
case "3":
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Quote}", "{Source}", "{URL_Tumble}");
$output = array($register["id_post"], $formatedDate, $permalink, $register["description"], $register["title"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_quote");
$template->mostrarPlantilla();
break;
case "4":
if($conf->shorten_links){
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
}
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{URL}", "{Name}", "{Description}", "{URL_Tumble}");
$output = array($register["id_post"], $formatedDate, $permalink, $register["url"], $register["title"], $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_url");
$template->mostrarPlantilla();
break;
case "5":
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}");
$output = array($register["id_post"], $formatedDate, $permalink, $register["title"], $tumble->formatConversation($register["description"]), $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_conversation");
$template->mostrarPlantilla();
break;
case "6":
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Video}", "{Caption}", "{URL_Tumble}");
$output = array($register["id_post"], $formatedDate, $permalink, $tumble->getVideoPlayer($register["url"]), $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_video");
$template->mostrarPlantilla();
break;
case "7":
$input = array("{Id_Post}", "{Date_Added}", "{Permalink}", "{Mp3}", "{Caption}", "{URL_Tumble}");
$output = array($register["id_post"], $formatedDate, $permalink, $tumble->getMp3Player($register["url"]), $register["description"], $conf->urlGelato);
$template->cargarPlantilla($input, $output, "template_mp3");
$template->mostrarPlantilla();
break;
}
}
$p = new pagination;
$p->items($tumble->getPostsNumber());
$p->limit($limit);
$p->currentPage(isset($page_num) ? $page_num : 1);
$p->show();
} else {
$template->renderizaEtiqueta(__("No posts in this tumblelog."), "div","error");
}
?>