Elgg  Version 6.0
user.php
Go to the documentation of this file.
1 <?php
2 // Banned user count
4  'type' => 'user',
5  'metadata_name_value_pairs' => ['banned' => 'yes'],
6 ]);
7 
8 // Active user count
10  'type' => 'user',
11  'metadata_name_value_pairs' => ['banned' => 'no'],
12 ]);
13 
14 // Unverified user count
16  return elgg_count_entities([
17  'type' => 'user',
18  'metadata_name_value_pairs' => ['validated' => false],
19  ]);
20 });
21 
22 // Total user count (Enable & Disabled)
24  return elgg_count_entities([
25  'type' => 'user',
26  ]);
27 });
28 
29 // Enabled user count
31  'type' => 'user',
32 ]);
33 
34 // Disabled user count
36 
37 $table = elgg_format_element('tr', [], implode(PHP_EOL, [
38  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('active'))),
40 ]));
41 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
42  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('status:disabled'))),
44 ]));
45 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
46  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('unvalidated'))),
48 ]));
49 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
50  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('banned'))),
52 ]));
53 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
54  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('total'))),
56 ]));
57 $table = elgg_format_element('table', ['class' => 'elgg-table-alt'], $table);
58 
59 echo elgg_view_module('info', elgg_echo('admin:statistics:label:user'), $table);
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
Definition: elgglib.php:304
elgg_view_module(string $type, string $title, string $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:919
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$users_disabled
Definition: user.php:35
$users_unverified
Definition: user.php:15
$users_active
Definition: user.php:9
const ELGG_SHOW_DISABLED_ENTITIES
Definition: constants.php:132
elgg_count_entities(array $options=[])
Returns a count of entities.
Definition: entities.php:518
$users_enabled
Definition: user.php:30
$table
Definition: user.php:37
$users_banned
Definition: user.php:3
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
$total_users
Definition: user.php:23