X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnodeinfo.php;h=40094ee6e3a24047c572d479af1624a97adcd9ac;hb=0d223aa6f1b5d6eaacd76a8c27c47506222e3fa1;hp=7f8939182e7fd52d88c454fc3084400e9ac3e826;hpb=0c67c89715df801e0c887be50c9739db3bae7ca3;p=friendica.git diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php index 7f8939182e..40094ee6e3 100644 --- a/mod/nodeinfo.php +++ b/mod/nodeinfo.php @@ -1,13 +1,12 @@ $halfyear) OR - (strtotime($user['lastitem_date']) > $halfyear)) + (strtotime($user['last-item']) > $halfyear)) ++$active_users_halfyear; if ((strtotime($user['login_date']) > $month) OR - (strtotime($user['lastitem_date']) > $month)) + (strtotime($user['last-item']) > $month)) ++$active_users_monthly; } @@ -227,8 +217,7 @@ function nodeinfo_cron() { set_config('nodeinfo','active_users_monthly', $active_users_monthly); } - //$posts = q("SELECT COUNT(*) AS local_posts FROM `item` WHERE `wall` AND `uid` != 0 AND `id` = `parent` AND left(body, 6) != '[share'"); - $posts = q("SELECT COUNT(*) AS `local_posts` FROM `item` + $posts = qu("SELECT COUNT(*) AS `local_posts` FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `contact`.`self` and `item`.`id` = `item`.`parent` AND left(body, 6) != '[share' AND `item`.`network` IN ('%s', '%s', '%s')", dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_DFRN)); @@ -242,7 +231,7 @@ function nodeinfo_cron() { logger("local_posts: ".$local_posts, LOGGER_DEBUG); - $posts = q("SELECT COUNT(*) AS `local_comments` FROM `item` + $posts = qu("SELECT COUNT(*) AS `local_comments` FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `contact`.`self` and `item`.`id` != `item`.`parent` AND `item`.`network` IN ('%s', '%s', '%s')", dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_DFRN)); @@ -263,5 +252,5 @@ function nodeinfo_cron() { logger("cron_end"); set_config('nodeinfo','last_calucation', time()); } -} + ?>