-use Friendica\Object\Contact;
+use Friendica\Model\Contact;
+use Friendica\Model\Group;
+use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Temporal;
$data['intro'] = $intro_count;
$data['mail'] = $mail_count;
$data['net'] = $network_count;
$data['intro'] = $intro_count;
$data['mail'] = $mail_count;
$data['net'] = $network_count;
if (local_user()) {
// Different login session than the page that is calling us.
if (intval($_GET['uid']) && intval($_GET['uid']) != local_user()) {
if (local_user()) {
// Different login session than the page that is calling us.
if (intval($_GET['uid']) && intval($_GET['uid']) != local_user()) {
- $arr = array('items' => $items_unseen);
- call_hooks('network_ping', $arr);
+ $arr = ['items' => $items_unseen];
+ Addon::callHooks('network_ping', $arr);
if (DBM::is_result($group_counts)) {
foreach ($group_counts as $group_count) {
if ($group_count['count'] > 0) {
if (DBM::is_result($group_counts)) {
foreach ($group_counts as $group_count) {
if ($group_count['count'] > 0) {
- dbesc(datetime_convert('UTC', 'UTC', 'now + 7 days')),
- dbesc(datetime_convert('UTC', 'UTC', 'now'))
+ dbesc(DateTimeFormat::utc('now + 7 days')),
+ dbesc(DateTimeFormat::utcNow())
);
if (DBM::is_result($ev)) {
Cache::set($cachekey, $ev, CACHE_HOUR);
);
if (DBM::is_result($ev)) {
Cache::set($cachekey, $ev, CACHE_HOUR);
- if (datetime_convert('UTC', ((intval($x['adjust'])) ? $a->timezone : 'UTC'), $x['start'], 'Y-m-d') === $str_now) {
+ if (DateTimeFormat::convert($x['start'], ((intval($x['adjust'])) ? $a->timezone : 'UTC'), 'UTC', 'Y-m-d') === $str_now) {
// merge all notification types in one array
if (DBM::is_result($intros)) {
foreach ($intros as $intro) {
// merge all notification types in one array
if (DBM::is_result($intros)) {
foreach ($intros as $intro) {
'href' => System::baseUrl() . '/notifications/intros/' . $intro['id'],
'name' => $intro['name'],
'url' => $intro['url'],
'photo' => $intro['photo'],
'date' => $intro['datetime'],
'seen' => false,
'href' => System::baseUrl() . '/notifications/intros/' . $intro['id'],
'name' => $intro['name'],
'url' => $intro['url'],
'photo' => $intro['photo'],
'date' => $intro['datetime'],
'seen' => false,
'href' => System::baseUrl() . '/message/' . $mail['id'],
'name' => $mail['from-name'],
'url' => $mail['from-url'],
'photo' => $mail['from-photo'],
'date' => $mail['created'],
'seen' => false,
'href' => System::baseUrl() . '/message/' . $mail['id'],
'name' => $mail['from-name'],
'url' => $mail['from-url'],
'photo' => $mail['from-photo'],
'date' => $mail['created'],
'seen' => false,
'href' => System::baseUrl() . '/admin/users/',
'name' => $reg['name'],
'url' => $reg['url'],
'photo' => $reg['micro'],
'date' => $reg['created'],
'seen' => false,
'href' => System::baseUrl() . '/admin/users/',
'name' => $reg['name'],
'url' => $reg['url'],
'photo' => $reg['micro'],
'date' => $reg['created'],
'seen' => false,
'id' => $notif['id'],
'href' => $notif['href'],
'name' => $notif['name'],
'url' => $notif['url'],
'photo' => $notif['photo'],
'id' => $notif['id'],
'href' => $notif['href'],
'name' => $notif['name'],
'url' => $notif['url'],
'photo' => $notif['photo'],
'message' => $notif['message'],
'seen' => $notif['seen'],
'timestamp' => strtotime($local_time)
'message' => $notif['message'],
'seen' => $notif['seen'],
'timestamp' => strtotime($local_time)
if (x($_SESSION, 'sysmsg')) {
$sysmsgs = $_SESSION['sysmsg'];
if (x($_SESSION, 'sysmsg')) {
$sysmsgs = $_SESSION['sysmsg'];
$data['forums'] = $forums_unseen;
$data['notify'] = $sysnotify_count + $intro_count + $mail_count + $register_count;
$data['notifications'] = $notifications;
$data['forums'] = $forums_unseen;
$data['notify'] = $sysnotify_count + $intro_count + $mail_count + $register_count;
$data['notifications'] = $notifications;
$data = ping_format_xml_data($data, $sysnotify_count, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
header("Content-type: text/xml");
$data = ping_format_xml_data($data, $sysnotify_count, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
header("Content-type: text/xml");
$notification["name"] = $notification["name_cache"];
$notification["message"] = $notification["msg_cache"];
} else {
$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"])));
- if ($notification["visible"] && !$notification["spam"]
- && !$notification["deleted"] && !is_array($result[$notification["parent"]])
+ if ($notification["visible"]
+ && !$notification["spam"]
+ && !$notification["deleted"]
+ && !(x($result, $notification["parent"]) && is_array($result[$notification["parent"]]))
) {
// Should we condense the notifications or show them all?
if (PConfig::get(local_user(), 'system', 'detailed_notif')) {
) {
// Should we condense the notifications or show them all?
if (PConfig::get(local_user(), 'system', 'detailed_notif')) {
*/
function ping_format_xml_data($data, $sysnotify, $notifs, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen)
{
*/
function ping_format_xml_data($data, $sysnotify, $notifs, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen)
{
'id' => $notif['id'],
'href' => $notif['href'],
'name' => $notif['name'],
'id' => $notif['id'],
'href' => $notif['href'],
'name' => $notif['name'],
'date' => $notif['date'],
'seen' => $notif['seen'],
'timestamp' => $notif['timestamp']
'date' => $notif['date'],
'seen' => $notif['seen'],
'timestamp' => $notif['timestamp']
$data['sysmsgs'] = $sysmsg;
if ($data['register'] == 0) {
unset($data['register']);
}
$data['sysmsgs'] = $sysmsg;
if ($data['register'] == 0) {
unset($data['register']);
}
if (count($groups_unseen)) {
foreach ($groups_unseen as $key => $item) {
$groups[$key . ':group'] = $item['count'];
if (count($groups_unseen)) {
foreach ($groups_unseen as $key => $item) {
$groups[$key . ':group'] = $item['count'];
- $forums[$count . ':forum'] = $item['count'];
- $forums[$count . ':@attributes'] = array('id' => $item['id']);
+ $forums[$key . ':forum'] = $item['count'];
+ $forums[$key . ':@attributes'] = ['id' => $item['id']];