1 (edited by 2008-08-03 14:06:59)

Topic: [HACK] Display some text when no comments have been made

Name: No comments message
Author: GrandmasterNeil
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: Instead of the comments number, you'll see a message.
Instructions:
in "shows.inc.php" find multiple times:

$output = str_replace("{comments-num}", countComments($news_arr[0], $archive), $output);


replace it with:

if (countComments($news_arr[0], $archive) == 0)
{
  $output = str_replace("{comments-num}", "Be the first to add a comment!", $output);
}
else
{
  $output = str_replace("{comments-num}", countComments($news_arr[0], $archive)." comments", $output);
}


You can replace "Be the first to add a comment" with anything you like and " comments" like-wise.
Just make sure in your templates that you don't have anything following {comments-num}.