Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Tue Oct 19, 2004 5:09 am
The forums are easy - use forum admin but people can adjust it as they wish. If you are talking about the news items, many have tried - many have died .
You can try this little diddy
Only registered users can see links on this board! Get registered or login to the forums!
The following is an adaption of what we use at IPBNuke.net (InvisionPowerBoard rather then phpBB). It is by no means a finished solution but could be a basis to work with.
When a user is logged in, their timezone offset from the phpBB forums is applied to post times in news articles and comments (and anywhere else the formatTimstamp funtion is called upon). If not logged in, the times shown will be in GMT.
Thanks, this would be great if it works (I don't use InvisionPowerBoard, I use phpbb) but I'll give it a try.
But first I can't figure out how to change the system timezone. When I go to Admin CP, Forums, then Configuration under the General Admin area, there is an option in there that is titled "System Timezone". No matter what I put in there, when I make a post, it shows the time as being 1 hour earlier than what it is in my local area. I'm not sure why it won't work for me, but is that the timezone you are talking about?
Its an adaption of what we use with IPB - I rewrote it to work for phpBB..
The System Timezone should be set so that the board is in GMT time. Then, each member can enter their true Timezone in their Profile and have posts show in local time.
This is the way all boards should be setup.
Agreed... and where do I set the System Timezone? In the server itself (in which case, Raven would change) or somewhere in my own nuke or phpbb setup? What about the question I asked above about the place I was trying to change?
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Wed Oct 20, 2004 6:08 am
There isn't a single setting in nuke to do this,; that's the problem. What Holbrook is saying, if I understand him correctly, is that he is offering a means to take the timezone setting from the forums (which people can change) and adapt an offset to any nuke code that calls 'formatTimestamp'. That way everyone sees the times in THEIR timezone, just as we do in the forums. Holbrook, correct me if I'm wrong.
This is nice! I'm still and hour off for some reason but one heck of a lot nicer then it was. I set Forums Sytem Time to GMT and my preference to -6 but the time in comments shows and hour earlier 6:30 instead of 7:30.
I assumed here: "When I go to Admin CP, Forums, then Configuration under the General Admin area, there is an option in there that is titled "System Timezone"." If that isn't the right place perhaps one of the other guys can point you in the right direction - it's has been a while since I played with phpBB.
Hi Raven, yes I understood what what being proposed, the problem is that if my time isn;t set correctly in the first place, then it won't do much good to put in a code snippet to make a correction to offset it it to get my correct local time. And even now I'm still trying to find out why I can't change the time zone in the forums. Maybe I'll describe the problem again, pasted from my earlier post:
But first I can't figure out how to change the system timezone. When I go to Admin CP, Forums, then Configuration under the General Admin area, there is an option in there that is titled "System Timezone". No matter what I put in there, when I make a post, it shows the time as being 1 hour earlier than what it is in my local area. I'm not sure why it won't work for me <snip>
In the meantime, the other time the time zone difference bothers me is when I go to my website and look at the User Info stats, like how many members signed up that day, yesterday, etc. Will the above script mod fix that problem too?
The following is an adaption of what we use at IPBNuke.net (InvisionPowerBoard rather then phpBB). It is by no means a finished solution but could be a basis to work with.
When a user is logged in, their timezone offset from the phpBB forums is applied to post times in news articles and comments (and anywhere else the formatTimstamp funtion is called upon). If not logged in, the times shown will be in GMT.
So if a sites in the UK and the server is in the US that wouldnt make any difference, the news articles and stuff would be the same as the user's profile time right?
hey this is really good, I've wanted to get this sorted for ages. Solves the problem of daylight saving time changes too.
Thanks a lot!!!
One question, when a news article is posted with the date you post it, how does this mod affect that, and old articles????
I've just updated our IPBNuke version of this code to use the Locale Time Format setting in Administration->Preferances, and thought I should do the same for the phpBB code posted here.
In mainfile.php -
Find:
Some info regarding locale settings..
The default PHP-Nuke setting for Locale Time Format is en_US (English languge/United States location). If, for example, you wanted the date/time displayed in Spanish you would probably use es_ES, French would be fr_FR, etc.
However, some server operating systems don't use the exact same format - FreeBSD for example requires a longer string, eg: en_US.ISO8859-1. So if changing your Locale setting makes no differance to the timestamps shown, you should probably contact your host for advice on the correct format.
But wait, there's more!
If you wish to use a Locale string of more than 10 characters you will need to modify your PHP-Nuke database. The locale field in the nuke_config table has a limit of 10 characters - this needs to be increased to at least the same length as your Locale string. The longest string for FreeBSD is 16 characters, so that is what I've used.
The backend_language field in the same table also has a default limit of 10 characters and should be increased as well.
Hope this helps.
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