* @file include/ping.php
*/
use Friendica\App;
+use Friendica\Content\Feature;
+use Friendica\Content\ForumManager;
use Friendica\Core\Cache;
use Friendica\Core\System;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
-use Friendica\Object\Contact;
+use Friendica\Model\Contact;
+use Friendica\Model\Group;
use Friendica\Util\XML;
require_once 'include/datetime.php';
require_once 'include/bbcode.php';
-require_once 'include/ForumManager.php';
-require_once 'include/group.php';
require_once 'mod/proxy.php';
require_once 'include/enotify.php';
}
} else {
header("Content-type: text/xml");
- echo XML::from_array($data, $xml);
+ echo XML::fromArray($data, $xml);
}
killme();
}
}
if ($network_count) {
- if (intval(feature_enabled(local_user(), 'groups'))) {
+ if (intval(Feature::isEnabled(local_user(), 'groups'))) {
// Find out how unseen network posts are spread across groups
- $group_counts = groups_count_unseen();
+ $group_counts = Group::countUnseen();
if (DBM::is_result($group_counts)) {
foreach ($group_counts as $group_count) {
if ($group_count['count'] > 0) {
}
}
- if (intval(feature_enabled(local_user(), 'forumlist_widget'))) {
- $forum_counts = ForumManager::count_unseen_items();
- if (DBM::is_result($forums_counts)) {
- foreach ($forums_counts as $forum_count) {
+ if (intval(Feature::isEnabled(local_user(), 'forumlist_widget'))) {
+ $forum_counts = ForumManager::countUnseenItems();
+ if (DBM::is_result($forum_counts)) {
+ foreach ($forum_counts as $forum_count) {
if ($forum_count['count'] > 0) {
$forums_unseen[] = $forum_count;
}
if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()) {
$regs = q(
- "SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) AS `total`
+ "SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`
FROM `contact` RIGHT JOIN `register` ON `register`.`uid` = `contact`.`uid`
WHERE `contact`.`self` = 1"
);
if (DBM::is_result($regs)) {
- $register_count = $regs[0]['total'];
+ $register_count = count($regs);
}
}
$notif['message'] = str_replace("{0}", $notif['name'], $notif['message']);
}
- $contact = get_contact_details_by_url($notif['url']);
+ $contact = Contact::getDetailsByURL($notif['url']);
if (isset($contact['micro'])) {
$notif['photo'] = proxy_url($contact['micro'], false, PROXY_SIZE_MICRO);
} else {
$data = ping_format_xml_data($data, $sysnotify_count, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
header("Content-type: text/xml");
- echo XML::from_array(array("result" => $data), $xml);
+ echo XML::fromArray(array("result" => $data), $xml);
}
killme();
$notification["href"] = System::baseUrl() . "/notify/view/" . $notification["id"];
- 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')) {