Board / phpbb plugin .. change time?

Creating and modifying plugins.
Post Reply
42blue
Posts: 2
Joined: Fri May 01, 2009 10:53 am

Board / phpbb plugin .. change time?

Post by 42blue »

Hi,

i run my s9y on a US webserver with the board / phpbb comments plugin .. so if someone makes a new post it shows the Los Angeles time as posting time .. which is 9 hours after CET .. is there any way to change this?

the plugin uses the php "date" function and syncs with the servertime .. i assume ..

thanks :wink:

Matt
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Re: Board / phpbb plugin .. change time?

Post by Mangek »

Log in and go to configuration. Under Appearance and Options you'll find "Server time Offset".

Edit: Think I misread the question there...

I took a look at the file serendipity_event_forum.php and discovered this block of code starting on line 161:

Code: Select all

case 'timeformat':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_FORUM_TIMEFORMAT);
$propbag->add('description', sprintf(PLUGIN_FORUM_TIMEFORMAT_BLAHBLAH, 'h:ia'));
$propbag->add('default',     'h:ia');
break;
which I can only assume is where the changes will be. Either that or on line 1275:

Code: Select all

'POST_DATE'			=>	date($this->get_config('dateformat')." ".$this->get_config('timeformat'), $post[0]['postdate']),
I can't really be of much help, I don't know what to do with it (or if I'm even sniffing around at the right place). Sorry for the misunderstanding. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Board / phpbb plugin .. change time?

Post by garvinhicking »

Hi!

Maybe changing it with this could do:

Code: Select all

'POST_DATE'			=>	date($this->get_config('dateformat')." ".$this->get_config('timeformat'), serendipity_serverOffsetHour($post[0]['postdate'])),
Using this serverOffsetHour function should basically apply the offset calculations. Sadly I'm not a real timezone expert, so I don't know if this will be your intended output ;)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
42blue
Posts: 2
Joined: Fri May 01, 2009 10:53 am

Re: Board / phpbb plugin .. change time?

Post by 42blue »

Hi Garvin and Mangek,

thanks for your ideas .. but your proposals had no effect ...

Is there a possibility to influence the date() function .. at the admin screen for the board plugin i can change the time format .. or a least to hardcode it in the php file

Translation not 1:1:
Timeformat
The time format for postings. It is used the PHP-Function date() (Default: "h:ia")
a forgotten .. S9y is a 1.3.1

Thank you!

Matt
Post Reply