From cb1348bc5c514e98595ccc3b050054ce14ca8e8f Mon Sep 17 00:00:00 2001 From: nicosomb Date: Thu, 18 Apr 2013 08:25:15 +0200 Subject: [PATCH] =?utf8?q?Fixed=20#53=20-=20on=20ne=20passait=20pas=20d'id?= =?utf8?q?=20pour=20la=20cr=C3=A9ation=20du=20r=C3=A9pertoire=20d'images?= =?utf8?q?=20lors=20de=20l'import=20pocket?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- import.php | 7 ++++++- inc/functions.php | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/import.php b/import.php index 97072437..497e32fb 100644 --- a/import.php +++ b/import.php @@ -28,7 +28,12 @@ else { { $a = $li->find('a'); $url = $a[0]->href; - $parametres_url = prepare_url($url); + + # FIXME corriger cette génération d'ID + $req = $db->getHandle()->query("SELECT id FROM entries ORDER BY id DESC"); + $id = $req->fetchColumn()+1; + + $parametres_url = prepare_url($url, $id); $sql_action = 'INSERT INTO entries ( url, title, content, is_read ) VALUES (?, ?, ?, ?)'; $params_action = array($url, $parametres_url['title'], $parametres_url['content'], $read); try diff --git a/inc/functions.php b/inc/functions.php index a6109ef7..b7c7baff 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -240,6 +240,7 @@ function action_to_do($action, $id, $url, $token) if ($url == '') continue; + # FIXME corriger cette génération d'ID $req = $db->getHandle()->query("SELECT id FROM entries ORDER BY id DESC"); $id = $req->fetchColumn()+1; -- 2.41.0