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()
|
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();
|
$asMessages = $this->getSpotMessages();
|
||||||
$bSuccess = !empty($asMessages);
|
$bSuccess = !empty($asMessages);
|
||||||
$sDesc = $bSuccess?'':self::NO_DATA;
|
$sDesc = $bSuccess?'':self::NO_DATA;
|
||||||
@@ -207,10 +199,6 @@ class Spot extends Main
|
|||||||
if($bSuccess) {
|
if($bSuccess) {
|
||||||
$asPics = $this->getPictures('taken_on');
|
$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
|
//Assign pictures to closest message
|
||||||
$iIndex = 0;
|
$iIndex = 0;
|
||||||
$iMaxIndex = count($asMessages) - 1;
|
$iMaxIndex = count($asMessages) - 1;
|
||||||
@@ -274,6 +262,7 @@ class Spot extends Main
|
|||||||
$asAllFeedMessages[] = $asMessage;
|
$asAllFeedMessages[] = $asMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
usort($asAllFeedMessages, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||||
|
|
||||||
return $asAllFeedMessages;
|
return $asAllFeedMessages;
|
||||||
}
|
}
|
||||||
@@ -297,6 +286,7 @@ class Spot extends Main
|
|||||||
$asValidPics[] = $asPic;
|
$asValidPics[] = $asPic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
usort($asValidPics, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||||
|
|
||||||
return $asValidPics;
|
return $asValidPics;
|
||||||
}
|
}
|
||||||
@@ -320,6 +310,7 @@ class Spot extends Main
|
|||||||
|
|
||||||
$this->addTimeStamp($asPost, $iUnixTimeStamp);
|
$this->addTimeStamp($asPost, $iUnixTimeStamp);
|
||||||
}
|
}
|
||||||
|
usort($asPosts, function($a, $b){return $a['unix_timestamp'] > $b['unix_timestamp'];});
|
||||||
|
|
||||||
return $asPosts;
|
return $asPosts;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user