]> git.mxchange.org Git - friendica.git/commitdiff
The account overview is now grouped by the account type
authorMichael <heluecht@pirati.ca>
Tue, 23 Jan 2024 22:05:14 +0000 (22:05 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 23 Jan 2024 22:05:14 +0000 (22:05 +0000)
src/Module/Moderation/Summary.php

index ec235f155e19eda66b4eaedc79ae9bb25442c21d..a67ce19820408d6a35a9d63d9f5264f70607941e 100644 (file)
@@ -48,24 +48,23 @@ class Summary extends BaseModeration
        protected function content(array $request = []): string
        {
                parent::content();
-
+       
                $accounts = [
-                       [$this->t('Normal Account'), 0],
-                       [$this->t('Automatic Follower Account'), 0],
-                       [$this->t('Public Group Account'), 0],
-                       [$this->t('Automatic Friend Account'), 0],
-                       [$this->t('Blog Account'), 0],
-                       [$this->t('Private Group Account'), 0]
+                       [$this->t('Personal Page'), 0],
+                       [$this->t('Organisation Page'), 0],
+                       [$this->t('News Page'), 0],
+                       [$this->t('Community Group'), 0],
+                       [$this->t('Channel Relay'), 0],
                ];
 
                $users = 0;
 
-               $pageFlagsCountStmt = $this->database->p('SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `page-flags`', 0);
-               while ($pageFlagsCount = $this->database->fetch($pageFlagsCountStmt)) {
-                       $accounts[$pageFlagsCount['page-flags']][1] = $pageFlagsCount['count'];
-                       $users += $pageFlagsCount['count'];
+               $accountTypeCountStmt = $this->database->p('SELECT `account-type`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `account-type`', 0);
+               while ($AccountTypeCount = $this->database->fetch($accountTypeCountStmt)) {
+                       $accounts[$AccountTypeCount['account-type']][1] = $AccountTypeCount['count'];
+                       $users += $AccountTypeCount['count'];
                }
-               $this->database->close($pageFlagsCountStmt);
+               $this->database->close($accountTypeCountStmt);
 
                $this->logger->debug('accounts', ['accounts' => $accounts]);