phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

[RC] Advanced time management


 
Search this topic... | Search MOD Development... | Search Box
Register or Login to Post    Index » MOD Development  Previous TopicPrint TopicNext Topic
Author Message
vlad77
Board Member



Joined: 31 May 2015

Posts: 122


flag
PostPosted: Thu Mar 21, 2019 1:38 pm 
Post subject: Advanced time management

Title: Advanced time management
Author: -=ET=-, vlad77
Description: mod controls the display of time on the forum for registered users and guests, synchronizes the time on the forum with the user's computer and other options, 6 ways.
Version: 3.0.4
Note: Errors of the original mode by - = ET = - were found and removed. Made a friendly interface. The mod is now compatible with other mods using window.onload. The quality of the definition of Java time has been improved, the time is transmitted to the server with each click. For guests, as well as for registered users, when you re-enter the forum, the correct time is shown instantly. In the admin user profile shows detailed information about the mod settings and the current time. Added setting the maximum time lag when synchronizing with the user's computer (before this lag was unlimited). Added the mod that was not completed by the author, the option to manually switch the checkbox to summer time. Added addon for Guest Sessions MOD. Removed session_start (), thereby eliminating the possible danger of server hangup. While the time is not transmitted from the user's computer, the time is shown from the time zone, you can turn it off in the admin panel, so that the time would not be shown at all, as in older versions of the mod.



adv_time_management.tar.gz
 Description:
Version: 3.0.4

Download
 Filename:  adv_time_management.tar.gz
 Filesize:  49.06 KB
 Downloaded:  578 Time(s)

Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 206



PostPosted: Thu Mar 21, 2019 8:35 pm 
Post subject: Re: Advanced time management

I can't download it right now.

Are you using AJAX for this? How many SQL queries?

_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
vlad77
Board Member



Joined: 31 May 2015

Posts: 122


flag
PostPosted: Fri Mar 22, 2019 7:35 am 
Post subject: Re: Advanced time management

Time is transmitted to the server through cookies. New sql queries not added.
Back to top
vlad77
Board Member



Joined: 31 May 2015

Posts: 122


flag
PostPosted: Mon Jul 22, 2019 2:36 pm 
Post subject: Re: Advanced time management

Version: 3.0.4
Disabling the option "Always show time" worked only on index.php (that is, on a forum without mods showing the time on their pages), fixed. Now you need to edit 1 file less. Added addons for "Calendar Lite" and "printer-friendly topic view option mod".

Instructions for updating are attached.
Back to top
s1eelra1
Board Member



Joined: 08 Apr 2015

Posts: 4



PostPosted: Wed Oct 14, 2020 2:35 am 
Post subject: Re: Advanced time management

@Vlad.....

I'm working through updating to 7.2/7.4 of php. I'm getting this error showing up when I have the error displaying turned on.

Notice: Undefined offset: 3

The lines of code is for the 3.0.4 version of Advanced Time Mod that I switched to.

It's in ./includes/sessions.php

Code:



// Start add - Advanced time management MOD
if ( $userdata['user_id'] == ANONYMOUS && isset($HTTP_COOKIE_VARS[$cookiename . '_upto']) )
{
   $userdata['user_pc_timeOffsets'] = $HTTP_COOKIE_VARS[$cookiename . '_upto'];
}

$pc_dateTime_update = FALSE;

if ( [b]$cookie_pc_timeOffsets[3][/b] < $current_time - $board_config['max_delay_for_time_pc'] )
{
   $cookie_pc_timeOffsets = array();
}

if ( isset($cookie_pc_timeOffsets['pc_tzo']) && isset($cookie_pc_timeOffsets['pc_t']) )
{
   $userdata['session_timezoneOffset'] = intval($cookie_pc_timeOffsets['pc_tzo']);
   $pc_dateTime['pc_timezoneOffset'] = $userdata['session_timezoneOffset'];

   $server_time = @gmdate(G)*3600 + @gmdate(i)*60 + @gmdate(s);



Any ideas? I'm not the strongest at php.....

TIA
Back to top
s1eelra1
Board Member



Joined: 08 Apr 2015

Posts: 4



PostPosted: Sat Oct 17, 2020 3:31 pm 
Post subject: Re: Advanced time management

I did find another google link, suggesting that if the array goes from 0,1,2..... then you would set this value to 2 (instead of 3, since it's the max declared value.

Code:


if ( [b]$cookie_pc_timeOffsets[2][/b] < $current_time - $board_config['max_delay_for_time_pc'] )



However, as part of this process I've found an interesting "feature"? In the common.php, I've enabled the warnings, etc to help find the php7.4 things to be "fixed" for future proofing. When I have this array option, essentially, I get into a login loop for the acp. At first I thought, it was something else. But if I disable the warning in common.php, I can login without issue.... otherwise I basically can't get into the acp. I can refresh, delete cookies, etc.... And sometimes, I can then get in. Other times, I essentially get logged out (cookie wise, so I have to even relogin). Since with the flag set, the same code works just fine. it's OK for now. However, on some change to the php version on the host, i'm sure this will come back.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Development  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0271 seconds using 17 queries. (SQL 0.0025 Parse 0.0024 Other 0.0223)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo