fix picture numbering
This commit is contained in:
15
inc/spot.php
15
inc/spot.php
@@ -191,14 +191,6 @@ class Spot extends Main
|
||||
|
||||
public function getMarkers()
|
||||
{
|
||||
/* Adding another point to test
|
||||
$test = $this->oDb->selectRow(self::MSG_TABLE, 1);
|
||||
unset($test['id_message']);
|
||||
$test['ref_msg_id'] = $test['ref_msg_id'] + 1;
|
||||
$test['latitude'] = '-41.4395';
|
||||
$test['longitude'] = '172.1936';
|
||||
$this->oDb->insertUpdateRow(self::MSG_TABLE, $test, array('ref_msg_id')); */
|
||||
|
||||
$asMessages = $this->getSpotMessages();
|
||||
$bSuccess = !empty($asMessages);
|
||||
$sDesc = $bSuccess?'':self::NO_DATA;
|
||||
@@ -207,10 +199,6 @@ class Spot extends Main
|
||||
if($bSuccess) {
|
||||
$asPics = $this->getPictures('taken_on');
|
||||
|
||||
//Sort messages and pictures chronologically
|
||||
uasort($asPics, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||
uasort($asMessages, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||
|
||||
//Assign pictures to closest message
|
||||
$iIndex = 0;
|
||||
$iMaxIndex = count($asMessages) - 1;
|
||||
@@ -274,6 +262,7 @@ class Spot extends Main
|
||||
$asAllFeedMessages[] = $asMessage;
|
||||
}
|
||||
}
|
||||
usort($asAllFeedMessages, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||
|
||||
return $asAllFeedMessages;
|
||||
}
|
||||
@@ -297,6 +286,7 @@ class Spot extends Main
|
||||
$asValidPics[] = $asPic;
|
||||
}
|
||||
}
|
||||
usort($asValidPics, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||
|
||||
return $asValidPics;
|
||||
}
|
||||
@@ -320,6 +310,7 @@ class Spot extends Main
|
||||
|
||||
$this->addTimeStamp($asPost, $iUnixTimeStamp);
|
||||
}
|
||||
usort($asPosts, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||
|
||||
return $asPosts;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user