]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
Merge pull request #4767 from tobiasd/20180407-de
[friendica.git] / mod / ping.php
index 3249624fbeb3c87388f3b64a02df584cbcf83266..146411206f601370312353ed07436fbcee96b48e 100644 (file)
@@ -6,6 +6,7 @@
 use Friendica\App;
 use Friendica\Content\Feature;
 use Friendica\Content\ForumManager;
+use Friendica\Content\Text\BBCode;
 use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 use Friendica\Core\L10n;
@@ -15,10 +16,9 @@ use Friendica\Database\DBM;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
 use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Temporal;
 use Friendica\Util\XML;
 
-require_once 'include/datetime.php';
-require_once 'include/bbcode.php';
 require_once 'mod/proxy.php';
 require_once 'include/enotify.php';
 
@@ -370,7 +370,7 @@ function ping_init(App $a)
                                        'name'      => $notif['name'],
                                        'url'       => $notif['url'],
                                        'photo'     => $notif['photo'],
-                                       'date'      => relative_date($notif['date']),
+                                       'date'      => Temporal::getRelativeDate($notif['date']),
                                        'message'   => $notif['message'],
                                        'seen'      => $notif['seen'],
                                        'timestamp' => strtotime($local_time)
@@ -481,8 +481,8 @@ function ping_get_notifications($uid)
                                $notification["name"] = $notification["name_cache"];
                                $notification["message"] = $notification["msg_cache"];
                        } else {
-                               $notification["name"] = strip_tags(bbcode($notification["name"]));
-                               $notification["message"] = format_notification_message($notification["name"], strip_tags(bbcode($notification["msg"])));
+                               $notification["name"] = strip_tags(BBCode::convert($notification["name"]));
+                               $notification["message"] = format_notification_message($notification["name"], strip_tags(BBCode::convert($notification["msg"])));
 
                                q(
                                        "UPDATE `notify` SET `name_cache` = '%s', `msg_cache` = '%s' WHERE `id` = %d",
@@ -571,8 +571,8 @@ function ping_format_xml_data($data, $sysnotify, $notifs, $sysmsgs, $sysmsgs_inf
        $forums = [];
        if (count($forums_unseen)) {
                foreach ($forums_unseen as $key => $item) {
-                       $forums[$count . ':forum'] = $item['count'];
-                       $forums[$count . ':@attributes'] = ['id' => $item['id']];
+                       $forums[$key . ':forum'] = $item['count'];
+                       $forums[$key . ':@attributes'] = ['id' => $item['id']];
                }
                $data['forums'] = $forums;
        }