Elgg  Version 6.0
content.php
Go to the documentation of this file.
1 <?php
7 use Elgg\Values;
8 
9 $widget = elgg_extract('entity', $vars);
10 if (!$widget instanceof \ElggWidget) {
11  return;
12 }
13 
14 $num_display = (int) $widget->num_display ?: 8;
15 
16 echo elgg_list_entities([
17  'type' => 'user',
18  'pagination' => false,
19  'limit' => $num_display,
20  'no_results' => true,
21  'widget_more' => elgg_view_url($widget->getURL(), elgg_echo('more')),
22  'wheres' => [
23  function(QueryBuilder $qb, $main_alias) {
24  return $qb->compare("{$main_alias}.last_action", '>=', Values::normalizeTimestamp('-10 minutes'), ELGG_VALUE_TIMESTAMP);
25  }
26  ],
27  'sort_by' => [
28  'property' => 'last_action',
29  'direction' => 'desc',
30  ],
31 ]);
Saves user notification settings.
if(elgg_in_context('default_widgets')) $widget
Definition: content.php:8
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
Database abstraction query builder.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
if(!$widget instanceof\ElggWidget) $num_display
Definition: content.php:11
compare(string $x, string $comparison, $y=null, string $type=null, bool $case_sensitive=null)
Build value comparison clause.
const ELGG_VALUE_TIMESTAMP
Definition: constants.php:115
elgg_list_entities(array $options=[], callable $getter=null, callable $viewer=null)
Returns a string of rendered entities.
Definition: entities.php:551
$vars
Definition: theme.php:5
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
Definition: views.php:1427
$qb
Definition: queue.php:12