Page 1 of 1

[FIX] TOPIC REVIEW TIME on other timezones

PostPosted: Thu May 18, 2006 10:07 am
Author: evolver
The topic review, displayed under the posting (edit) page...
[flash=,:2y45xfbq]http://www.stelplaats.be/screenshots/kismod/messageinput.jpg[/flash:2y45xfbq]
Message-times are displayed at servertime, not usertime.

[size=99px]

[size=99px]
Code: Select all
function topic_review($topic_id, $is_inline_review){

[b]AFTER ADD]
Code: Select all
   global $board_config, $db, $userdata;   if ( isset($userdata['user_timezone']) )   {     $usersummertime = 0;     $boardsummertime = 0;     if($userdata['user_summer_time']) $usersummertime = 1;     if($board_config['summer_time']) $boardsummertime = 1;       $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));   }   else   {   $zonedifference = 0;   }   $zonediffseconds = ($zonedifference * 3600);


[b]FIND]
Code: Select all
            $poster_id = $row['user_id'];             $poster = $row['username'];                           $post_date = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);

[b]REPLACE]
Code: Select all
            $poster_id = $row['user_id'];             $poster = $row['username'];                         $posttime= $row['post_time']-$zonediffseconds;                           $post_date = create_date($board_config['default_dateformat'], $posttime, $board_config['board_timezone']);  


:D <img>

PostPosted: Thu May 18, 2006 10:12 am
Author: Adrian Rea
great work evolver [flash=,:1ot1i3ny]http://integramod.com/forum/images/icon/icon14.gif[/flash:1ot1i3ny]


A

PostPosted: Thu May 18, 2006 11:16 am
Author: Eon
Cool.. More stuff for 141!!

PostPosted: Fri May 19, 2006 7:46 am
Author: tekguru
Well done that man yet again, now in there!

PostPosted: Mon May 29, 2006 6:25 pm
Author: Michaelo
Added to beta (~120). Note you do not need to add global $board_config, $db, $userdata; in second block, just place the code after all globals...

Mike

Re: [FIX] TOPIC REVIEW TIME on other timezones

PostPosted: Thu Jul 20, 2006 10:48 am
Author: obiku
"evolver";p="6424" wrote:
[size=99px]
Code: Select all
function topic_review($topic_id, $is_inline_review){

[b]AFTER ADD]
Code: Select all
   global $board_config, $db, $userdata;   if ( isset($userdata['user_timezone']) )   {     $usersummertime = 0;     $boardsummertime = 0;     if($userdata['user_summer_time']) $usersummertime = 1;     if($board_config['summer_time']) $boardsummertime = 1;       $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));   }   else   {   $zonedifference = 0;   }   $zonediffseconds = ($zonedifference * 3600);

If you put this code in the place you said, it looks like this
Code: Select all
function topic_review($topic_id, $is_inline_review){   global $board_config, $db, $userdata;   if ( isset($userdata['user_timezone']) )   {     $usersummertime = 0;     $boardsummertime = 0;     if($userdata['user_summer_time']) $usersummertime = 1;     if($board_config['summer_time']) $boardsummertime = 1;       $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));   }   else   {   $zonedifference = 0;   }   $zonediffseconds = ($zonedifference * 3600);     global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;     global $userdata, $user_ip;     global $orig_word, $replacement_word;     global $starttime;//-- mod ]As you can see, the third line:
global $board_config, $db, $userdata;
is already in this function. So my question is, can you also put this part of the code
[code]  {     $usersummertime = 0;     $boardsummertime = 0;     if($userdata['user_summer_time']) $usersummertime = 1;     if($board_config['summer_time']) $boardsummertime = 1;       $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));   }   else   {   $zonedifference = 0;   }   $zonediffseconds = ($zonedifference * 3600);  

behind the lines
[code]//-- mod ]without putting in the line
global $board_config, $db, $userdata;

Re: [FIX] TOPIC REVIEW TIME on other timezones

PostPosted: Thu Jul 20, 2006 2:58 pm
Author: evolver
"obiku";p="12188" wrote:
"evolver";p="6424" wrote:
[size=99px]
Code: Select all
function topic_review($topic_id, $is_inline_review){

[b]AFTER ADD]
Code: Select all
   global $board_config, $db, $userdata;   if ( isset($userdata['user_timezone']) )   {     $usersummertime = 0;     $boardsummertime = 0;     if($userdata['user_summer_time']) $usersummertime = 1;     if($board_config['summer_time']) $boardsummertime = 1;       $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));   }   else   {   $zonedifference = 0;   }   $zonediffseconds = ($zonedifference * 3600);

If you put this code in the place you said, it looks like this
Code: Select all
function topic_review($topic_id, $is_inline_review){   global $board_config, $db, $userdata;   if ( isset($userdata['user_timezone']) )   {     $usersummertime = 0;     $boardsummertime = 0;     if($userdata['user_summer_time']) $usersummertime = 1;     if($board_config['summer_time']) $boardsummertime = 1;       $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));   }   else   {   $zonedifference = 0;   }   $zonediffseconds = ($zonedifference * 3600);     global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;     global $userdata, $user_ip;     global $orig_word, $replacement_word;     global $starttime;//-- mod ]As you can see, the third line:
global $board_config, $db, $userdata;
is already in this function. So my question is, can you also put this part of the code
[code]  {     $usersummertime = 0;     $boardsummertime = 0;     if($userdata['user_summer_time']) $usersummertime = 1;     if($board_config['summer_time']) $boardsummertime = 1;       $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime));   }   else   {   $zonedifference = 0;   }   $zonediffseconds = ($zonedifference * 3600);  

behind the lines
[code]//-- mod ]without putting in the line
global $board_config, $db, $userdata;

You're right, obiku :mrgreen:
global :mrgreen:
I didn't even know what it was for... :wink:

But I'm learning, fast as a train...
I've learned a lot by now...and I'm still learning more...
I've done many experiments on testsites...
Anything I need to know, I look up on the internet.
Studying example PHP-snippets, comparing them with others, to build one completely the way I like...

Yes, that's what I'm doing right now...making a full PHP-script by my own...and it's expanding
I started with modifying a chmod-script only to add another chmod-method
But, by now, it can't even be compared with the original anymore...
I've added more functions, it will even need a menu to start with...

And now, when I look back at my first little attempts, it makes me smile :D
And I'm sure, I will also smile later, when I look back at the script I'm working on right now...
I'm just evolving...and I like it <img>

Re: [FIX] TOPIC REVIEW TIME on other timezones

PostPosted: Thu Jul 20, 2006 3:38 pm
Author: obiku
As we al do.... evolving :wink: