Commit graph

5256 commits

Author SHA1 Message Date
Oleg Pudeyev
bb461c8daa [feature/new-tz-handling] Sort timezones in selector by offset.
Since the list of timezones is very long, and users are likely
to know their current offset but not necessarily which city
that is nearby is in the timezone database, sort the list of
timezones by offset.

UTC is specially handled to show up before other GMT+0 timezones.

PHPBB3-9558
2012-03-14 22:57:31 -04:00
Chris Smith
f17664a00c [feature/new-tz-handling] Correct a bug preventing multiple formats working.
PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
190b019fa2 [feature/new-tz-handling] Remove case mangling, the identifiers are correct.
PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
0f320a6c48 [feature/new-tz-handling] Update tz_select() to use the PHP timezone database.
tz_select() now uses the PHP timezone database to generate the timezone
selection box, it tries to use a translated language string otherwise falls
back to a label produced from the timezone identifier. I've done this so
new timezones are available immediately without a new language pack.

PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
1665434853 [feature/new-tz-handling] Remove code using legacy timezone properties.
Code accessing the legacy user::$timezone and user::$dst properties
has been removed and replaced with code utilising user::create_datetime().

Changed by Oleg:

in viewtopic, memberlist and index use getTimestamp() + getOffset().

We show members that have birthdays on the specified date.

getTimestamp() returns the current date in UTC. We add getOffset() to
obtain the current local time in the viewing user's timezone.
Then we find members having birthday on this date.

Changed by Oleg again:

Take leap year status out of the datetime object we have, this seems
like it should work as one would expect.

PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
6e1278655f [feature/new-tz-handling] Removed line that was missed in cc312d8.
PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
e9fe9ea518 [feature/new-tz-handling] Fix bug from 3.0 formatting future dates.
Future dates can get formatted as 'less than a minute ago' if they
occur in the future on the same minute as the current minute.

PHPBB3-9558 PHPBB3-9712
2012-03-14 22:57:30 -04:00
Chris Smith
5dd7916c49 [feature/new-tz-handling] Check the is_short flag stored inside the format array.
Reuse the existing check store in the format array to determine if the date time
format supports relative formatting.

PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
8fe46175af [feature/new-tz-handling] Fix undefined variable.
PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
f085735ef8 [feature/new-tz-handling] Explained name of phpbb_datetime::getTimestamp()
phpbb_datetime::getTimestamp() exists purely to support PHP 5.2 which
does not implement the method.

PHPBB3-9558
2012-03-14 22:57:30 -04:00
Chris Smith
dba89a5341 [feature/new-tz-handling] Added phpbb_datetime::__toString().
New phpbb_datetime::__toString() magic method that formats the datetime
according to the users default settings.

PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
c521ef1591 [feature/new-tz-handling] Comment and optimise phpbb_datetime::format().
- Added comments explaining the complex time computations for rendering
  relative date times.

- Replaced some repeated method invokations with variables.

PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
522f65d079 [feature/new-tz-handling] Correct typo in member comment.
PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
2e7d9ec805 [feature/new-tz-handling] Fixed bug with signature of user::create_datetime().
First argument to user::create_datetime() should be optional.

PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
74be23a098 [feature/new-tz-handling] Added a user::create_datetime() method.
New method which handles instantiating new phpbb_datetime objects in
the context of the current user.

PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
6a783b843b [feature/new-tz-handling] Replace user::$timezone with user::$tz.
user::$tz will store the new DateTimeZone object representing the users
timezone instead of the existing user::$timezone and user::$dst combination.

PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
9e1812a0ca [feature/new-tz-handling] Remove old user::$dst property
PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
b2a812e36b [feature/new-tz-handling] Correct capitalisation of phpbb_datetime.
PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
3559d20624 [feature/new-tz-handling] Update user methods to use new date processing class.
user::setup() now stores a DateTimeZone object in user::$timezone representing
the users timezone. For backwards compatibility a numeric value in
user/board_timezone will be converted into one of the legacy Etc/GMT±X
timezones. This will be used until the user updates his/her timezone in the
UCP.

user::format_date() is now basically a legacy wrapper that transforms a UTC
UNIX timestamp into a formatted localised date using phpbb_datetime::format().

PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
a5c3ff3769 [feature/new-tz-handling] Renamed old variables and removed extra conditional.
PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
e8b60fc3d8 [feature/new-tz-handling] Use phpbb_datetime rather than phpbb_DateTime.
PHPBB3-9558
2012-03-14 22:57:29 -04:00
Chris Smith
6f7d095e3f [feature/new-tz-handling] Wrapper around DateTime for new date time handling.
Wrapped PHP's DateTime with some extensions for supporting phpBB's relative
date formats and provided the DateTime::getTimestamp() method to PHP < 5.3.

PHPBB3-9558
2012-03-14 22:57:28 -04:00
Andreas Fischer
6215740112 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10497] Fix SQL error when guest visits forum with unread topic
2011-11-27 16:13:18 +01:00
Andreas Fischer
ede3963951 Merge branch 'prep-release-3.0.10' into develop-olympus
* prep-release-3.0.10:
  [ticket/10497] Fix SQL error when guest visits forum with unread topic
2011-11-27 16:13:11 +01:00
Andreas Fischer
b89320ad39 Merge remote-tracking branch 'rxu/ticket/10497' into prep-release-3.0.10
* rxu/ticket/10497:
  [ticket/10497] Fix SQL error when guest visits forum with unread topic
2011-11-27 16:12:39 +01:00
rxu
77e00d14a1 [ticket/10497] Fix SQL error when guest visits forum with unread topic
Regression from the ticket PHPBB3-9008 fix.

When topic marking was enabled for guests, and a guest visited a forum with
a new topic which is marked unread, the built SQL missed an alias for a
TOPICS_TABLE which resulted in the following error:

Unknown column 't.topic_approved' in 'where clause' [1054]

The fix is to add an alias for the table.

PHPBB3-10497
PHPBB3-9008
2011-11-27 23:11:22 +08:00
Andreas Fischer
007457f182 [prep-release-3.0.10] Bumping version number for 3.0.10-RC2. 2011-11-26 22:17:43 +01:00
Andreas Fischer
79443eb1d4 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10280] Change the display of user activation settings in the ACP.
2011-11-25 18:15:00 +01:00
RMcGirr83
3ce5b1d386 [ticket/10280] Change the display of user activation settings in the ACP.
Use a select box to be consistent with other settings.

PHPBB3-10280
2011-11-25 01:27:44 -05:00
Oleg Pudeyev
90a7f55831 Merge remote-tracking branch 'nickvergessen/ticket/10484' into develop
* nickvergessen/ticket/10484:
  [ticket/10484] Use variables for sql_build_query() calls

Conflicts:
	phpBB/includes/mcp/mcp_front.php
2011-11-24 21:51:10 -05:00
Oleg Pudeyev
817ef638d1 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10461] Add a comment explaining the logic here.
  [ticket/10461] Correct $log_count check in view_log() so we show logs again.
2011-11-23 20:39:29 -05:00
Oleg Pudeyev
d13ce7f560 Merge branch 'prep-release-3.0.10' into develop-olympus
* prep-release-3.0.10:
  [ticket/10461] Add a comment explaining the logic here.
  [ticket/10461] Correct $log_count check in view_log() so we show logs again.
2011-11-23 20:39:11 -05:00
Oleg Pudeyev
a72ea2bc98 [ticket/10461] Add a comment explaining the logic here.
PHPBB3-10461
2011-11-23 18:15:45 -05:00
Andreas Fischer
6f40960071 [ticket/10461] Correct $log_count check in view_log() so we show logs again.
We pass $log_count as false now when we do not need to know how many log
entries there are. However when $log_count is false, $log_count == 0 will be
true as well and thus we will return early with 0.

PHPBB3-9874
PHPBB3-10461
2011-11-23 23:03:41 +01:00
Joas Schilling
4c77903129 [ticket/10484] Use variables for sql_build_query() calls
It's easier for mods/extensions to extend the arrays.

PHPBB3-10484
2011-11-21 16:22:07 +01:00
Oleg Pudeyev
4378c0f85b Merge remote-tracking branch 'igorw/ticket/10323' into develop
* igorw/ticket/10323:
  [ticket/10323] slight potential performance improvement
  [ticket/10323] make finder work with PHP 5.2
2011-11-20 22:37:24 -05:00
Andreas Fischer
a9d7b1f9a1 [develop-olympus] Increment version number to 3.0.11-dev in develop-olympus. 2011-11-21 00:57:53 +01:00
Andreas Fischer
3e43b53a63 [develop-olympus] Bump version numbers for 3.0.10-RC1 release. 2011-11-20 21:50:29 +01:00
Igor Wiedler
d766ee3fe6 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10446] Pass $config and $user via parameter to anti_abuse_headers().
  [ticket/10446] Remove leftover $headers parameter from anti_abuse_headers().
  [ticket/10446] RFC2047 encode user/server names in X-AntiAbuse headers.
  [ticket/10446] DRY X-AntiAbuse header addition.

Conflicts:
	phpBB/includes/ucp/ucp_register.php
2011-11-20 18:45:56 +01:00
Andreas Fischer
37c7668193 [ticket/10446] Pass $config and $user via parameter to anti_abuse_headers().
PHPBB3-10446
2011-11-20 16:35:31 +01:00
Andreas Fischer
a7077c9149 [ticket/10446] Remove leftover $headers parameter from anti_abuse_headers().
PHPBB3-10446
2011-11-20 14:02:22 +01:00
Oleg Pudeyev
c68973a9e0 [ticket/10446] RFC2047 encode user/server names in X-AntiAbuse headers.
PHPBB3-10446
2011-11-20 04:17:42 -05:00
Oleg Pudeyev
64d62038cd [ticket/10446] DRY X-AntiAbuse header addition.
PHPBB3-10446
2011-11-20 04:15:44 -05:00
Oleg Pudeyev
08032068c0 Merge remote-tracking branch 'nickvergessen/ticket/10344' into develop
* nickvergessen/ticket/10344:
  [ticket/10344] Add attachment icons to list of reported and queued posts/topics
2011-11-20 00:46:45 -05:00
Oleg Pudeyev
936fd38ee6 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10402] Fixed a formatting issue with report details.
2011-11-20 00:16:45 -05:00
Oleg Pudeyev
6155707071 Merge remote-tracking branch 'callumacrae/ticket/10402' into develop-olympus
* callumacrae/ticket/10402:
  [ticket/10402] Fixed a formatting issue with report details.
2011-11-20 00:15:48 -05:00
Oleg Pudeyev
f33dcacabe Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10239] Correct undefined variable error.
  [ticket/10239] Add confirm box to backup restore.
2011-11-19 21:54:20 -05:00
Oleg Pudeyev
fb43029935 Merge remote-tracking branch 'cs278/ticket/10239' into develop-olympus
* cs278/ticket/10239:
  [ticket/10239] Correct undefined variable error.
  [ticket/10239] Add confirm box to backup restore.
2011-11-19 21:52:43 -05:00
Igor Wiedler
813b5344e6 [ticket/10323] slight potential performance improvement
PHPBB3-10323
2011-11-20 02:08:37 +01:00
Igor Wiedler
658db65cb4 [ticket/10323] make finder work with PHP 5.2
PHPBB3-10323
2011-11-19 22:04:43 +01:00