aboutsummaryrefslogtreecommitdiffhomepage
path: root/view.php
diff options
context:
space:
mode:
Diffstat (limited to 'view.php')
-rwxr-xr-xview.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/view.php b/view.php
new file mode 100755
index 00000000..aba1b7ec
--- /dev/null
+++ b/view.php
@@ -0,0 +1,35 @@
1<?php
2/**
3 * poche, a read it later open source system
4 *
5 * @category poche
6 * @author Nicolas LÅ“uillet <nicolas@loeuillet.org>
7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file
9 */
10
11header('Content-type:text/html; charset=utf-8');
12
13include dirname(__FILE__).'/inc/config.php';
14require_once dirname(__FILE__).'/inc/rain.tpl.class.php';
15$db = new db(DB_PATH);
16
17if(isset($_GET['id']) && $_GET['id'] != '') {
18
19 $sql = "SELECT * FROM entries WHERE id=?";
20 $params = array(intval($_GET['id']));
21
22 # view article query
23 try
24 {
25 $query = $db->getHandle()->prepare($sql);
26 $query->execute($params);
27 $entry = $query->fetchAll();
28 }
29 catch (Exception $e)
30 {
31 die('query error : '.$e->getMessage());
32 }
33
34 generate_page($entry[0]['url'], $entry[0]['title'], $entry[0]['content']);
35} \ No newline at end of file