diff options
author | nicosomb <nicolas@loeuillet.org> | 2013-04-18 11:18:28 +0200 |
---|---|---|
committer | nicosomb <nicolas@loeuillet.org> | 2013-04-18 11:18:28 +0200 |
commit | b693a19e1c3d4ffcf2f3aaef1d67df4b986e4903 (patch) | |
tree | 152a70cd9b70f203efd5f5d1e1e97ea865285fe4 /import.php | |
parent | 7312d15eaf0e9b4c0421552532d2cf57134e5d9a (diff) | |
download | wallabag-b693a19e1c3d4ffcf2f3aaef1d67df4b986e4903.tar.gz wallabag-b693a19e1c3d4ffcf2f3aaef1d67df4b986e4903.tar.zst wallabag-b693a19e1c3d4ffcf2f3aaef1d67df4b986e4903.zip |
lors de l'import, les liens déjà lus dans Pocket étaient repris en tant que non lus dans poche
Diffstat (limited to 'import.php')
-rw-r--r-- | import.php | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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>'; |