Browse Source

Fixed bug when not post Title on comments

pecesama 17 years ago
parent
commit
a46485e514
1 changed files with 13 additions and 1 deletions
  1. 13 1
      index.php

+ 13 - 1
index.php View File

289
 					$comment = new comments();
289
 					$comment = new comments();
290
 					$rsComments = $comment->getComments($register["id_post"]);
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
 					$input = array("{Comments_Number}", "{Post_Title}");				
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
 					$template->precargarPlantillaConBloque($input, $output, "template_comments", "comments");
306
 					$template->precargarPlantillaConBloque($input, $output, "template_comments", "comments");
295
 
307
 
296
 					while($rowComment = mysql_fetch_assoc($rsComments)) {
308
 					while($rowComment = mysql_fetch_assoc($rsComments)) {