]>
Commit | Line | Data |
---|---|---|
67e79104 | 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 | ||
11 | header('Content-type:text/html; charset=utf-8'); | |
12 | ||
13 | include dirname(__FILE__).'/inc/config.php'; | |
14 | require_once dirname(__FILE__).'/inc/rain.tpl.class.php'; | |
15 | $db = new db(DB_PATH); | |
16 | ||
17 | if(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 | ||
c8bbe19b | 34 | if ($entry != NULL) { |
35 | generate_page($entry[0]); | |
36 | } | |
37 | else { | |
38 | die('error in view call'); | |
39 | } | |
40 | } | |
41 | else { | |
42 | die('error in view call'); | |
67e79104 | 43 | } |