From: nicosomb Date: Thu, 18 Apr 2013 08:15:46 +0000 (+0200) Subject: Fixed #54 - récupération de l'id améliorée et utilisation de action_to_do() pour... X-Git-Tag: 0.1~6 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d06f30ef931402a1e56aab841ce852b3b81a9697;hp=64458521c36de87d10f1c726667faeaaa5126840;p=github%2Fwallabag%2Fwallabag.git Fixed #54 - récupération de l'id améliorée et utilisation de action_to_do() pour l'insertion dans l'import pocket --- diff --git a/import.php b/import.php index 497e32fb..9b42071b 100644 --- a/import.php +++ b/import.php @@ -29,26 +29,8 @@ else { $a = $li->find('a'); $url = $a[0]->href; - # 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 - { - # action query - if (isset($sql_action)) - { - $query = $db->getHandle()->prepare($sql_action); - $query->execute($params_action); - } - } - catch (Exception $e) - { - logm('error during pocket import : ' . $e->getMessage()); - } + action_to_do('add', $url, $token); } # Pocket génère un fichier HTML avec deux