Current time: 04-16-2014, 04:19 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 2 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Need a bit PHP help
03-19-2012, 01:11 PM (This post was last modified: 03-19-2012 02:25 PM by mattias.)
Post: #1
[SOLVED] Need a bit PHP help
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.
Find all posts by this user
Quote this message in a reply
03-19-2012, 01:45 PM
Post: #2
RE: Need a bit PHP help
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>';
        } 

[Image: 16mJ9bI]
MyBBsmsAPP | MyStatus | ProProfile
Visit this user's website Find all posts by this user
Quote this message in a reply
03-19-2012, 02:02 PM
Post: #3
RE: Need a bit PHP help
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 :)
Find all posts by this user
Quote this message in a reply
03-19-2012, 02:12 PM
Post: #4
RE: Need a bit PHP help
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

[Image: 16mJ9bI]
MyBBsmsAPP | MyStatus | ProProfile
Visit this user's website Find all posts by this user
Quote this message in a reply
03-19-2012, 02:23 PM
Post: #5
RE: Need a bit PHP help
Thanks a bunch! It worked.
Greatly appreciated your help Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication