diff --git a/ground/models/PhotoLinks.php b/ground/models/PhotoLinks.php index 5348434..a4315c1 100644 --- a/ground/models/PhotoLinks.php +++ b/ground/models/PhotoLinks.php @@ -16,7 +16,9 @@ class PhotoLinks extends Model static function addLink($photo, $url) { $parsedUrl = parse_url($url); - App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;'); + $photoDetails = explode('_', $photo); + $pointId = (int)$photoDetails[0]; + App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'", "'.$pointId.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;'); } static function getCaption($photo)