The simpler media website CMS
Since upgrading to 1.6 (official build) the IP address for comments no longer displays correctly (shows 0.0.0.0 on new comments following the upgrade - earlier comments display correctly).
Also since the upgrade the date/time field for comments is defaulting to 1970-01-01 01:00:00 - this applies to old (pre-update) as well as new comments.
The database table 'comments' show both fields are correct.
Zenphoto version 1.6 (Official build)
Current locale setting: en_US.UTF8
Server software: Apache
PHP version: 8.0.26
Graphics support: PHP GD library bundled (2.1.0 compatible)
supporting: gif, jpg, jpeg, png, wbmp, webp
PHP memory limit: 256M
Database: MySQL 8.0.31
Database handler: MySQLi
Database client: mysqlnd 8.0.26
Try choosing another date format on the options and if you use a custom theme update definitions. There have been some changes required by PHP 8.1 - see the release post please, there are also tickets and some forum post about date related issues - that are sadly not yet fully working on some date formats (and may never, we are investigation on this).
Sorry. My query wasn't clear.
The date displays correctly when the comment itself is viewed in the album to which it refers.
It's only on the admin comments page:
that the date and IP addresses are missing.
Have tried changing date format but that hasn't had any effect. And IP addresses prior to the 1.6 upgrade are showing.
But no worries. I'll check the release notes as advised.
We have to try to reproduce that since we don't really use comments actively.
Regarding the IP addresse there are privacy settings - Since 1.5.something, I don't remember - if that is stored respectively how complete at all since it is prohibitied by the GDRP privacy laws within the EU where we are. If you have that enabled it might not show because there is none. If it is older comments, I don't think we changed anything regarding this for some time…
I cannot reproduce this. The date/time is hardcoded so choosing another format has no effect. As for the IP address please check if the option Admin -> Options -> Security -> Anonymize IP is set correctly.
Any entries in the logs?
Thank you - Anonymize IP had indeed been set to Full Anonymization. Now reset to an acceptable level (I am in the EU so need anonymizing).
However comments are still not showing a date/time for entry in the admin comments page (thought they do show correctly in the comment itself when viewed). All entries (including pre-1.6) are showing:
Like @fretzl I cannot reproduce it. I get normal Y-m-d H:i:s format here as it is stored in the db itself. The comments admin apge does not even use a specific formatted date but just
date('Y-m-d H:i:s', strtotime($date)).
So it is not even related or affected by the PHP 8.1
strftime()deprecation trouble with localized date formats we still have sadly.
Are there any related errors in the debug log? Can you view the database directly and see if there is actually a date stored?
The 1970 date normally only appears if the date is somehow invalid (empty or otherwise wrong).
That's what I found strange: the database does contain the date/time (and it appears correctly when the comment itself is viewed on the album page). It's only on the comments admin page that it displays as the default value.
No errors in the debug log when a comment is made (only the entry which says that the comment is not spam).
It's not a big issue. I'll continue to try to find out the cause with my limited software skills (though we're heading off on a long holiday shortly and so won't be able to give it much attention!)
Thanks for your efforts.
Really strange. Does the date show correctly on the page when you edit a single comment? Technically it probably should not since it is displayed using
date('Y-m-d H:i:s', strtotime($date))in both places. (admin-comments.php lines 170 and 425)
What I found is that we before that we seem to use
myts_date('m/d/Y h:i A', $comment['date']).
myts_date()is one of our functions to format a SQL timestamp. Don't remember why this is used here since we don't store a timestamp but actually the date we display… Seems we do a little too much converting here. Perhaps it was once needed and just forgotten on the way…
Hello Acrylian: Regarding this topic, and after having updated to 1.6, I also have the same problem in the "Comments" tab of the Back end; Totally absurd dates and times are displayed, in yyyy-mm-dd hh:mm format, although in my case the IPs are displayed correctly. If I log in to edit the comment, the current date and time is displayed correctly on the edit page. I use in my page the date format dd/mmm/yyyy - HH:mm.
Like guirala editing individual comments displays the date/time correctly, as does viewing the comment itself.
It's only the comment admin page which seems to display incorrectly.
The IP display issue I had has been resolved after changing the Anonymize IP setting, thank you
Thanks, despite not being able to reproduce right now, we will be working on the internal date stuff soon.
How does the date for the comments in the database itself look like? It should be stored as Y-m-d H:i:s format actually,
Effectively Acrylian, in the database you can see the date of the comments in yyyy-mm-dd hh:mm:ss format.
Thanks, that's the format I was referring to (by PHP date format values) and as it should be. The display issue is even more strange then though…