What I’m trying to do with Comikaze is change the display of date/time from “Y-m-d H:i:s” to “l, M j, Y - g:ia T” (ex: Monday, Oct 16, 2006 - 3:18pm PDT). Normally, this is something I’d expect to be able to do from the script’s admin control panel however oddly enough, this is one of the variables that doesn’t work when it comes to making changes to it. Even stranger still is that if I were to believe the CP, the date/time display should be “d M Y h:i a”. However as I just mentioned the date/time that is printed on the news posts follows the “Y-m-d H:i:s” format. So changes in the CP are (unfortunately) out of the question.
After checking through the script’s forum and looking through the source code I was pointed to a fix that goes something like this:
Step 1) Modify the code in the newsDO.class.php file from
Line #291: $date = $this->_db->DBDate( $this->_common->adjustDatetimeTZOffset(date("Y-m-d H:i:s",$time)));
Line #291: $date = $this->_db->DBDate(date("l, M j, Y - g:ia T",$time));
Step 2) In the MySQL database, in [COLOR=DarkRed]table: comikaze_news, field: time_posted[/COLOR]; change the type of field from: [COLOR=DarkRed]“datetime”[/COLOR] to [COLOR=DarkRed]“text”[/COLOR] and remove the [COLOR=DarkRed]default value of “0000-00-00 00:00:00”[/COLOR]
By following these two steps, the date/time display works correctly however I’ve discovered a “snag” in the fix. When working correctly each time a new post for a specific comic is made, the news posts are displayed top to bottom from oldest to newest (ascending order). When this “fix” is applied, as long as the news posts for a given comic are made on the same day, everything works fine. When the news posts for a given comic are posted over multiple days, their placement gets completely screwed up and it no longer follows an ascending order in accordance to the date and time of the post. The date/time still appear correctly according to the new format, but they’re no longer appearing in chronological order.
I was wondering if anyone might have some ideas as to how to fix this. Ultimately, all I want is for the news posts to appear in the correct order, and for them to carry the “l, M j, Y - g:ia T” format.
I tried going through every bit of code and changing all occurances of “Y-m-d H:i:s” to “l, M j, Y - g:ia T”, but that didn’t work. I have a feeling it has something to do with how it’s interacting with the database, maybe that default value of “0000-00-00 00:00:00”. I’ve included the default newsDO.class.php file incase anyone feels like having a look at it.
If anyone has any thoughts, once again, you’d be saving my butt. Thanks for your time and help!!