X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=aa29e117a697d8b6c983c42f1dd5616a9c857cad;hb=61c1317f804d8519492af249f8b4b8985f6cec5e;hp=d548ec1ac72bfda6df3d3d85776ca6c639dc3c22;hpb=6a8a36f12d00f35004fbb034972ca87dd1a3c4f5;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index d548ec1ac7..aa29e117a6 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -23,7 +23,7 @@ function notification($params) { $banner = t('Friendica Notification'); $product = FRIENDICA_PLATFORM; - $siteurl = $a->get_baseurl(true); + $siteurl = App::get_baseurl(true); $thanks = t('Thank You,'); $sitename = $a->config['sitename']; if (!x($a->config['admin_name'])) @@ -58,7 +58,7 @@ function notification($params) { $additional_mail_header .= "X-Friendica-Platform: ".FRIENDICA_PLATFORM."\n"; $additional_mail_header .= "X-Friendica-Version: ".FRIENDICA_VERSION."\n"; $additional_mail_header .= "List-ID: \n"; - $additional_mail_header .= "List-Archive: <".$a->get_baseurl()."/notifications/system>\n"; + $additional_mail_header .= "List-Archive: <".App::get_baseurl()."/notifications/system>\n"; if (array_key_exists('item', $params)) { $title = $params['item']['title']; @@ -494,7 +494,7 @@ function notification($params) { } - $itemlink = $a->get_baseurl().'/notify/view/'.$notify_id; + $itemlink = App::get_baseurl().'/notify/view/'.$notify_id; $msg = replace_macros($epreamble, array('$itemlink' => $itemlink)); $msg_cache = format_notification_message($datarray['name_cache'], strip_tags(bbcode($msg))); $r = q("UPDATE `notify` SET `msg` = '%s', `msg_cache` = '%s' WHERE `id` = %d AND `uid` = %d", @@ -648,8 +648,6 @@ function notification($params) { * @param str $defaulttype (Optional) Forces a notification with this type. */ function check_item_notification($itemid, $uid, $defaulttype = "") { - $a = get_app(); - $notification_data = array("uid" => $uid, "profiles" => array()); call_hooks('check_item_notification', $notification_data); @@ -667,7 +665,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { $profiles[] = $owner[0]["url"]; // Notifications from Diaspora are often with an URL in the Diaspora format - $profiles[] = $a->get_baseurl()."/u/".$user[0]["nickname"]; + $profiles[] = App::get_baseurl()."/u/".$user[0]["nickname"]; $profiles2 = array(); @@ -721,7 +719,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { $params["to_email"] = $user[0]["email"]; $params["item"] = $item[0]; $params["parent"] = $item[0]["parent"]; - $params["link"] = $a->get_baseurl().'/display/'.urlencode($item[0]["guid"]); + $params["link"] = App::get_baseurl().'/display/'.urlencode($item[0]["guid"]); $params["otype"] = 'item'; $params["source_name"] = $item[0]["author-name"]; $params["source_link"] = $item[0]["author-link"]; @@ -739,7 +737,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") { $tags = q("SELECT `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` = %d AND `uid` = %d", intval(TERM_OBJ_POST), intval($itemid), intval(TERM_MENTION), intval($uid)); - if (count($tags)) { + if (dbm::is_result($tags)) { foreach ($tags AS $tag) { $r = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `notify_new_posts`", normalise_link($tag["url"]), intval($uid));