[FIX] TOPIC REVIEW TIME on other timezones

Support for IntegraMOD 140

Moderator: Integra Moderator

[FIX] TOPIC REVIEW TIME on other timezones

PostAuthor: evolver » Thu May 18, 2006 9:07 am

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>
Last edited by evolver on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 12:46 pm
Cash on hand: 0.00
Location: Oostende

PostAuthor: Adrian Rea » Thu May 18, 2006 9:12 am

great work evolver [flash=,:1ot1i3ny]http://integramod.com/forum/images/icon/icon14.gif[/flash:1ot1i3ny]


A
Last edited by Adrian Rea on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 11:59 pm
Cash on hand: 0.00

PostAuthor: Eon » Thu May 18, 2006 10:16 am

Cool.. More stuff for 141!!
Last edited by Eon on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
Eon
Sr Integra Member
Sr Integra Member
 
Posts: 627
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 9:15 am
Cash on hand: 0.00

PostAuthor: tekguru » Fri May 19, 2006 6:46 am

Well done that man yet again, now in there!
Last edited by tekguru on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[size=99px]http][/size]
[url=http][img=left]http://www.4winmobile.com/news/MVP_Horizontal_FullColor.png[/img][/url]
User avatar
tekguru
Sr Integra Member
Sr Integra Member
 
Posts: 329
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 10:29 pm
Cash on hand: 0.00

PostAuthor: Michaelo » Mon May 29, 2006 5:25 pm

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
Last edited by Michaelo on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Kiss Portal Engine phpbbireland (status: Released)
User avatar
Michaelo
Administrator
Administrator
 
Posts: 1646
Likes: 0 post
Liked in: 0 post
Joined: Sat Mar 11, 2006 5:14 pm
Cash on hand: 0.00
Location: Dublin, Ireland

Re: [FIX] TOPIC REVIEW TIME on other timezones

PostAuthor: obiku » Thu Jul 20, 2006 9:48 am

"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;
Last edited by obiku on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
http://www.familie-smit.nl
http://portfolio.familie-smit.nl

Do not tsunami my inbox... instead use the forums...
Hard work may not kill me, but why take a chance?

[hr]
User avatar
obiku
Dev Team
Dev Team
 
Posts: 218
Likes: 0 post
Liked in: 0 post
Joined: Tue May 02, 2006 10:22 am
Cash on hand: 0.00
Location: level 8

Re: [FIX] TOPIC REVIEW TIME on other timezones

PostAuthor: evolver » Thu Jul 20, 2006 1:58 pm

"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>
Last edited by evolver on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
ImageAlways remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.
User avatar
evolver
Sr Integra Member
Sr Integra Member
 
Posts: 420
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 12:46 pm
Cash on hand: 0.00
Location: Oostende

Re: [FIX] TOPIC REVIEW TIME on other timezones

PostAuthor: obiku » Thu Jul 20, 2006 2:38 pm

As we al do.... evolving :wink:
Last edited by obiku on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
http://www.familie-smit.nl
http://portfolio.familie-smit.nl

Do not tsunami my inbox... instead use the forums...
Hard work may not kill me, but why take a chance?

[hr]
User avatar
obiku
Dev Team
Dev Team
 
Posts: 218
Likes: 0 post
Liked in: 0 post
Joined: Tue May 02, 2006 10:22 am
Cash on hand: 0.00
Location: level 8


Return to IntegraMOD 140

Who is online

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot]

cron