瀏覽代碼

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

pecesama 15 年之前
父節點
當前提交
f1578c0a52
共有 3 個文件被更改,包括 21 次插入9 次删除
  1. 17 5
      index.php
  2. 3 0
      themes/tumblr/template_details.htm
  3. 1 4
      themes/tumblr/template_regular_post.htm

+ 17 - 5
index.php 查看文件

@@ -115,14 +115,12 @@ $template = new plantillas($conf->template);
115 115
 								$register["description"] = $register["description"];
116 116
 
117 117
                                 $register["title"] = stripslashes($register["title"]);
118
-                                $register["description"] = stripslashes($register["description"]);
119
-								
120
-								$comment = new comments();
118
+                                $register["description"] = stripslashes($register["description"]);								
121 119
 								
122 120
                                 switch ($tumble->getType($register["id_post"])) {
123 121
                                         case "1":
124
-                                                $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}", "{Comments_Number}");
125
-                                                $output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato, $comment->countComments($register["id_post"]));
122
+                                                $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
123
+                                                $output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato, );
126 124
                                                                                         
127 125
                                                 $template->cargarPlantilla($input, $output, "template_regular_post");
128 126
                                                 $template->mostrarPlantilla();
@@ -185,6 +183,20 @@ $template = new plantillas($conf->template);
185 183
                                                 $template->mostrarPlantilla();
186 184
                                                 break;
187 185
                                 }
186
+								
187
+								
188
+								$comment = new comments();
189
+								$noComments = $comment->countComments($register["id_post"]);
190
+								
191
+								$user = new user();
192
+								$username = $user->getUserByID($register["id_user"]);
193
+								
194
+								
195
+								$input = array("{Permalink}", "{User}", "{Comments_Number}");
196
+								$output = array($permalink, $username["name"], $noComments);
197
+																		
198
+								$template->cargarPlantilla($input, $output, "template_details");
199
+								$template->mostrarPlantilla();
188 200
                         }
189 201
 
190 202
                         $p = new pagination;

+ 3 - 0
themes/tumblr/template_details.htm 查看文件

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

+ 1 - 4
themes/tumblr/template_regular_post.htm 查看文件

@@ -9,8 +9,5 @@
9 9
 				<div class="regular">
10 10
 					<h2><a href="{Permalink}">{Title}</a></h2>
11 11
 					{Body}
12
-				</div>
13
-				<div class="totalComments">
14
-					<h3><a href="{Permalink}#comments">( {Comments_Number} ) comments</a></h3>
15
-				</div>		
12
+				</div>					
16 13
 			</div>