aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/index.php b/index.php
index 27144de3..7ae2fb6f 100755
--- a/index.php
+++ b/index.php
@@ -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}
67catch (Exception $e) 76catch (Exception $e)
68{ 77{
69 die('query error : '.$e->getMessage()); 78 die('action query error : '.$e->getMessage());
70} 79}
71 80
72switch ($view) 81switch ($view)
@@ -95,7 +104,7 @@ try
95} 104}
96catch (Exception $e) 105catch (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>