fix message displayed ID
This commit is contained in:
18
inc/spot.php
18
inc/spot.php
@@ -255,7 +255,6 @@ class Spot extends Main
|
|||||||
);
|
);
|
||||||
|
|
||||||
//Update on Blog Mode and not updated already today
|
//Update on Blog Mode and not updated already today
|
||||||
$asAllFeedMessages = array();
|
|
||||||
foreach($asFeeds as $asFeed) {
|
foreach($asFeeds as $asFeed) {
|
||||||
|
|
||||||
//Feed updated once a day in Blog Mode
|
//Feed updated once a day in Blog Mode
|
||||||
@@ -275,21 +274,20 @@ class Spot extends Main
|
|||||||
'orderBy' => array('site_time'=>'ASC'));
|
'orderBy' => array('site_time'=>'ASC'));
|
||||||
|
|
||||||
$asMessages = $this->oDb->selectRows($asInfo);
|
$asMessages = $this->oDb->selectRows($asInfo);
|
||||||
foreach($asMessages as $asMessage)
|
foreach($asMessages as $iIndex=>&$asMessage)
|
||||||
{
|
{
|
||||||
$asMessage['latitude'] = floatval($asMessage['latitude']);
|
$asMessage['latitude'] = floatval($asMessage['latitude']);
|
||||||
$asMessage['longitude'] = floatval($asMessage['longitude']);
|
$asMessage['longitude'] = floatval($asMessage['longitude']);
|
||||||
$asMessage['lat_dms'] = self::DecToDMS($asMessage['latitude'], 'lat');
|
$asMessage['lat_dms'] = self::DecToDMS($asMessage['latitude'], 'lat');
|
||||||
$asMessage['lon_dms'] = self::DecToDMS($asMessage['longitude'], 'lon');
|
$asMessage['lon_dms'] = self::DecToDMS($asMessage['longitude'], 'lon');
|
||||||
|
$asMessage['displayed_id'] = 'N°'.($iIndex + 1);
|
||||||
|
|
||||||
$this->addTimeStamp($asMessage, $asMessage['unix_time']);
|
$this->addTimeStamp($asMessage, $asMessage['unix_time']);
|
||||||
|
|
||||||
$asAllFeedMessages[] = $asMessage;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
usort($asAllFeedMessages, function($a, $b){return $a['unix_time'] > $b['unix_time'];});
|
usort($asMessages, function($a, $b){return $a['unix_time'] > $b['unix_time'];});
|
||||||
|
|
||||||
return $asAllFeedMessages;
|
return $asMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -303,10 +301,12 @@ class Spot extends Main
|
|||||||
{
|
{
|
||||||
$asPics = $this->oPicture->getPicsInfo();
|
$asPics = $this->oPicture->getPicsInfo();
|
||||||
$asValidPics = array();
|
$asValidPics = array();
|
||||||
foreach($asPics as &$asPic) {
|
foreach($asPics as $iIndex=>$asPic) {
|
||||||
$sTimeRef = $asPic[$sTimeRefField];
|
$sTimeRef = $asPic[$sTimeRefField];
|
||||||
if($sTimeRef >= $this->oProject->getActivePeriod('from') && $sTimeRef <= $this->oProject->getActivePeriod('to')) {
|
if($sTimeRef >= $this->oProject->getActivePeriod('from') && $sTimeRef <= $this->oProject->getActivePeriod('to')) {
|
||||||
$asPic['taken_on_formatted'] = date(self::FORMAT_TIME, strtotime($asPic['taken_on']));
|
$asPic['taken_on_formatted'] = date(self::FORMAT_TIME, strtotime($asPic['taken_on']));
|
||||||
|
$asPic['displayed_id'] = 'N°'.($iIndex + 1);
|
||||||
|
|
||||||
$this->addTimeStamp($asPic, strtotime($sTimeRef));
|
$this->addTimeStamp($asPic, strtotime($sTimeRef));
|
||||||
$asValidPics[] = $asPic;
|
$asValidPics[] = $asPic;
|
||||||
}
|
}
|
||||||
@@ -368,15 +368,13 @@ class Spot extends Main
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
foreach($asFeedTypes as $sFeedType=>$asFeedTypeInfo) {
|
foreach($asFeedTypes as $sFeedType=>$asFeedTypeInfo) {
|
||||||
foreach($asFeedTypeInfo['feed'] as $iIndex=>$asFeed) {
|
foreach($asFeedTypeInfo['feed'] as $asFeed) {
|
||||||
$sPriority = $asFeedTypeInfo['priority'];
|
$sPriority = $asFeedTypeInfo['priority'];
|
||||||
if($bHistoMode) $sPriority = count($asFeedTypes) - 1 - $asFeedTypeInfo['priority'];
|
if($bHistoMode) $sPriority = count($asFeedTypes) - 1 - $asFeedTypeInfo['priority'];
|
||||||
|
|
||||||
$iId = ($asFeed['unix_time'] * -1).'.'.$sPriority.$asFeed[Db::getId($asFeedTypeInfo['table'])];
|
$iId = ($asFeed['unix_time'] * -1).'.'.$sPriority.$asFeed[Db::getId($asFeedTypeInfo['table'])];
|
||||||
|
|
||||||
$asFeeds[$iId] = $asFeed;
|
$asFeeds[$iId] = $asFeed;
|
||||||
$asFeeds[$iId]['type'] = $sFeedType;
|
$asFeeds[$iId]['type'] = $sFeedType;
|
||||||
if($sFeedType!='post') $asFeeds[$iId]['displayed_id'] = 'N°'.($iIndex + 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ function initSpotMessages(aoMessages, aoTracks) {
|
|||||||
//Tooltip
|
//Tooltip
|
||||||
$Tooltip = $('<div>', {'class':'info-window'})
|
$Tooltip = $('<div>', {'class':'info-window'})
|
||||||
.append($('<h1>')
|
.append($('<h1>')
|
||||||
.append('Message '+oMsg.type+' #'+oMsg.id_message))
|
.append('Message '+oMsg.type+' '+oMsg.displayed_id))
|
||||||
.append($('<p>', {'class':'time'})
|
.append($('<p>', {'class':'time'})
|
||||||
.addIcon('fa-time')
|
.addIcon('fa-time')
|
||||||
.append(oMsg.formatted_time+(self.vars(['project', 'mode'])==self.consts.modes.blog?' ('+oMsg.relative_time+')':'')))
|
.append(oMsg.formatted_time+(self.vars(['project', 'mode'])==self.consts.modes.blog?' ('+oMsg.relative_time+')':'')))
|
||||||
|
|||||||
Reference in New Issue
Block a user