/**
* @file include/ping.php
*/
+
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\System;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\System;
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';
WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and `ignore` = 0
ORDER BY `start` ASC ",
intval(local_user()),
- 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);
$all_events = count($ev);
if ($all_events) {
- $str_now = datetime_convert('UTC', $a->timezone, 'now', 'Y-m-d');
+ $str_now = DateTimeFormat::timezoneNow($a->timezone, 'Y-m-d');
foreach ($ev as $x) {
$bd = false;
if ($x['type'] === 'birthday') {
} else {
$events ++;
}
- 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) {
$all_events_today ++;
if ($bd) {
$birthdays_today ++;
'photo' => $intro['photo'],
'date' => $intro['datetime'],
'seen' => false,
- 'message' => t('{0} wants to be your friend'),
+ 'message' => L10n::t('{0} wants to be your friend'),
];
$notifs[] = $notif;
}
'photo' => $mail['from-photo'],
'date' => $mail['created'],
'seen' => false,
- 'message' => t('{0} sent you a message'),
+ 'message' => L10n::t('{0} sent you a message'),
];
$notifs[] = $notif;
}
'photo' => $reg['micro'],
'date' => $reg['created'],
'seen' => false,
- 'message' => t('{0} requested registration'),
+ 'message' => L10n::t('{0} requested registration'),
];
$notifs[] = $notif;
}
$notif['photo'] = proxy_url($notif['photo'], false, PROXY_SIZE_MICRO);
}
- $local_time = datetime_convert('UTC', date_default_timezone_get(), $notif['date']);
+ $local_time = DateTimeFormat::local($notif['date']);
$notifications[] = [
'id' => $notif['id'],
'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)
$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",
$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;
}