]> git.mxchange.org Git - friendica.git/blobdiff - include/NotificationsManager.php
Fallback for empty names
[friendica.git] / include / NotificationsManager.php
index b7e31d4f657938ee304641dec0ae9858146dada1..5f8211eb87819ce1f1ec4cdc6f8de3d19e4fb07a 100644 (file)
@@ -2,6 +2,7 @@
 /**
  * @file include/NotificationsManager.php
  */
+require_once('include/html2plain.php');
 require_once("include/datetime.php");
 require_once("include/bbcode.php");
 
@@ -79,7 +80,7 @@ class NotificationsManager {
         
         if ($limit!="") $limit = " LIMIT ".$limit;
         
-               $r = q("SELECT * FROM notify WHERE uid = %d $filter_sql ORDER BY $order_sql $limit",
+               $r = q("SELECT * FROM `notify` WHERE `uid` = %d $filter_sql ORDER BY $order_sql $limit",
                        intval(local_user())
                );
         if ($r!==false && count($r)>0) return $this->_set_extra($r);
@@ -93,7 +94,7 @@ class NotificationsManager {
      * @return array note values or null if not found
      */
     public function getByID($id) {
-        $r = q("SELECT * FROM notify WHERE id = %d AND uid = %d LIMIT 1",
+        $r = q("SELECT * FROM `notify` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                 intval($id),
                 intval(local_user())
         );
@@ -111,7 +112,7 @@ class NotificationsManager {
      * @return bool true on success, false on errors
      */
     public function setSeen($note, $seen = true) {
-        return q("UPDATE notify SET seen = %d WHERE ( link = '%s' OR ( parent != 0 AND parent = %d AND otype = '%s' )) AND uid = %d",
+        return q("UPDATE `notify` SET `seen` = %d WHERE ( `link` = '%s' OR ( `parent` != 0 AND `parent` = %d AND `otype` = '%s' )) AND `uid` = %d",
             intval($seen),
             dbesc($note['link']),
             intval($note['parent']),
@@ -127,7 +128,7 @@ class NotificationsManager {
      * @return bool true on success, false on error
      */
     public function setAllSeen($seen = true) {
-       return q("UPDATE notify SET seen = %d WHERE uid = %d",
+       return q("UPDATE `notify` SET `seen` = %d WHERE `uid` = %d",
             intval($seen),
                        intval(local_user())
                );