diff --git a/inc/Feed.php b/inc/Feed.php index ce6b948..f8ff2de 100644 --- a/inc/Feed.php +++ b/inc/Feed.php @@ -140,7 +140,7 @@ class Feed extends PhpObject { public function getLastMessageId($asConstraints=array()) { $asMessages = $this->getMessages($asConstraints); - return end($asMessages)[Db::getId(self::MSG_TABLE)]; + return end($asMessages)[Db::getId(self::MSG_TABLE)] ?? 0; } public function checkUpdateFeed($sProjectMode) { @@ -151,8 +151,8 @@ class Feed extends PhpObject { $oLastUpdate = new \DateTime('@'.$this->iLastUpdate); $oNow = new \DateTime('now'); $iSecDiff = $oNow->getTimestamp() - $oLastUpdate->getTimestamp(); - - if($iSecDiff > self::FEED_MAX_REFRESH && !Settings::DEBUG) $bNewMsg = $this->updateFeed(); + + if($iSecDiff > self::FEED_MAX_REFRESH) $bNewMsg = $this->updateFeed(); } return $bNewMsg; diff --git a/inc/Map.php b/inc/Map.php index f51d94b..14d4cd7 100644 --- a/inc/Map.php +++ b/inc/Map.php @@ -31,6 +31,7 @@ class Map extends PhpObject { } public function getMapUrl($sCodeName, $asParams) { + $asParams['token'] = $this->asMaps[$sCodeName]['token']; return self::populateParams($this->asMaps[$sCodeName]['pattern'], $asParams); }