Skip to content

Commit

Permalink
Remove duplicate code and remove auth check from loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgirr83 committed Jul 24, 2018
1 parent 67f316d commit 052355f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,15 @@ public function display_24_hour_stats($event)

$user_count = $bot_count = $hidden_count = 0;
$interval = $this->define_interval();
// we hide bots according to the hide bots extension
$should_hide = (!$this->auth->acl_get('a_') && $this->hidebots !== null) ? true : false;

// parse the activity
foreach ((array) $active_users as $row)
{
// we hide bots according to the hide bots extension
$should_hide = (!$this->auth->acl_get('a_') && $this->hidebots !== null) ? true : false;

// the users stuff...this is changed below depending
$username_string = $this->auth->acl_get('u_viewprofile') ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']);
$max_last_visit = max($row['user_lastvisit'], $row['session_time']);
$hover_info = ' title="' . $this->user->format_date($max_last_visit, false, false) . '"';

if (($should_hide && $row['user_type'] == USER_IGNORE) || ($row['user_lastvisit'] < $interval && $row['session_time'] < $interval))
{
Expand Down

0 comments on commit 052355f

Please sign in to comment.