3 * poche, a read it later open source system
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
8 * @license http://www.wtfpl.net/ see COPYING file
13 * gestion des erreurs sqlite (duplicate tout ça)
15 * traiter les variables passées en get
16 * récupérer le titre de la page pochée (cf readityourself.php)
17 * actions archive, fav et delete à traiter
19 * améliorer présentation des liens
20 * améliorer présentation d'un article
21 * aligner verticalement les icones d'action
22 * afficher liens mis en favoris et archivés
28 $db_handle = new PDO('sqlite:poche.sqlite');
29 $db_handle->setAttribute(PDO
::ATTR_ERRMODE
, PDO
::ERRMODE_EXCEPTION
);
33 die('error : '.$e->getMessage());
36 $action = (isset ($_GET['action'])) ? htmlspecialchars($_GET['action']) : '';
40 $url = (isset ($_GET['url'])) ? htmlspecialchars($_GET['url']) : '';
42 $query = $db_handle->prepare('INSERT INTO entries ( url, title ) VALUES (?, ?)');
43 $query->execute(array($url, $title));
56 $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http";
57 return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
61 <!--[if lte IE
6]> <html
class="no-js ie6 ie67 ie678" lang
="en"> <![endif]-->
62 <!--[if lte IE
7]> <html
class="no-js ie7 ie67 ie678" lang
="en"> <![endif]-->
63 <!--[if IE
8]> <html
class="no-js ie8 ie678" lang
="en"> <![endif]-->
64 <!--[if gt IE
8]><!--> <html
class="no-js" lang
="en"> <!--<![endif]-->
67 <meta name
="viewport" content
="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
68 <meta charset
="utf-8">
69 <meta http
-equiv
="X-UA-Compatible" content
="IE=10">
70 <title
>poche
: queue
</title
>
71 <link rel
="stylesheet" href
="css/knacss.css" media
="all">
72 <link rel
="stylesheet" href
="css/style.css" media
="all">
76 <h1
>poche
, a read it later open source system
</h1
>
78 <div id
="main" class="w800p">
80 <li
><a href
="index.php">home
</a
></li
>
81 <li
><a href
="#">favorites
</a
></li
>
82 <li
><a href
="#">archive
</a
></li
>
83 <li
><a href
="javascript:(function(){var%20url%20=%20location.href;var%20title%20=%20document.title%20||%20url;window.open('<? echo url()?>index.php?action=add&url='%20+%20encodeURIComponent(url),'_self');})();">poche it
!</a
></li
>
86 $query = $db_handle->prepare("SELECT * FROM entries WHERE read=?");
87 $query->execute(array('FALSE'));
88 $entries = $query->fetchAll();
92 foreach ($entries as $entry) {
93 echo '<li><a href="readityourself.php?url='.urlencode($entry['url']).'">' . $entry['title'] . '</a> <a href="#" title="toggle delete" class="tool">✓</a> <a href="#" title="toggle favorite" class="tool">☆</a> <a href="#" title="toggle mark as read" class="tool">⨯</a></li>';
98 <footer
class="mr2 mt3">
99 <p
class="smaller"><a href
="http://github.com/nicosomb/poche">poche
</a
> is a read it later open source system
, based on
<a href
="http://www.memiks.fr/readityourself/">ReadItYourself
</a
>. poche is developed by
<a href
="http://nicolas.loeuillet.org">Nicolas Lœuillet
</a
> under the
<a href
="http://www.wtfpl.net/">Do What the Fuck You Want to
Public License
</a
></p
>