Comments has a default 1970 entry

Permalink
My comments box has a default 1970 entry but it disappears as soon as the 1st comment has been added. (see attached).

I've tried to search for similar topics online but can't seem to see anyone having the same problem.

2 Attachments

zapbrannigan1972
 
Remo replied on at Permalink Reply
Remo
your "comment box" is a guestbook block, isn't it?
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
Hi Remo,

Yes it is.
Remo replied on at Permalink Reply
Remo
I'm on a 5.5.2.1 site and can't seem to reproduce this, no matter what I do..

1970 usually means that there's no date. MySQL's behaviour with dates is sometimes a bit unexpected.. 1970 is the start of the unix time, basically "nothing" means 1st of January 1970. Not that this helps though ;-)
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
I'm on 5.5.2.1 also. I thought it may be as I was logged in, but I ran an incognito window in chrome and it still displayed.

This is the source that displays this box:

<p><strong><?php 
               if( intval($p['uID']) ){
                  $ui = UserInfo::getByID(intval($p['uID']));
                  if (is_object($ui)) {
                     echo $ui->getUserName();
                  }
               }else echo $p['user_name'];
               ?></strong><br><span class="commentDate"><?php echo date($dateFormat,strtotime($p['entryDate']));?></span></p>
         </div>
Remo replied on at Permalink Reply
Remo
The problem is probably caused because $p['entryDate'] is empty, not because of the code you posted.

But without being able to reproduce it, it's hard to tell why that variable is empty...
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
I think I may have knacked up my template as it won't now display all the comments added, it will only display the last one. I may have to undo my changes and start again.

Thanks Remo.
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
It's the 'strtotime' I think but I don't even want this div to display until comments are added. Odd.