Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
jane65
Regular
Regular


Joined: Feb 24, 2009
Posts: 81
Location: UK

PostPosted: Wed Apr 16, 2014 11:59 am Reply with quote

Hi,
I have the correct time displaying on my site in the Site info block, but when I post news comments, the time displayed in the comment boxes is 6 hours behind. I am in the UK, but my server is in the US. I added date_default_timezone_set("Europe/London"); to the block-User_Info.php file and I've also changed it to Europe/London in the mainfile.php, but still the comment posts show the wrong time. Please can anyone tell me how I can fix this?

Thanks in advance for any help Smile
 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team


Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Wed Apr 16, 2014 4:43 pm Reply with quote

If you are logged in as a user, you should be able to adjust it in Your Account - Preferences - Forums Timezone. The time posted should take that into consideration when the comment is posted.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
jane65
PostPosted: Thu Apr 17, 2014 9:43 am Reply with quote

Thanks Nuken. I just tried that but it hasn't worked, test comments are still showing 6 hours behind my UK time. I noticed that in my account it also shows that my last visit was 6 hours behind time too.
 
neralex
The Mouse Is Extension Of Arm


Joined: Aug 22, 2007
Posts: 1328
Location: Germany

PostPosted: Fri Apr 18, 2014 9:54 am Reply with quote

jane65, try to remember what you have installed at last.

Do you have nukeSPAM installed?
Do you have activated the user-info block on the left side or on the right side?

If you have the user-info on the left side, then it seems you have added a new timezone setting after loading the left blocks.
 
View user's profile Send private message
jane65
PostPosted: Sun Apr 20, 2014 5:11 pm Reply with quote

Hi Neralex, The user-info block is on the left side, but that is showing the correct time. I noticed today that in my account, it is now showing the right time, so it just seems to be when I post a News comment that the wrong time is being displayed. I don't have nukeSPAM installed as far as I know.
 
nuken
PostPosted: Mon Apr 21, 2014 7:14 pm Reply with quote

Look in modules/News/comments.php and find around line 904

Code:


$userTimeZone = ($userTimeZone-$serverTimeZone) *3600;


and change to

Code:


//$userTimeZone = ($userTimeZone-$serverTimeZone) *3600;


See if that makes it correct.
 
jane65
PostPosted: Sun Apr 27, 2014 1:50 pm Reply with quote

Hi Nuken, Thanks but that didn't correct it.
 
nuken
PostPosted: Sun Apr 27, 2014 5:03 pm Reply with quote

OK, help me out a bit here. What was it showing before the change, after the change and what do you want it to show?
 
nuken
PostPosted: Sun Apr 27, 2014 5:04 pm Reply with quote

Also, what do you have set in your account for the Forums Timezone? And does your forum show the correct time when you post in it?
 
jane65
PostPosted: Tue Apr 29, 2014 11:43 am Reply with quote

Thanks for your reply Nuken,

I believe it has always shown the servers time in the US before and after the change, but I'd like it to show my time in the UK. In my account the time is set to GMT. I don't actually have a forum activated on the site, so I don't know if that shows the correct time for posts. I suppose I could set the forum up to see what time posts show there, but it'll probably be a few days before I get round to doing that.
 
nuken
PostPosted: Tue Apr 29, 2014 12:07 pm Reply with quote

The only reason I asked about forums is when I was testing the comments time on a test site, the comment time was off from the forums time. After I made the change mentioned above, it corrected the difference as long as I had the Forums Timezone set correctly. I have mine as GMT -5 Hours which made the time on posts and comments the same as my time zone. Try to adjust your user account Forums Timezone, it should allow you to sync the time.
 
nuken
PostPosted: Tue Apr 29, 2014 12:16 pm Reply with quote

I think I understand what you are saying now. You want it to only show your default time zone and not the users set time zone. Is that correct?
It is designed to allow the user to adjust the time to his or her time. If that is what you are trying to do, I can look and see how hard it would be to change it.
 
jane65
PostPosted: Fri May 02, 2014 7:05 am Reply with quote

Thanks for replying Nuken, yes that's right, I'd like it to show the default time zone no matter where the User posts from.
 
nuken
PostPosted: Fri May 02, 2014 9:57 am Reply with quote

Look in your PM.
 
jane65
PostPosted: Sat May 03, 2014 5:24 am Reply with quote

Thanks Nuken, but unfortunately that hasn't worked either, there isn't any change, so I suppose it must be being overridden by code somewhere else. Maybe it is a forum setting although I don't have the forum activated.

To recap -

In Site Info - time is showing correct UK time, so that's fine.

Comment Posts are showing what must be my US Server time on posts - 6 hours behind my UK time, whereas I'd like it to display UK time, no matter where anyone posts from in the world.

In my user account from which I post the comments, I have my timezone set to GMT.
 
nuken
PostPosted: Sat May 03, 2014 5:56 am Reply with quote

On my test site, the changes to the comments.php changed the time. I am not sure what may be going on on your site that would be different. You are talking about comments in the News and not posts in the News, correct?
 
neralex
PostPosted: Sun May 04, 2014 5:34 am Reply with quote

jane65, you have two possiblities to search the place where the timezone is changed in your php-files.

You can create a backup of your files and search with your code-editor like dreamweaver or notepad++ with a string like "timezone".

Or you can test it live in your running page with this snippet on different places in your files:

php Code:
if (is_admin($admin)) {

echo '<br />server-time: ' , date('d.m.Y H:i:s T') , '<br />';
}


If you would add it on different files maybe like header.php, footer.php, modules.php, end of mainfile.php, index.php and/or comments.php and/or article.php of the News module etc. then you can see as admin the current servertime and then you can find also the file where the timezone override is based. It could be also a 3rd party block-file or a other script that you have installed.

If you are not sure what you have installed, then you should write it down after every installation, so you can go back step by step. But no one knows, what are you doing with your files. The fact: in the core-version of the download-package isn't exist this issue. It can only be self installed script and this was only you, mate.
 
jane65
PostPosted: Wed May 14, 2014 12:40 pm Reply with quote

Thank you very much for your replies, sorry I've only just got back to this. I have modified some files so it's very possible I have changed something along the way. I am talking about the comments posts nuken, in fact, I wouldn't know if the main news posts show the right time because I changed the code to stop the time showing on the main posts a long time ago. Maybe that is the cause of the problem, so I'll take a look at that, and if not, then I will try what you've suggested Neralex. Thank you for your help Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©