diff options
Diffstat (limited to 'index.php')
-rwxr-xr-x | index.php | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -44,8 +44,17 @@ switch ($action) | |||
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | $query = $db->getHandle()->prepare('INSERT INTO entries ( url, title ) VALUES (?, ?)'); | 47 | try |
48 | $query->execute(array($url, $title)); | 48 | { |
49 | # insert query | ||
50 | $query = $db->getHandle()->prepare('INSERT INTO entries ( url, title, content ) VALUES (?, ?, ?)'); | ||
51 | $query->execute(array($url, $title, $r->articleContent->innerHTML)); | ||
52 | } | ||
53 | catch (Exception $e) | ||
54 | { | ||
55 | error_log('insert query error : '.$e->getMessage()); | ||
56 | } | ||
57 | |||
49 | break; | 58 | break; |
50 | case 'delete': | 59 | case 'delete': |
51 | $sql_action = "DELETE FROM entries WHERE id=?"; | 60 | $sql_action = "DELETE FROM entries WHERE id=?"; |
@@ -66,7 +75,7 @@ try | |||
66 | } | 75 | } |
67 | catch (Exception $e) | 76 | catch (Exception $e) |
68 | { | 77 | { |
69 | die('query error : '.$e->getMessage()); | 78 | die('action query error : '.$e->getMessage()); |
70 | } | 79 | } |
71 | 80 | ||
72 | switch ($view) | 81 | switch ($view) |
@@ -95,7 +104,7 @@ try | |||
95 | } | 104 | } |
96 | catch (Exception $e) | 105 | catch (Exception $e) |
97 | { | 106 | { |
98 | die('query error : '.$e->getMessage()); | 107 | die('view query error : '.$e->getMessage()); |
99 | } | 108 | } |
100 | 109 | ||
101 | ?> | 110 | ?> |
@@ -136,7 +145,7 @@ catch (Exception $e) | |||
136 | <div id="entry-<?php echo $entry['id']; ?>" class="entrie mb2"> | 145 | <div id="entry-<?php echo $entry['id']; ?>" class="entrie mb2"> |
137 | <span class="content"> | 146 | <span class="content"> |
138 | <h2 class="h6-like"> | 147 | <h2 class="h6-like"> |
139 | <a href="readityourself.php?url=<?php echo urlencode($entry['url']); ?>"><?php echo $entry['title']; ?> | 148 | <a href="view.php?id=<?php echo $entry['id']; ?>"><?php echo $entry['title']; ?> |
140 | </h2> | 149 | </h2> |
141 | <div class="tools"> | 150 | <div class="tools"> |
142 | <a title="toggle mark as read" class="tool archive <?php echo ( ($entry['is_read'] == '0') ? 'archive-off' : '' ); ?>" onclick="toggle_archive(<?php echo $entry['id']; ?>)"><span></span></a> | 151 | <a title="toggle mark as read" class="tool archive <?php echo ( ($entry['is_read'] == '0') ? 'archive-off' : '' ); ?>" onclick="toggle_archive(<?php echo $entry['id']; ?>)"><span></span></a> |