Author |
Message |
valdarez
Worker


Joined: Jan 22, 2007
Posts: 104
|
Posted:
Mon Jul 30, 2007 12:02 pm |
|
I noticed that the Time of the Stories on the RavenNuke website is in a different format that what's being displayed on my website.
RavenNuke Format: Monday, July 30, 2007 @ 13:13:19 EDT
My Current Format: Wednesday, July 30 @ 04:20:50 NZST
My Desired Format: July, 30 2007
For each theme, it appears that the $time if passed to the themeindex($aid, $informant, $time, $title,....) method, and that the $time is already a formatted String object, not a true Date that can then be formatted. As a String, it's already lost it's 'year', by the time it's passed to this method.
I tried several different themes to verify that this is the case, and none of them, including the default RavenNuke theme will display the year in the news/story.
Is this a bug with RavenNuke, or a problem with my current configuration/setup?
What do I need to do in order to have it simply show the date in the format of Month Day, Year? |
|
|
|
 |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Mon Jul 30, 2007 12:16 pm |
|
Yeah, don't get me started on how the news system does the date/time thing. It is a big stupid train wreck full of global variables and other bad programming practices.
However it looks like all you have to do is modify the constant _DATESTRING which is found in the root language directory; e.g. language/lang-english.php:
define('_DATESTRING','%A, %B %d, %Y @ %H:%M:%S %Z');
See the man page for strftime to discover what all these crazy symbols mean.
http://us3.php.net/manual/en/function.strftime.php
You probably want:
define('_DATESTRING', '%B %d, %Y');
You'll have to do it for each language you want to support. Hope that helps. |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
valdarez

|
Posted:
Mon Jul 30, 2007 12:47 pm |
|
This isn't the first time I have run into a problem with themes and data not being in the format or manipulated where you would think it would be. Needless to say, the answer you provided isn't intuitive for a PHPNuke amateur such as myself.
Thanks for the help and the quick response Gremmie! |
|
|
|
 |
fkelly
Former Moderator in Good Standing

Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY
|
Posted:
Mon Jul 30, 2007 2:40 pm |
|
Just to complete the picture, what happens here is that the /news/index.php calls the mainfile function formatTimestamp with the parameter $time. $time gets it value from what is retrieved from the story table for that story.
I just recall this because when we were working on RN2.10 some performance tests showed that the setlocale function that's embedded in formatTimestamp was a big (relatively speaking) performance "hit". I spent some time researching alternatives but never found anything sure fire. I believe in many cases the system works fine without setlocale at all but I couldn't assure that across the board in order to eliminate it.
More to the point, you might want to do some kind of global search on where _DATESTRING is used because changing it for news will change it everywhere throughout the system. That might be what you want ... but maybe not. Humm, looking at the code you might want to see if formatTimestamp is called from anywhere else than news. _DATESTRING is "hard-coded" within that and will automatically be used. |
|
|
|
 |
Gremmie

|
Posted:
Mon Jul 30, 2007 2:48 pm |
|
It is so ridiculous how it is implemented right now....
I just did a find and grep, and _DATESTRING is only used for News. |
|
|
|
 |
|