Pārlūkot izejas kodu

Fixed bug when not post Title on comments

pecesama 16 gadus atpakaļ
vecāks
revīzija
a46485e514
1 mainītis faili ar 13 papildinājumiem un 1 dzēšanām
  1. 13 1
      index.php

+ 13 - 1
index.php Parādīt failu

@@ -289,8 +289,20 @@ $template = new plantillas($conf->template);
289 289
 					$comment = new comments();
290 290
 					$rsComments = $comment->getComments($register["id_post"]);
291 291
 					
292
+					$textile = new Textile();
293
+					if (empty($register["title"])) {
294
+						if (!empty($register["description"])) {
295
+							if (strlen($register["description"]) > 30) {
296
+								$postTitle = substr($register["description"], 0, 30)."...";
297
+							}
298
+						}
299
+					} else {
300
+						$postTitle = $register["title"];
301
+					}
302
+					$postTitle = strip_tags($textile->TextileThis($postTitle));
303
+					
292 304
 					$input = array("{Comments_Number}", "{Post_Title}");				
293
-					$output = array($comment->countComments($register["id_post"]), $register["title"]);
305
+					$output = array($comment->countComments($register["id_post"]), $postTitle);
294 306
 					$template->precargarPlantillaConBloque($input, $output, "template_comments", "comments");
295 307
 
296 308
 					while($rowComment = mysql_fetch_assoc($rsComments)) {