Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Need a bit PHP help
#1
Hi,

Can someone tell me the correct if condition if at least one reply has been posted in a thread?

I tried if($thread['replies'] > 0), but it didn't work :(

I want to show "no replies" in the last reply column if a thread has no replies. Thanks.
Reply
#2
Open ./forumdisplay.php and find;
PHP Code:
$thread['replies'] = my_number_format($thread['replies']); 
and Change it into;
PHP Code:
        if ($thread['replies'] != "0")
        {
            
$thread['replies'] = my_number_format($thread['replies']);
        }
        else
        {
            
$thread['replies'] = '<span class="smalltext">No Replies</span>';
        } 
Reply
#3
Thanks for your help, but that is not exactly that what I'm looking for.
Your code puts a "No Replies" in the replies column and not in the last reply column:
[Image: 28snoo64.png]

Correct it should look like this:
[Image: gankjohl.png]

Thanks again for your help :)
Reply
#4
OK, then remove the edited part and add the following code just below $thread['replies'] = my_number_format($thread['replies']);
Code:
if ($thread['replies'] != "0")
{
   $replied = '';
}
else
{
   $replied = '<span class="smalltext">No Replies</span>';
}

Now add {$replied} in "forumdisplay_thread" template below "{$lastposterlink}" or where you want text to appear Smile
Reply
#5
Thanks a bunch! It worked.
Greatly appreciated your help Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)