aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/statistics.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/statistics.php')
-rw-r--r--engine/lib/statistics.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/engine/lib/statistics.php b/engine/lib/statistics.php
index 4e822e8af..4cb0bb0b8 100644
--- a/engine/lib/statistics.php
+++ b/engine/lib/statistics.php
@@ -95,19 +95,27 @@ function get_number_users($show_deactivated = false) {
* @return string
*/
function get_online_users() {
- $offset = get_input('offset', 0);
- $count = count(find_active_users(600, 9999));
- $objects = find_active_users(600, 10, $offset);
+ $limit = max(0, (int) get_input("limit", 10));
+ $offset = max(0, (int) get_input("offset", 0));
+
+ $count = find_active_users(600, $limit, $offset, true);
+ $objects = find_active_users(600, $limit, $offset);
if ($objects) {
- return elgg_view_entity_list($objects, $count, $offset, 10, false);
+ return elgg_view_entity_list($objects, array(
+ 'count' => $count,
+ 'limit' => $limit,
+ 'offset' => $offset
+ ));
}
+ return '';
}
/**
* Initialise the statistics admin page.
*
* @return void
+ * @access private
*/
function statistics_init() {
elgg_extend_view('core/settings/statistics', 'core/settings/statistics/online');