diff --git a/inc/email.php b/inc/email.php index 14eb3c2..95f52a4 100644 --- a/inc/email.php +++ b/inc/email.php @@ -63,6 +63,7 @@ class Email extends PhpObject { //Message $this->oTemplate->setLanguage($asDest['language'], Spot::DEFAULT_LANG); + $this->oTemplate->setTimezone($asDest['timezone']); //Unsubscribe Link $sUnsubLink = $this->sServName.'?a=unsubscribe_email&id='.$asDest['id_user']; @@ -71,6 +72,7 @@ class Email extends PhpObject { $oPHPMailer->addCustomHeader('List-Unsubscribe-Post','List-Unsubscribe=One-Click'); //Email Content + $this->oTemplate->setTag('timezone', 'lang:city_time', self::getTimeZoneCity($asDest['timezone'])); $sHtmlMessage = $this->oTemplate->getMask(); $sPlainMessage = strip_tags(str_replace('
', "\n", $sHtmlMessage)); @@ -82,7 +84,7 @@ class Email extends PhpObject { $oPHPMailer->Subject = $this->oTemplate->getTranslator()->getTranslation($this->sTemplateName.'_subject'); $oPHPMailer->Body = $sHtmlMessage; $oPHPMailer->AltBody = $sPlainMessage; - + try { $oPHPMailer->send(); } @@ -91,4 +93,8 @@ class Email extends PhpObject { } } } + + private static function getTimeZoneCity($sTimeZone) { + return (strpos($sTimeZone, '/')!==false)?str_replace('_', ' ', explode('/', $sTimeZone)[1]):''; + } } \ No newline at end of file diff --git a/inc/spot.php b/inc/spot.php index 68b1f7d..5ac7038 100755 --- a/inc/spot.php +++ b/inc/spot.php @@ -186,7 +186,7 @@ class Spot extends Main $asLastMessage = end($asMessages); $asLastMessage['token'] = Settings::GEO_SERVER_TOKEN; $oEmail->oTemplate->setTags($asLastMessage); - $oEmail->oTemplate->setTag('date_time', 'lang:date_time', array(date('d/m/Y', $asLastMessage['unix_time']), date('H:i', $asLastMessage['unix_time']))); + $oEmail->oTemplate->setTag('date_time', 'time:'.$asLastMessage['unix_time'], 'd/m/Y, H:i'); //Add latest news feed $asNews = $this->getNewsFeed(0, true); diff --git a/masks/email_update.html b/masks/email_update.html index 763320a..120189d 100644 --- a/masks/email_update.html +++ b/masks/email_update.html @@ -16,7 +16,7 @@
position
[#]lat_dms[#] [#]lon_dms[#] -
[#]date_time[#] +
[#]date_time[#] ([#]timezone[#])
diff --git a/readme.md b/readme.md index 005f245..c3074be 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,5 @@ * Reset zoom on image closing (lightbox) * Fix video fullscreen button on ios * Fix lightbox portrait mode: push text under -* Subscribe to message feed * Add mail frequency slider -* Add Timezone to user table * Replace Project Time Zone with browser Time Zone when uploading media? \ No newline at end of file diff --git a/script/spot.js b/script/spot.js index 5e769b2..5313b94 100755 --- a/script/spot.js +++ b/script/spot.js @@ -252,7 +252,7 @@ function setElem(aoAnchor, asPath, oValue) } function getTimeZoneDesc(sTimeZoneName) { - var sCity = sTimeZoneName.split('/')[1] || ''; + var sCity = sTimeZoneName.split('/')[1].replace('_', ' ') || ''; return oSpot.lang('city_time', sCity); }