From fac2d9a880a1e10a613bbbc7bddd7e461c5d9dbf Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 24 Sep 2016 13:49:55 -0400 Subject: [PATCH 1/2] Fix registration request notification query - Removed wrong usage of COUNT in registration request query - Added simple count() of results --- mod/ping.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/ping.php b/mod/ping.php index 8c28e7474..da44bc52d 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -123,9 +123,8 @@ function ping_init(&$a) { $mail = count($mails); if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){ - $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); - if ($regs) - $register = $regs[0]['total']; + $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); + $register = count($regs); } else { $register = "0"; } From fdacc40b5f6b3e709117df36c80d33200de2bbb6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 24 Sep 2016 13:51:53 -0400 Subject: [PATCH 2/2] Fix wrong data type --- mod/ping.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/ping.php b/mod/ping.php index da44bc52d..3f6dc730b 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -126,7 +126,7 @@ function ping_init(&$a) { $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); $register = count($regs); } else { - $register = "0"; + $register = 0; } $all_events = 0;