Procházet zdrojové kódy

Comments number on front-page

pecesama před 16 roky
rodič
revize
510091bc10

+ 2 - 1
admin/themes/admin/template_add_video.htm Zobrazit soubor

@@ -3,7 +3,8 @@
3 3
 			<label for="url">Video URL</label>			
4 4
 			<br /><input class="txt" type="text" name="url" id="url" value="{editUrl}" size="80" />
5 5
 			<div style="color: rgb(136, 136, 136); margin-bottom: 5px; font-size: 11px; font-weight: bold;">
6
-				This is the URL from the video sites YouTube, Vimeo, Yahoo, Daily Motion or even an Slide Share Presentation.<br>
6
+				This is the URL from the video sites YouTube, Vimeo, Yahoo, Daily Motion <br />
7
+				or even an Slide Share Presentation.<br />
7 8
 				<span style="font-size: 10px; font-weight: normal;">(ie. http://youtube.com/watch?v=HcBFLN9cli0)</span>
8 9
 			</div>
9 10
 		</div>									

+ 5 - 3
index.php Zobrazit soubor

@@ -116,11 +116,13 @@ $template = new plantillas($conf->template);
116 116
 
117 117
                                 $register["title"] = stripslashes($register["title"]);
118 118
                                 $register["description"] = stripslashes($register["description"]);
119
-
119
+								
120
+								$comment = new comments();
121
+								
120 122
                                 switch ($tumble->getType($register["id_post"])) {
121 123
                                         case "1":
122
-                                                $input = array("{Date_Added}", "{Permalink}", "{Title}", "{Body}", "{URL_Tumble}");
123
-                                                $output = array($formatedDate, $permalink, $register["title"], $register["description"], $conf->urlGelato);
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"]));
124 126
                                                                                         
125 127
                                                 $template->cargarPlantilla($input, $output, "template_regular_post");
126 128
                                                 $template->mostrarPlantilla();

+ 14 - 1
themes/tumblr/style.css Zobrazit soubor

@@ -292,4 +292,17 @@ color: #ccc;
292 292
 #commentForm #btnAdd {
293 293
 	margin: 0;
294 294
 	float: right;
295
-}
295
+}
296
+
297
+.totalComments h3 {
298
+	margin: 0 10px 0 0;
299
+	font-size: 10pt;
300
+	font-weight: normal;
301
+	text-align: right;
302
+	color: #999;
303
+	font-style: italic;
304
+}
305
+
306
+.totalComments a {
307
+	color: #999;
308
+}

+ 4 - 1
themes/tumblr/template_regular_post.htm Zobrazit soubor

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