aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--import.php11
1 files 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 {
20 $html = new simple_html_dom(); 20 $html = new simple_html_dom();
21 $html->load_file('ril_export.html'); 21 $html->load_file('ril_export.html');
22 22
23 $read = '0'; 23 $read = 0;
24 $errors = array(); 24 $errors = array();
25 foreach($html->find('ul') as $ul) 25 foreach($html->find('ul') as $ul)
26 { 26 {
@@ -31,11 +31,18 @@ else {
31 31
32 32
33 action_to_do('add', $url, $token); 33 action_to_do('add', $url, $token);
34 if ($read == '1') {
35 $last_id = $db->getHandle()->lastInsertId();
36 $sql_update = "UPDATE entries SET is_read=~is_read WHERE id=?";
37 $params_update = array($last_id);
38 $query_update = $db->getHandle()->prepare($sql_update);
39 $query_update->execute($params_update);
40 }
34 } 41 }
35 # Pocket génère un fichier HTML avec deux <ul> 42 # Pocket génère un fichier HTML avec deux <ul>
36 # Le premier concerne les éléments non lus 43 # Le premier concerne les éléments non lus
37 # Le second concerne les éléments archivés 44 # Le second concerne les éléments archivés
38 $read = '-1'; 45 $read = 1;
39 } 46 }
40 47
41 echo 'Import from Pocket completed. <a href="index.php">Welcome to #poche !</a>'; 48 echo 'Import from Pocket completed. <a href="index.php">Welcome to #poche !</a>';