* Added themes class from Flavor (Converted to PHP4).
* Changed plantillas.class.php by themes.class.php on public zone. * Added new tumblr template in only one file. * deleted parts of old tumblr theme.master
parent
c7fd8be234
commit
d4f4e72049
|
|
@ -76,6 +76,11 @@ Author URI: http://www.mis-algoritmos.com
|
|||
if($this->calculate())
|
||||
echo "<div class=\"$this->className\">$this->pagination</div>";
|
||||
}
|
||||
function getPagination(){
|
||||
if(!$this->calculate)
|
||||
if($this->calculate())
|
||||
return "<div class=\"$this->className\">$this->pagination</div>";
|
||||
}
|
||||
function get_pagenum_link($id){
|
||||
//if(strpos($this->target,'?')===false)
|
||||
if($this->urlF)
|
||||
|
|
@ -97,7 +102,7 @@ Author URI: http://www.mis-algoritmos.com
|
|||
echo "Especificaste un wildcard para sustituir, pero no existe en el target<br />";
|
||||
$error = true;
|
||||
}elseif($this->urlF and $this->urlF == '%' and strpos($this->target,$this->urlF)===false){
|
||||
echo "Es necesario especificar en el target el comodin % para sustituir el número de página<br />";
|
||||
echo "Es necesario especificar en el target el comodin % para sustituir el n<EFBFBD>mero de p<>gina<br />";
|
||||
$error = true;
|
||||
}
|
||||
if($this->total_pages == null){
|
||||
|
|
|
|||
|
|
@ -0,0 +1,114 @@
|
|||
<?php
|
||||
/*
|
||||
Class name: Themes
|
||||
Class autor: Victor De la Rocha http//mis-algoritmos.com/themes-class
|
||||
Email: vyk2rr [at] gmail [dot] com
|
||||
*/
|
||||
class themes{
|
||||
var $registry;
|
||||
var $path;
|
||||
var $l10n;
|
||||
|
||||
var $output;
|
||||
var $vars=array(); //variable para apilar las variables que se asignan a la plantilla
|
||||
|
||||
function themes(){
|
||||
#$this->l10n = l10n::getInstance();
|
||||
}
|
||||
|
||||
function set($name, $value){
|
||||
$this->vars[$name] = $value;
|
||||
return true;
|
||||
}
|
||||
|
||||
function remove($name) {
|
||||
unset($this->vars[$name]);
|
||||
return true;
|
||||
}
|
||||
|
||||
//obtiene el contenido del tema ya con todos los valores sutituidos en las variables.
|
||||
function fetch($file){
|
||||
$this->exec($file);
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
//muestra el contenido del tema ya con todos los valroes sustituidos en las variables.
|
||||
function display($file){
|
||||
$this->exec($file);
|
||||
echo $this->output;
|
||||
}
|
||||
|
||||
//corre el proceso de sustitucion de valores en las variables del theme y retorna todo en la variable $this->output para ser devuelto por: fetch o display
|
||||
function exec($file){
|
||||
$this->file = $file;
|
||||
$output = file_get_contents($file);
|
||||
$this->output = $output;
|
||||
$this->registrar_vars();
|
||||
$this->__();
|
||||
$this->eval_control_structures();
|
||||
|
||||
//evaluate All as PHP code
|
||||
ob_start();eval($this->output);
|
||||
$this->output = ob_get_clean();
|
||||
}
|
||||
|
||||
function eval_control_structures(){
|
||||
//finding IFs sentences and converting to php code
|
||||
$this->output = "echo \"".addslashes($this->output)."\";";
|
||||
$this->output = preg_replace_callback("/{if ([^}]+)}/",create_function('$arr','return "\";if(".stripslashes($arr[1])."){echo\"";'),$this->output);
|
||||
$this->output = preg_replace("/{else}/","\";}else{echo\"",$this->output);
|
||||
$this->output = preg_replace_callback("/{elseif ([^}]+)}/",create_function('$arr','return "\";}elseif(".stripslashes($arr[1])."){echo\"";'),$this->output);
|
||||
$this->output = preg_replace("/{\/if}/","\";} echo \"",$this->output);
|
||||
|
||||
//finding FOREACHs or BLOCKs sentences and converting to php code
|
||||
$this->output = preg_replace_callback("/{block ([^}]+) as ([^}]+)=>[\$]([^}]+)}/",create_function('$arr','return "\";foreach(".stripslashes($arr[1])." as ".stripslashes($arr[2])."=>\$this->vars[\'".stripslashes($arr[3])."\']){echo\"";'),$this->output);
|
||||
$this->output = preg_replace_callback("/{block ([^}]+) as ([^}]+)}/",create_function('$arr','return "\";foreach(".stripslashes($arr[1])." as ".stripslashes($arr[2])."){echo\"";'),$this->output);
|
||||
$this->output = preg_replace("/{\/block}/","\";} echo \"",$this->output);
|
||||
|
||||
//Converting the $this->vars[\'variable\'] format to {$this->vars['variable']}
|
||||
$this->output = preg_replace("/[\$]this->vars\[\\\'([^ \.\\\]+)\\\'\]\[\\\'([^ \.\\\]+)\\\'\]/","{\$this->vars['$1']['$2']}",$this->output);
|
||||
$this->output = preg_replace("/[\$]this->vars\[\\\'([^ \.\\\]+)\\\'\]/","{\$this->vars['$1']}",$this->output);
|
||||
|
||||
//Converting the {__(\'word\')} format to {__('word')}
|
||||
#$this->output = preg_replace("/[\$]this->vars\[\\\'([^ \.\\\]+)\\\'\]/","{\$this->vars['$1']}",$this->output);
|
||||
}
|
||||
|
||||
//sustituye las variables en el output del template
|
||||
function registrar_vars(){
|
||||
foreach($this->vars as $k=>$v){
|
||||
//pre($this->vars);
|
||||
if(is_array($v)){
|
||||
//Si es un arreglo, se intenta procesar un nivel mas adentro para sustituir en el theme por lo que tenga: nombredearreglo.dato
|
||||
foreach($v as $_k=>$_v)
|
||||
if(!is_array($_v))
|
||||
$this->output = str_replace('{'.$k.'.'.$_k.'}',$_v,$this->output);
|
||||
}else{
|
||||
// sustituimos directamente las variables {$variable}
|
||||
$this->output = str_replace('{'.$k.'}',$v,$this->output);
|
||||
}
|
||||
}
|
||||
|
||||
//replacing {$key} format by $this->vars['key']
|
||||
//replacing {$array.key} format by $this->vars['array']['key']
|
||||
$patrones = array(
|
||||
'/{\$([^ \.}]+)}/s',
|
||||
'/{\$([^ \.}]+)\.([^ \.}]+)}/s'
|
||||
);
|
||||
$reemplazos = array(
|
||||
"\$this->vars['$1']",
|
||||
"\$this->vars['$1']['$2']"
|
||||
);
|
||||
$this->output = preg_replace($patrones, $reemplazos, $this->output);
|
||||
}
|
||||
|
||||
//Utiliza gettext
|
||||
function __(){
|
||||
$patron = "/{__\((?:'|\")([^\)]+?)(?:'|\")\)}/s";
|
||||
preg_match_all($patron,$this->output,$out);
|
||||
|
||||
foreach($out[1] as $k=>$v){
|
||||
$this->output = str_replace("{__('$v')}",$this->l10n->__($v),$this->output);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
17
entry.php
17
entry.php
|
|
@ -55,14 +55,15 @@ if($installed) {
|
|||
require_once($configFile);
|
||||
}
|
||||
|
||||
require_once("classes/configuration.class.php");
|
||||
require_once("classes/textile.class.php");
|
||||
require_once("classes/gelato.class.php");
|
||||
require_once("classes/templates.class.php");
|
||||
require_once("classes/pagination.class.php");
|
||||
require_once("classes/user.class.php");
|
||||
require_once("classes/comments.class.php");
|
||||
require_once("classes/feeds.class.php");
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'configuration.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'textile.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gelato.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'templates.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'themes.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'pagination.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'user.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'comments.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'feeds.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'mysql_connection.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
|
||||
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
|
||||
|
|
|
|||
209
index.php
209
index.php
|
|
@ -17,10 +17,9 @@ if(!defined('entry'))define('entry', true);
|
|||
require_once('entry.php');
|
||||
global $user, $tumble, $conf;
|
||||
|
||||
$template = new plantillas($conf->template);
|
||||
$theme = new themes;
|
||||
// My approach to MVC
|
||||
|
||||
|
||||
if(isset($_SERVER['PATH_INFO'])) $param_url = explode("/",$_SERVER['PATH_INFO']);
|
||||
|
||||
if (isset($_GET["post"])) {
|
||||
|
|
@ -36,6 +35,8 @@ $template = new plantillas($conf->template);
|
|||
}
|
||||
}
|
||||
|
||||
$theme->set('id_post',$id_post);
|
||||
|
||||
if (isset($_GET["page"])) {
|
||||
$page_num = $_GET["page"];
|
||||
} else {
|
||||
|
|
@ -76,22 +77,21 @@ $template = new plantillas($conf->template);
|
|||
}
|
||||
}
|
||||
|
||||
$input = array("{Gelato_includes}","{Title}", "{Page_Title}", "{Description}", "{URL_Tumble}", "{Template_name}");
|
||||
$output = array($gelato_includes, $conf->title, $page_title, $conf->description, $conf->urlGelato, $conf->template);
|
||||
$theme->set('Gelato_includes',$gelato_includes);
|
||||
$theme->set('Title',$conf->title);
|
||||
$theme->set('Page_Title',$page_title);
|
||||
$theme->set('Description',$conf->description);
|
||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||
$theme->set('Template_name',$conf->template);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_header");
|
||||
$template->mostrarPlantilla();
|
||||
|
||||
if ($user->isAuthenticated()) {
|
||||
$input = array("{User}", "{URL_Tumble}");
|
||||
$output = array($_SESSION["user_login"], $conf->urlGelato);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_isadmin");
|
||||
$template->mostrarPlantilla();
|
||||
$theme->set('isAuthenticated',$user->isAuthenticated());
|
||||
if($user->isAuthenticated()){
|
||||
$theme->set('User',$_SESSION["user_login"]);
|
||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||
}
|
||||
|
||||
if (!$id_post) {
|
||||
|
||||
$rows = array();
|
||||
if(!$id_post){
|
||||
$limit=$conf->postLimit;
|
||||
|
||||
if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric?
|
||||
|
|
@ -104,7 +104,7 @@ $template = new plantillas($conf->template);
|
|||
|
||||
if ($tumble->contarRegistros()>0) {
|
||||
$dateTmp = null;
|
||||
while($register = mysql_fetch_array($rs)) {
|
||||
while($register = mysql_fetch_assoc($rs)) {
|
||||
$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
||||
if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
|
||||
$strEnd=($conf->urlFriendly) ? "/" : "";
|
||||
|
|
@ -117,13 +117,16 @@ $template = new plantillas($conf->template);
|
|||
$register["title"] = stripslashes($register["title"]);
|
||||
$register["description"] = stripslashes($register["description"]);
|
||||
|
||||
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, );
|
||||
$postType = $tumble->getType($register["id_post"]);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_regular_post");
|
||||
$template->mostrarPlantilla();
|
||||
$row['Date_Added'] = $formatedDate;
|
||||
$row['Permalink'] = $permalink;
|
||||
$theme->set('postType',$postType);
|
||||
|
||||
switch ($postType){
|
||||
case "1":
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Body'] = $register["description"];
|
||||
break;
|
||||
case "2":
|
||||
$fileName = "uploads/".getFileName($register["url"]);
|
||||
|
|
@ -137,72 +140,56 @@ $template = new plantillas($conf->template);
|
|||
|
||||
$effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
|
||||
|
||||
$input = array("{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{Effect}", "{URL_Tumble}");
|
||||
$output = array($formatedDate, $permalink, $photoPath, strip_tags($register["description"]), $register["description"], $effect, $conf->urlGelato);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_photo");
|
||||
$template->mostrarPlantilla();
|
||||
$row['PhotoURL'] = $photoPath;
|
||||
$row['PhotoAlt'] = strip_tags($register["description"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
$row['Effect'] = $effect;
|
||||
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();
|
||||
$row['Quote'] = $register["description"];
|
||||
$row['Source'] = $register["title"];
|
||||
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("{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();
|
||||
$row['URL'] = $register["url"];
|
||||
$row['Name'] = $register["title"];
|
||||
$row['Description'] = $register["description"];
|
||||
break;
|
||||
case "5":
|
||||
$input = array("{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}");
|
||||
$output = array($formatedDate, $permalink, $register["title"], $tumble->formatConversation($conversation), $conf->urlGelato);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_conversation");
|
||||
$template->mostrarPlantilla();
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Conversation'] = $tumble->formatConversation($conversation);
|
||||
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();
|
||||
$row['Video'] = $tumble->getVideoPlayer($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
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();
|
||||
$row['Mp3'] = $tumble->getMp3Player($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$comment = new comments();
|
||||
$noComments = $comment->countComments($register["id_post"]);
|
||||
|
||||
$user = new user();
|
||||
$username = $user->getUserByID($register["id_user"]);
|
||||
|
||||
$row['User'] = $username["name"];
|
||||
$row['Comments_Number'] = $noComments;
|
||||
|
||||
$input = array("{Permalink}", "{User}", "{Comments_Number}");
|
||||
$output = array($permalink, $username["name"], $noComments);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_details");
|
||||
$template->mostrarPlantilla();
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
$theme->set('rows',$rows);
|
||||
|
||||
$p = new pagination;
|
||||
$p->Items($tumble->getPostsNumber());
|
||||
$p->limit($limit);
|
||||
|
||||
if($conf->urlFriendly){
|
||||
$p->urlFriendly('[...]');
|
||||
$p->target($conf->urlGelato."/page/[...]");
|
||||
|
|
@ -210,9 +197,8 @@ $template = new plantillas($conf->template);
|
|||
$p->target($conf->urlGelato);
|
||||
|
||||
$p->currentPage(isset($page_num) ? $page_num : 1);
|
||||
$p->show();
|
||||
|
||||
|
||||
$theme->set('pagination',$p->getPagination());
|
||||
} else {
|
||||
$template->renderizaEtiqueta("No posts in this tumblelog.", "div","error");
|
||||
}
|
||||
|
|
@ -230,13 +216,14 @@ $template = new plantillas($conf->template);
|
|||
$register["title"] = stripslashes($register["title"]);
|
||||
$register["description"] = stripslashes($register["description"]);
|
||||
|
||||
switch ($tumble->getType($register["id_post"])) {
|
||||
$row['Date_Added'] = $formatedDate;
|
||||
$row['Permalink'] = $permalink;
|
||||
$postType = $tumble->getType($register["id_post"]);
|
||||
$theme->set('postType',$postType);
|
||||
switch ($postType) {
|
||||
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();
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Body'] = $register["description"];
|
||||
break;
|
||||
case "2":
|
||||
$fileName = "uploads/".getFileName($register["url"]);
|
||||
|
|
@ -249,50 +236,35 @@ $template = new plantillas($conf->template);
|
|||
}
|
||||
|
||||
$effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
|
||||
$input = array("{Date_Added}", "{Permalink}", "{PhotoURL}", "{PhotoAlt}", "{Caption}", "{Effect}", "{URL_Tumble}");
|
||||
$output = array($formatedDate, $permalink, $photoPath, strip_tags($register["description"]), $register["description"], $effect, $conf->urlGelato);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_photo");
|
||||
$template->mostrarPlantilla();
|
||||
$row['PhotoURL'] = $photoPath;
|
||||
$row['PhotoAlt'] = strip_tags($register["description"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
$row['Effect'] = $effect;
|
||||
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();
|
||||
$row['Quote'] = $register["description"];
|
||||
$row['Source'] = $register["title"];
|
||||
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("{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();
|
||||
$row['URL'] = $register["url"];
|
||||
$row['Name'] = $register["title"];
|
||||
$row['Description'] = $register["description"];
|
||||
break;
|
||||
case "5":
|
||||
$input = array("{Date_Added}", "{Permalink}", "{Title}", "{Conversation}", "{URL_Tumble}");
|
||||
$output = array($formatedDate, $permalink, $register["title"], $tumble->formatConversation($conversation), $conf->urlGelato);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_conversation");
|
||||
$template->mostrarPlantilla();
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Conversation'] = $tumble->formatConversation($conversation);
|
||||
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();
|
||||
$row['Video'] = $tumble->getVideoPlayer($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
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();
|
||||
$row['Mp3'] = $tumble->getMp3Player($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -301,6 +273,11 @@ $template = new plantillas($conf->template);
|
|||
$comment = new comments();
|
||||
$rsComments = $comment->getComments($register["id_post"]);
|
||||
|
||||
$user = new user();
|
||||
$username = $user->getUserByID($register["id_user"]);
|
||||
|
||||
$row['User'] = $username["name"];
|
||||
|
||||
$textile = new Textile();
|
||||
if (empty($register["title"])) {
|
||||
if (!empty($register["description"])) {
|
||||
|
|
@ -313,30 +290,36 @@ $template = new plantillas($conf->template);
|
|||
}
|
||||
$postTitle = strip_tags($textile->TextileThis($postTitle));
|
||||
|
||||
$input = array("{Comments_Number}", "{Post_Title}");
|
||||
$output = array($comment->countComments($register["id_post"]), $postTitle);
|
||||
$template->precargarPlantillaConBloque($input, $output, "template_comments", "comments");
|
||||
$row['Post_Title'] = $postTitle;
|
||||
$row['Comments_Number'] = $comment->countComments($register["id_post"]);
|
||||
|
||||
$rows[] = $row;
|
||||
$theme->set('rows',$rows);
|
||||
|
||||
$comments = array();
|
||||
while($rowComment = mysql_fetch_assoc($rsComments)) {
|
||||
$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a>";
|
||||
$input = array("{Id_Comment}", "{Comment_Author}", "{Date}", "{Comment}");
|
||||
$output = array($rowComment["id_comment"], $commentAuthor, gmdate("d.m.y", strtotime($rowComment["comment_date"])+transform_offset($conf->offsetTime)), $rowComment["content"]);
|
||||
$template->cargarPlantillaConBloque($input, $output, "template_comments", "comments");
|
||||
|
||||
$answers['Id_Comment'] = $rowComment["id_comment"];
|
||||
$answers['Comment_Author'] = $commentAuthor;
|
||||
$answers['Date'] = gmdate("d.m.y", strtotime($rowComment["comment_date"])+transform_offset($conf->offsetTime));
|
||||
$answers['Comment'] = $rowComment["content"];
|
||||
|
||||
$comments[] = $answers;
|
||||
}
|
||||
$template->mostrarPlantillaConBloque();
|
||||
$theme->set('comments',$comments);
|
||||
|
||||
$input = array("{User_Cookie}", "{Email_Cookie}", "{Web_Cookie}", "{Id_Post}", "{Form_Action}", "{Date_Added}");
|
||||
$output = array(isset($_COOKIE['cookie_gel_user'])?$_COOKIE['cookie_gel_user']:'', isset($_COOKIE['cookie_gel_email'])?$_COOKIE['cookie_gel_email']:'', isset($_COOKIE['cookie_gel_web'])?$_COOKIE['cookie_gel_web']:'', $register["id_post"], $conf->urlGelato."/admin/comments.php", gmmktime());
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_comment_post");
|
||||
$template->mostrarPlantilla();
|
||||
$whois['User_Cookie'] = isset($_COOKIE['cookie_gel_user'])?$_COOKIE['cookie_gel_user']:'';
|
||||
$whois['Email_Cookie'] = isset($_COOKIE['cookie_gel_email'])?$_COOKIE['cookie_gel_email']:'';
|
||||
$whois['Web_Cookie'] = isset($_COOKIE['cookie_gel_web'])?$_COOKIE['cookie_gel_web']:'';
|
||||
$whois['Id_Post'] = $register["id_post"];
|
||||
|
||||
$theme->set('Date_Added',gmmktime());
|
||||
$theme->set('Form_Action',$conf->urlGelato."/admin/comments.php");
|
||||
$theme->set('whois',$whois);
|
||||
}
|
||||
}
|
||||
|
||||
$input = array("{URL_Tumble}");
|
||||
$output = array($conf->urlGelato);
|
||||
|
||||
$template->cargarPlantilla($input, $output, "template_footer");
|
||||
$template->mostrarPlantilla();
|
||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||
$theme->display(Absolute_Path.'themes/'.$conf->template.'/index.htm');
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,166 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
{Gelato_includes}
|
||||
<title>{Page_Title}</title>
|
||||
<!--[if IE]>
|
||||
<style type="text/css">
|
||||
div.post div.quote span.quote big.quote {
|
||||
line-height: 40px;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<a href="{URL_Tumble}/rss.php"><img src="{URL_Tumble}/themes/{Template_name}/img/rss.gif" id="rss" alt="RSS" title="RSS" /></a>
|
||||
|
||||
<h1><a href="{URL_Tumble}/">{Title}</a></h1>
|
||||
|
||||
<div id="description">
|
||||
{Description}
|
||||
</div>
|
||||
|
||||
{if {$isAuthenticated}}
|
||||
<div style="padding:4px; border:solid 2px #bbb; display:inline; background-color:#ddd; position:absolute; top:3px; right:3px;">
|
||||
<b>Hi, {User}.</b>
|
||||
<a target="_top" href="{URL_Tumble}/admin/index.php">Add/Edit my posts</a>
|
||||
<a target="_top" href="{URL_Tumble}/admin/close.php">Sign out</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{block {$rows} as {$row}}
|
||||
<div class="date">
|
||||
{$row.Date_Added}
|
||||
</div>
|
||||
{if {$postType}==1}
|
||||
<div class="post">
|
||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
<div class="regular">
|
||||
<h2><a href="{$row.Permalink}">{$row.Title}</a></h2>
|
||||
{$row.Body}
|
||||
</div>
|
||||
</div>
|
||||
{elseif {$postType}==2}
|
||||
<div class="post">
|
||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
<div class="photo">
|
||||
<a {$row.Effect}><img src="{$row.PhotoURL}" alt="{$row.PhotoAlt}" /></a><br/>
|
||||
<div class="caption">{$row.Caption}</div>
|
||||
</div>
|
||||
</div>
|
||||
{elseif {$postType}==3}
|
||||
<div class="post">
|
||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
<div class="quote">
|
||||
<span class="quote"><big class="quote"><a href="{$row.Permalink}">“</a></big> {$row.Quote}</span>
|
||||
<div class="source">— {$row.Source}</div>
|
||||
</div>
|
||||
</div>
|
||||
{elseif {$postType}==4}
|
||||
<div class="post">
|
||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
<div class="link">
|
||||
» <a href="{$row.URL}">{$row.Name}</a>
|
||||
<div class="description">{$row.Description}</div>
|
||||
</div>
|
||||
</div>
|
||||
{elseif {$postType}==5}
|
||||
<div class="post">
|
||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
<div class="conversation">
|
||||
...<h2><a href="{$row.Permalink}">{$row.Title}</a></h2>
|
||||
{$row.Conversation}
|
||||
</div>
|
||||
</div>
|
||||
{elseif {$postType}==6}
|
||||
<div class="post">
|
||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
<div class="video">
|
||||
{$row.Video}
|
||||
<div class="caption">{$row.Caption}</div>
|
||||
</div>
|
||||
</div>
|
||||
{elseif {$postType}==7}
|
||||
<div class="post">
|
||||
<a href="{$row.Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
<div class="video">
|
||||
{$row.Mp3}
|
||||
<div class="caption">{$row.Caption}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="totalComments">
|
||||
<h3>Posted by {$row.User} - <a href="{$row.Permalink}#comments">( {$row.Comments_Number} ) comments</a></h3>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{if {$id_post}}
|
||||
<div class="containerComments">
|
||||
<h3 id="comments">{$row.Comments_Number} answers to “{$row.Post_Title}”</h3>
|
||||
<ol class="commentlist">
|
||||
{block {$comments} as {$comment}}
|
||||
<li class="alt" id="comment-{$comment.Id_Comment}">
|
||||
<cite>
|
||||
<a href="#comment-{$comment.Id_Comment}" title="Comment permalink">#</a>
|
||||
{$comment.Comment_Author} said:
|
||||
</cite>
|
||||
<br />
|
||||
<span class="timestampComment"> at {$comment.Date}</span><br /><br />
|
||||
{$comment.Comment}
|
||||
<br /><br />
|
||||
</li>
|
||||
{/block}
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="containerFormComments">
|
||||
<h3 id="respond">Add your comment</h3>
|
||||
|
||||
<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
|
||||
<p>
|
||||
<label for="username">
|
||||
<small>Name:</small>
|
||||
</label>
|
||||
<input name="username" id="username" value="{whois.User_Cookie}" size="22" tabindex="1" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="email">
|
||||
<small>E-mail:</small>
|
||||
</label>
|
||||
<input name="email" id="email" value="{whois.Email_Cookie}" size="22" tabindex="2" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="web">
|
||||
<small>Website:</small>
|
||||
</label>
|
||||
<input name="web" id="web" value="{whois.Web_Cookie}" size="22" tabindex="3" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;"><a href="http://hobix.com/textile/">Textile</a> syntax is supported.</span>
|
||||
<p>
|
||||
<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
|
||||
</p>
|
||||
<p>
|
||||
<input name="id_post" id="id_post" value="{id_post}" type="hidden" />
|
||||
<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{else}
|
||||
{pagination}
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
<div id="footer">
|
||||
subscribe via <a href="{URL_Tumble}/rss.php">rss</a> /
|
||||
powered by <a href="http://www.gelatocms.com/">gelato cms</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
<div class="containerFormComments">
|
||||
<h3 id="respond">Add your comment</h3>
|
||||
|
||||
<form action="{Form_Action}" method="post" name="commentForm" id="commentForm">
|
||||
<p>
|
||||
<label for="username">
|
||||
<small>Name:</small>
|
||||
</label>
|
||||
<input name="username" id="username" value="{User_Cookie}" size="22" tabindex="1" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="email">
|
||||
<small>E-mail:</small>
|
||||
</label>
|
||||
<input name="email" id="email" value="{Email_Cookie}" size="22" tabindex="2" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="web">
|
||||
<small>Website:</small>
|
||||
</label>
|
||||
<input name="web" id="web" value="{Web_Cookie}" size="22" tabindex="3" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="content" id="content" cols="100" rows="10" tabindex="4"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;"><a href="http://hobix.com/textile/">Textile</a> syntax is supported.</span>
|
||||
<p>
|
||||
<input type="submit" value="Add comment" name="btnAdd" id="btnAdd" tabindex="5" />
|
||||
</p>
|
||||
<p>
|
||||
<input name="id_post" id="id_post" value="{Id_Post}" type="hidden" />
|
||||
<input name="comment_date" id="comment_date" value="{Date_Added}" type="hidden" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<div class="containerComments">
|
||||
<h3 id="comments">{Comments_Number} answers to “{Post_Title}”</h3>
|
||||
<ol class="commentlist">
|
||||
[bloque: comments]
|
||||
<li class="alt" id="comment-{Id_Comment}">
|
||||
<cite>
|
||||
<a href="#comment-{Id_Comment}" title="Comment permalink">#</a>
|
||||
{Comment_Author} said:
|
||||
</cite>
|
||||
<br />
|
||||
<span class="timestampComment"> at {Date}</span><br /><br />
|
||||
{Comment}
|
||||
<br /><br />
|
||||
</li>
|
||||
[/bloque: comments]
|
||||
</ol>
|
||||
</div>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
<div class="date">
|
||||
{Date_Added}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="post">
|
||||
<a href="{Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
|
||||
<div class="conversation">
|
||||
<h2><a href="{Permalink}">{Title}</a></h2>
|
||||
{Conversation}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<div class="totalComments">
|
||||
<h3>Posted by {User} - <a href="{Permalink}#comments">( {Comments_Number} ) comments</a></h3>
|
||||
</div>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
</div>
|
||||
<div id="footer">
|
||||
subscribe via <a href="{URL_Tumble}/rss.php">rss</a> /
|
||||
powered by <a href="http://www.gelatocms.com/">gelato cms</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
{Gelato_includes}
|
||||
<title>{Page_Title}</title>
|
||||
<!--[if IE]>
|
||||
<style type="text/css">
|
||||
div.post div.quote span.quote big.quote {
|
||||
line-height: 40px;
|
||||
}
|
||||
</style>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<a href="{URL_Tumble}/rss.php"><img src="{URL_Tumble}/themes/{Template_name}/img/rss.gif" id="rss" alt="RSS" title="RSS" /></a>
|
||||
|
||||
<h1><a href="{URL_Tumble}/">{Title}</a></h1>
|
||||
|
||||
<div id="description">
|
||||
{Description}
|
||||
</div>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<div style="padding:4px; border:solid 2px #bbb; display:inline; background-color:#ddd; position:absolute; top:3px; right:3px;">
|
||||
<b>Hi, {User}.</b>
|
||||
<a target="_top" href="{URL_Tumble}/admin/index.php">Add/Edit my posts</a>
|
||||
<a target="_top" href="{URL_Tumble}/admin/close.php">Sign out</a>
|
||||
</div>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
<div class="date">
|
||||
{Date_Added}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="post">
|
||||
<a href="{Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
|
||||
<div class="video">
|
||||
{Mp3}
|
||||
<div class="caption">{Caption}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
<div class="date">
|
||||
{Date_Added}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="post">
|
||||
<a href="{Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
|
||||
|
||||
<div class="photo">
|
||||
<a {Effect}><img src="{PhotoURL}" alt="{PhotoAlt}" /></a><br/>
|
||||
|
||||
<div class="caption">{Caption}</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
|
||||
<div class="date">
|
||||
{Date_Added}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="post">
|
||||
<a href="{Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
|
||||
<div class="quote">
|
||||
<span class="quote">
|
||||
<big class="quote"><a href="{Permalink}">“</a></big> {Quote}
|
||||
</span>
|
||||
<div class="source">— {Source}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
<div class="date">
|
||||
{Date_Added}
|
||||
</div>
|
||||
|
||||
<div class="post">
|
||||
<a href="{Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
<div class="regular">
|
||||
<h2><a href="{Permalink}">{Title}</a></h2>
|
||||
{Body}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
<div class="date">
|
||||
{Date_Added}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="post">
|
||||
<a href="{Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
|
||||
<div class="link">
|
||||
» <a href="{URL}">{Name}</a>
|
||||
<div class="description">{Description}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
|
||||
<div class="date">
|
||||
{Date_Added}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="post">
|
||||
<a href="{Permalink}"><img src="{URL_Tumble}/themes/tumblr/img/link.gif" class="permalink" alt="Permalink"/></a>
|
||||
|
||||
|
||||
<div class="video">
|
||||
{Video}
|
||||
<div class="caption">{Caption}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Loading…
Reference in New Issue