From b693a19e1c3d4ffcf2f3aaef1d67df4b986e4903 Mon Sep 17 00:00:00 2001 From: nicosomb Date: Thu, 18 Apr 2013 11:18:28 +0200 Subject: [PATCH] =?utf8?q?lors=20de=20l'import,=20les=20liens=20d=C3=A9j?= =?utf8?q?=C3=A0=20lus=20dans=20Pocket=20=C3=A9taient=20repris=20en=20tant?= =?utf8?q?=20que=20non=20lus=20dans=20poche?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- import.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/import.php b/import.php index 9b42071b..135443c9 100644 --- a/import.php +++ b/import.php @@ -20,7 +20,7 @@ else { $html = new simple_html_dom(); $html->load_file('ril_export.html'); - $read = '0'; + $read = 0; $errors = array(); foreach($html->find('ul') as $ul) { @@ -31,11 +31,18 @@ else { action_to_do('add', $url, $token); + if ($read == '1') { + $last_id = $db->getHandle()->lastInsertId(); + $sql_update = "UPDATE entries SET is_read=~is_read WHERE id=?"; + $params_update = array($last_id); + $query_update = $db->getHandle()->prepare($sql_update); + $query_update->execute($params_update); + } } # Pocket génère un fichier HTML avec deux