Author |
Message |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm

Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Fri Oct 30, 2009 2:02 pm |
|
Hi to everyone
I notice an issue when I installed NSN News from nukescript which shows wrong day and month and time.
It shows this
Tuesday, November 30 @ 00:00:00
Everytime I make a new topic it always shows the same. Any suggestion?
 |
|
|
|
 |
jakec
Site Admin

Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Mon Nov 02, 2009 1:20 am |
|
|
|
 |
hicuxunicorniobestbuildpc

|
Posted:
Wed Nov 04, 2009 7:24 am |
|
ok! I am here again with good news. I spent more than one hour to figure it out what was the problem on news modules. IT WASN'T ANY BUG OR ANY ERROR ON NSN NEWS. I COULDNT FIND ANYTHING TO SOLVE THE PROBLEM BUT:
The solution is there is a bug on mainfile.php
Open your ftp
Open your mainfile.php where your config.php is
Search for
Code:function formatTimestamp($time) {
global $datetime, $locale;
setlocale (LC_TIME, $locale);
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
$datetime = strftime(""._DATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
$datetime = ucfirst($datetime);
return($datetime);
}
|
Replace with
Code:function formatTimestamp($time) {
global $db, $prefix, $datetime, $user, $cookie, $locale;
setlocale (LC_TIME, $locale);
$convtime = strtotime($time);
if (is_user($user)) {
$result = $db->sql_query("SELECT user_timezone FROM ".$prefix."_users WHERE user_id='$cookie[0]'");
$row = $db->sql_fetchrow($result);
$timeoffset = intval($row['user_timezone']*3600);
$datetime = gmstrftime(""._DATESTRING3."", $convtime + $timeoffset);
} else {
$datetime = gmstrftime(""._DATESTRING4."", $convtime);
}
return($datetime);
}
|
Open language folder on the root where mainfile.php is
Open lang-english.php
add this at the end
Code:define("_DATESTRING3","%A, %B %e, %Y @ %I:%M %p");
define("_DATESTRING4","%A, %B %e, %Y @ %I:%M %p %Z");
|
This will solve all your problems
I am so happy to fix this. |
|
|
|
 |
hicuxunicorniobestbuildpc

|
Posted:
Mon Nov 16, 2009 3:10 am |
|
Am I the only here who had this problem? lol  |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Mon Nov 16, 2009 10:10 am |
|
I know several people who use NSN News but they have never reported this and the original function you posted is used for the standard News module also.
Just so I'm sure of the problem, are you saying that all news posts had the exact same date and time or were they just formatted incorrectly. |
|
|
|
 |
hicuxunicorniobestbuildpc

|
Posted:
Tue Nov 17, 2009 6:10 am |
|
Quote: | are you saying that all news posts had the exact same date and time |
Yes Sir! |
|
|
|
 |
|