Newsletter: Add custom link to media/post
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
14
inc/spot.php
14
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);
|
||||
|
||||
Reference in New Issue
Block a user