Elgg  Version master
user.php
Go to the documentation of this file.
1 <?php
6 // Banned user count
8  'type' => 'user',
9  'metadata_name_value_pairs' => ['banned' => 'yes'],
10 ]);
11 
12 // Active user count
14  'type' => 'user',
15  'metadata_name_value_pairs' => ['banned' => 'no'],
16 ]);
17 
18 // Unverified user count
20  return elgg_count_entities([
21  'type' => 'user',
22  'metadata_name_value_pairs' => ['validated' => false],
23  ]);
24 });
25 
26 // Total user count (Enable & Disabled)
28  return elgg_count_entities([
29  'type' => 'user',
30  ]);
31 });
32 
33 // Enabled user count
35  'type' => 'user',
36 ]);
37 
38 // Disabled user count
40 
41 $table = elgg_format_element('tr', [], implode(PHP_EOL, [
42  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('active'))),
44 ]));
45 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
46  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('status:disabled'))),
48 ]));
49 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
50  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('unvalidated'))),
52 ]));
53 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
54  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('banned'))),
56 ]));
57 $table .= elgg_format_element('tr', [], implode(PHP_EOL, [
58  elgg_format_element('td', [], elgg_format_element('b', [], elgg_echo('total'))),
60 ]));
61 $table = elgg_format_element('table', ['class' => 'elgg-table-alt'], $table);
62 
63 echo elgg_view_module('info', elgg_echo('admin:statistics:label:user'), $table);
$users_active
Definition: user.php:13
$total_users
Definition: user.php:27
$users_disabled
Definition: user.php:39
$users_banned
Show user statistics.
Definition: user.php:7
$table
Definition: user.php:41
$users_enabled
Definition: user.php:34
$users_unverified
Definition: user.php:19
const ELGG_SHOW_DISABLED_ENTITIES
Definition: constants.php:123
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:290
elgg_count_entities(array $options=[])
Returns a count of entities.
Definition: entities.php:518
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
elgg_view_module(string $type, string $title, string $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:922
elgg_format_element(string $tag_name, array $attributes=[], string $text='', array $options=[])
Format an HTML element.
Definition: output.php:145
elgg_number_format(float $number, int $decimals=0)
Format a number with grouped thousands using language specific separators.
Definition: output.php:368