Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NSN News
Author Message
hicuxunicorniobestbuildpc
Life Cycles Becoming CPU Cycles


Joined: Aug 13, 2009
Posts: 967
Location: Netherland

PostPosted: Fri Oct 30, 2009 2:02 pm Reply with quote

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?

Sad
 
View user's profile Send private message Visit poster's website
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Mon Nov 02, 2009 1:20 am Reply with quote

<BUMP>
 
View user's profile Send private message
hicuxunicorniobestbuildpc
PostPosted: Wed Nov 04, 2009 7:24 am Reply with quote

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

Very Happy I am so happy to fix this.
 
hicuxunicorniobestbuildpc
PostPosted: Mon Nov 16, 2009 3:10 am Reply with quote

Am I the only here who had this problem? lol speedtype
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Mon Nov 16, 2009 10:10 am Reply with quote

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.
 
View user's profile Send private message Send e-mail
hicuxunicorniobestbuildpc
PostPosted: Tue Nov 17, 2009 6:10 am Reply with quote

Quote:
are you saying that all news posts had the exact same date and time


Yes Sir!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NSN News

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©