summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-01-31 16:37:00 +0400
committerAndrew Dolgov <[email protected]>2012-01-31 16:37:00 +0400
commit6d490c44440b448513f7df2fcfed747a3d635869 (patch)
treed31acb002c0f5d6bf30cd11e58ad63320b12a170
parent8437c066e1785511d7baaf3340c950d8ab66229c (diff)
use local TZ in digest header
-rw-r--r--include/functions.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/functions.php b/include/functions.php
index aaca70dae..f188fc10a 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -2715,6 +2715,11 @@
$do_catchup = get_pref($link, 'DIGEST_CATCHUP', $line['id'], false);
+ global $tz_offset;
+
+ // reset tz_offset global to prevent tz cache clash between users
+ $tz_offset = -1;
+
$tuple = prepare_headlines_digest($link, $line["id"], 1, $limit);
$digest = $tuple[0];
$headlines_count = $tuple[1];
@@ -2782,11 +2787,14 @@
$tpl->readTemplateFromFile("templates/digest_template_html.txt");
$tpl_t->readTemplateFromFile("templates/digest_template.txt");
- $tpl->setVariable('CUR_DATE', date('Y/m/d'));
- $tpl->setVariable('CUR_TIME', date('G:i'));
+ $user_tz_string = get_pref($link, 'USER_TIMEZONE', $user_id);
+ $local_ts = convert_timestamp(time(), 'UTC', $user_tz_string);
+
+ $tpl->setVariable('CUR_DATE', date('Y/m/d', $local_ts));
+ $tpl->setVariable('CUR_TIME', date('G:i', $local_ts));
- $tpl_t->setVariable('CUR_DATE', date('Y/m/d'));
- $tpl_t->setVariable('CUR_TIME', date('G:i'));
+ $tpl_t->setVariable('CUR_DATE', date('Y/m/d', $local_ts));
+ $tpl_t->setVariable('CUR_TIME', date('G:i', $local_ts));
$affected_ids = array();