From 4eae03462fc074bdd55281cd559bed740cad50b7 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sun, 31 May 2015 16:00:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20ID=20=D1=82=D0=BE=D1=87=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20=D0=B8=D1=81=D1=82=D0=BE=D1=87=D0=BD=D0=B8=D0=BA=D0=B0?= =?UTF-8?q?=D1=85=20=D0=BA=D0=B0=D1=80=D1=82=D0=B8=D0=BD=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/models/PhotoLinks.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)