Template tags for who added the post and for comments number on the homepage

master
pecesama 2008-10-25 00:49:03 +00:00
parent 6d9bde1a85
commit f1578c0a52
3 changed files with 21 additions and 9 deletions

View File

@ -117,12 +117,10 @@ $template = new plantillas($conf->template);
$register["title"] = stripslashes($register["title"]); $register["title"] = stripslashes($register["title"]);
$register["description"] = stripslashes($register["description"]); $register["description"] = stripslashes($register["description"]);
$comment = new comments();
switch ($tumble->getType($register["id_post"])) { switch ($tumble->getType($register["id_post"])) {
case "1": case "1":
$input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}", "{Comments_Number}"); $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
$output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato, $comment->countComments($register["id_post"])); $output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato, );
$template->cargarPlantilla($input, $output, "template_regular_post"); $template->cargarPlantilla($input, $output, "template_regular_post");
$template->mostrarPlantilla(); $template->mostrarPlantilla();
@ -185,6 +183,20 @@ $template = new plantillas($conf->template);
$template->mostrarPlantilla(); $template->mostrarPlantilla();
break; break;
} }
$comment = new comments();
$noComments = $comment->countComments($register["id_post"]);
$user = new user();
$username = $user->getUserByID($register["id_user"]);
$input = array("{Permalink}", "{User}", "{Comments_Number}");
$output = array($permalink, $username["name"], $noComments);
$template->cargarPlantilla($input, $output, "template_details");
$template->mostrarPlantilla();
} }
$p = new pagination; $p = new pagination;

View File

@ -0,0 +1,3 @@
<div class="totalComments">
<h3>Posted by {User} - <a href="{Permalink}#comments">( {Comments_Number} ) comments</a></h3>
</div>

View File

@ -10,7 +10,4 @@
<h2><a href="{Permalink}">{Title}</a></h2> <h2><a href="{Permalink}">{Title}</a></h2>
{Body} {Body}
</div> </div>
<div class="totalComments">
<h3><a href="{Permalink}#comments">( {Comments_Number} ) comments</a></h3>
</div>
</div> </div>