X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=39665d14d4c994ca267127ef135b1e5962e03393;hb=0cd9db9cb7f4c96f597e37590a536eaae123238d;hp=ebc27309dbe61710b76241f84bfd28e6f8ce0b1d;hpb=5eaa5951a1b19b985017b5db20f3b1abf464a1ef;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index ebc27309db..39665d14d4 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -1,4 +1,7 @@ 1)) { for ($d = 1; $d < count($p); $d ++) { - q("DELETE FROM `notify` WHERE `id` = %d", - intval($p[$d]['id']) - ); + dba::delete('notify', array('id' => $p[$d]['id'])); } // only continue on if we stored the first one @@ -512,7 +515,7 @@ function notification($params) { logger('sending notification email'); - if (isset($params['parent']) AND (intval($params['parent']) != 0)) { + if (isset($params['parent']) && (intval($params['parent']) != 0)) { $id_for_parent = $params['parent']."@".$hostname; // Is this the first email notification for this parent item and user? @@ -673,7 +676,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { // Check for invalid profile urls. 13 should be the shortest possible profile length: // http://a.bc/d // Additionally check for invalid urls that would return the normalised value "http:" - if ((strlen($profile) >= 13) AND (normalise_link($profile) != "http:")) { + if ((strlen($profile) >= 13) && (normalise_link($profile) != "http:")) { if (!in_array($profile, $profiles2)) $profiles2[] = $profile; @@ -757,11 +760,11 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { $tagged = false; foreach ($profiles AS $profile) { - if (strpos($item[0]["tag"], "=".$profile."]") OR strpos($item[0]["body"], "=".$profile."]")) + if (strpos($item[0]["tag"], "=".$profile."]") || strpos($item[0]["body"], "=".$profile."]")) $tagged = true; } - if ($item[0]["mention"] OR $tagged OR ($defaulttype == NOTIFY_TAGSELF)) { + if ($item[0]["mention"] || $tagged || ($defaulttype == NOTIFY_TAGSELF)) { $params["type"] = NOTIFY_TAGSELF; $params["verb"] = ACTIVITY_TAG; } @@ -773,7 +776,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { LIMIT 1", intval($item[0]["parent"]), intval($uid)); - if ($parent AND !isset($params["type"])) { + if ($parent && !isset($params["type"])) { $params["type"] = NOTIFY_COMMENT; $params["verb"] = ACTIVITY_POST; }