Notes v3.0.4

Support für Extensions für phpBB 3.1.x von Entwickler OXPUS
puchahawa
Beiträge: 16
Registriert: Fr 10. Jun 2016, 00:08

Re: Notes v3.0.4

Beitrag von puchahawa »

Hi Oxpus, I've been pondering why the reminder works fine for you but messes up for me and was wondering if maybe it has to do with the language file. I would presume that in your testing you use German and my testing has been done using English. Don't know if it would have any effect or not. :?: :?:

I did some more digging and one of the things I noticed is if I convert the time stamp used in the note time column between GMT and my timezone it makes sense. Gmt shows as it should and -7 reflects the correct time for the post.

When I do the same thing for the note_mem column it's not correct. Gmt shows -7 GMT and my time shows 7 hours before that.

An example to hopefully make it easier to understand what I'm rambling about. :) I made a post on the 19th of Jun at 3:03 pm (GMT-7) time stamp is 1466373815 and then set the reminder for 19 Jun 16 at 3:40 pm (GMT -7) time stamp is 1466350800. You can see that the time stamp for the reminder is smaller (earlier) than the post time stamp. don't know how that could work. If i convert from date/time to timestamp 22:40 GMT on the 19th should be 1466376000. That may explain why the reminder kept showing up as soon as the post was made.

When I convert the post time timestamp it comes out to Sunday, June 19th 2016, 15:03:35 (GMT -7) and Sunday, June 19th 2016, 22:03:35 (GMT) Which is correct

But when I convert the reminder timestamp it comes out to Sunday, June 19th 2016, 08:40:00 (GMT -7) and Sunday, June 19th 2016, 15:40:00 (GMT) This one doesn't work. The GMT time is showing gmt -7 and should be 22:40:00

Hope my rambling makes some sense to you.
Benutzeravatar
oxpus
Chief handy-man
Beiträge: 2660
Registriert: Do 13. Dez 2007, 23:06
Wohnort: Irgendwo im I-Net
Kontaktdaten:

Re: Notes v3.0.4

Beitrag von oxpus »

I still know what you mean, since several posts before.

I must check, why the used function mktime will not save the time in your case within the right value.
This may take some time...
Karsten Ude
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
oxpus
Chief handy-man
Beiträge: 2660
Registriert: Do 13. Dez 2007, 23:06
Wohnort: Irgendwo im I-Net
Kontaktdaten:

Re: Notes v3.0.4

Beitrag von oxpus »

Please upload the attached file to your forum, run this script and post the results.

No fear, the script will only print out the current set timezone in php, timestamps on different ways and try to change the default timezone.
Dateianhänge
test.zip
(253 Bytes) 438-mal heruntergeladen
Karsten Ude
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
puchahawa
Beiträge: 16
Registriert: Fr 10. Jun 2016, 00:08

Re: Notes v3.0.4

Beitrag von puchahawa »

Here is the result.

UTC
1466636765
1466636765
UTC
1466636765
Benutzeravatar
oxpus
Chief handy-man
Beiträge: 2660
Registriert: Do 13. Dez 2007, 23:06
Wohnort: Irgendwo im I-Net
Kontaktdaten:

Re: Notes v3.0.4

Beitrag von oxpus »

And now I'm very surprised.

The script throws now error, so the function date_default_timezone_set() should work.
So why the function mktime will use a wrong timestamp, even this function should use "UTC" based on the settings the test-script have simulated?

Sorry, I've no idea to fix this.
Again: I can switch in my boards to each timezone which is known by the board, but I never gets timezone conflicts within the extension...
Karsten Ude
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
puchahawa
Beiträge: 16
Registriert: Fr 10. Jun 2016, 00:08

Re: Notes v3.0.4

Beitrag von puchahawa »

Must be some weird issue with my local board wampserver server or perhaps a conflict with some other extension. Thanks for looking into it.
moose5
Beiträge: 2
Registriert: Fr 2. Sep 2016, 15:21

Re: Notes v3.0.4

Beitrag von moose5 »

Hello,
this is a great extension! Thanks oxpus for writing it. I wanted to use it, but the timezone issue prevented me from doing so, so I dug a bit...

The problem was that the forum is on eastern timezone (UTC-4) and the version 3.0.5 forces everything to UTC.
So generating a reminder with only a few minutes in the future, the reminder would show the note right away because the post time and reminder time are several hours ahead.
Solution:
file main.php in notes/controller
at line ~94 could be replaced with:
//date_default_timezone_set('UTC');
//$this->config['board_timezone'] = 'UTC';
//$this->user->data['user_timezone'] = 'UTC';
date_default_timezone_set($config['board_timezone']);
$this->config['board_timezone'] = $config['board_timezone'];
$this->user->data['user_timezone'] = $config['board_timezone'];

This allowed for the posting time to be consistent.

I have also copied a suggestion for a different English translation. Please feel free to use if desired. The text below is the entire text in /notes/language/en/common.php

Thanks again Oxpus for the great work you have done!

<?php

/**
*
* @package phpBB Extension - Personal Notes
* @copyright (c) 2014 OXPUS - www.oxpus.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

/*
* [ english ] language file
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
exit;
}

if (empty($lang) || !is_array($lang))
{
$lang = array();
}

$lang = array_merge($lang, array(
'ACP_NOTES' => 'Config notes',
'ACP_NOTES_SETTINGS' => 'Max. number of notes per user',
'UCP_NOTES' => 'Notes',
'UCP_NOTES_CONFIG' => 'Settings',

'NOTES' => 'Notes',
'POPUP_NOTES' => 'Display Personal Notes as Popup',
'FILTER_NOTES' => '<strong>Filter mode</strong><br />Press the search button again or change the sort method to display all notes.',
'NOTES_MEM' => 'Reminder',
'NOTES_MEMTEXT' => '<strong>You have entered notes with a reminder.</strong><br />%sClick here to list these notes.%s<br />(Clicking will remove the reminder)',
'NO_NOTES' => 'You currently have no notes',

'NOTES_CONFIG_SUCCESSFULL' => 'The settings for the notes are saved successfully.<br /><br />%sClick here to return to the configuration%s',
'NOTES_LOG_CONFIG' => 'Change number of notes per user',
));
Benutzeravatar
oxpus
Chief handy-man
Beiträge: 2660
Registriert: Do 13. Dez 2007, 23:06
Wohnort: Irgendwo im I-Net
Kontaktdaten:

Re: Notes v3.0.4

Beitrag von oxpus »

Hello,

first many thanks to fix the english language file :oops:

And for the timezone error:
Again: I can't reproduce this.
I've update the extension now again and drop the resettings for the timezone.
May this work better than with...
Karsten Ude
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
moose5
Beiträge: 2
Registriert: Fr 2. Sep 2016, 15:21

Re: Notes v3.0.4

Beitrag von moose5 »

YAY!
that was my first code suggestion that ended up in a new version! Thank you! :D


Rest auf Deutsch, den koennen Sie gerne loeschen vor dem Freigeben.
Wenn Sie fuer zukuenftige Versuche was austesten wollen, stelle ich gerne mein Testforum zur Verfuegung (mit vollem ACP und FTP Zugang). Vielleicht hilfts? Wir kennen es alle, jemand findet etwas das wir nicht duplizieren koennen. Dann koennen wir nicht was verbessern und testen, dass es echt besser wird. Sehr frustrierend!
Eine tolle Erweiterung waere es, wenn Notes eine email oder eine PM schicken koennte. Triggern koennte aehnlich gehen wie bei der extension "Prune Logs", aber vielleicht gibt es ja was besseres dafuer.
Vielen Dank nochmal fuer die tolle Erweiterung! Auch die Meeting-Extension ist fuer mich sehr interessant!!
puchahawa
Beiträge: 16
Registriert: Fr 10. Jun 2016, 00:08

Re: Notes v3.0.4

Beitrag von puchahawa »

Hello Moose5 and Oxpus. I made the edit that Moose5 shared on v3.0.5 and I'm happy to report that it worked great. Nicely done. 8-) BTW I had a friend that writes extensions look at it and he came up with the same solution. :D

I tested it on both my test boards running 3.1.9. The first board tested worked great. The second board tested had the same issue with the immediate reminder. Played with it awhile and figured out that the second boards guest time was set at GMT. For some reason it didn't work correctly with that setting. Set the guest time to gmt -7 (timezone where our online board is hosted) and it worked great. Same setting as first tested board.
Antworten