diff --git a/inc/email.php b/inc/email.php index 6d66fb0..fc531dd 100644 --- a/inc/email.php +++ b/inc/email.php @@ -30,7 +30,6 @@ class Email extends PhpObject { $this->sTemplateName = $sTemplateName; $this->oTemplate = new Mask($this->sTemplateName); $this->oTemplate->setTag('local_server', $this->sServName); - $this->oTemplate->setTag('live_server', Settings::LIVE_SERVER); $this->oTemplate->setTag('geo_server', Settings::GEO_SERVER); } diff --git a/inc/spot.php b/inc/spot.php index 1eda2e6..b2ab2db 100755 --- a/inc/spot.php +++ b/inc/spot.php @@ -194,7 +194,12 @@ class Spot extends Main foreach($asNews as $asPost) { if($asPost['type'] != 'message') { $oEmail->oTemplate->newInstance('news'); - $oEmail->oTemplate->setInstanceTag('news', 'local_server', $this->asContext['serv_name']); + $oEmail->oTemplate->setInstanceTags('news', array( + 'local_server' => $this->asContext['serv_name'], + 'project' => $this->oProject->getProjectCodeName(), + 'type' => $asPost['type'], + 'id' => $asPost['id_'.$asPost['type']]) + ); $oEmail->oTemplate->addInstance($asPost['type'], $asPost); $oEmail->oTemplate->setInstanceTag($asPost['type'], 'local_server', $this->asContext['serv_name']); $iPostCount++; @@ -391,9 +396,11 @@ class Spot extends Main $sPriority = $asFeedTypeInfo['priority']; if($bHistoMode) $sPriority = count($asFeedTypes) - 1 - $asFeedTypeInfo['priority']; - $iId = ($asFeed['unix_time'] * -1).'.'.$sPriority.$asFeed[Db::getId($asFeedTypeInfo['table'])]; + $iTableId = $asFeed[Db::getId($asFeedTypeInfo['table'])]; + $iId = ($asFeed['unix_time'] * -1).'.'.$sPriority.$iTableId; $asFeeds[$iId] = $asFeed; $asFeeds[$iId]['type'] = $sFeedType; + $asFeeds[$iId]['id'] = $iTableId; } } @@ -415,11 +422,12 @@ class Spot extends Main { $asData = array( Db::getId(Project::PROJ_TABLE) => $this->oProject->getProjectId(), - Db::getId(User::USER_TABLE) => $this->oUser->getUserId(), 'name' => mb_strtolower(trim($sName)), 'content' => trim($sPost), 'site_time' => date(Db::TIMESTAMP_FORMAT) //site time (Settings::TIMEZONE) ); + if($this->oUser->getUserId() > 0) $asData[Db::getId(User::USER_TABLE)] = $this->oUser->getUserId(); + $iPostId = $this->oDb->insertRow(self::POST_TABLE, $asData); $this->oUser->updateNickname($sName); diff --git a/masks/email_update.html b/masks/email_update.html index 120189d..9e5b98f 100644 --- a/masks/email_update.html +++ b/masks/email_update.html @@ -14,7 +14,7 @@