mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- Re-populate arrays on cache purge/save to allow re-using some functions without warnings
- fix the annoying "last page empty" bug on inactive users page. git-svn-id: file:///svn/phpbb/trunk@8239 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
053730e477
commit
9b751a330d
3 changed files with 25 additions and 9 deletions
|
@ -67,6 +67,11 @@ class acm
|
||||||
unset($this->var_expires);
|
unset($this->var_expires);
|
||||||
unset($this->sql_rowset);
|
unset($this->sql_rowset);
|
||||||
unset($this->sql_row_pointer);
|
unset($this->sql_row_pointer);
|
||||||
|
|
||||||
|
$this->vars = array();
|
||||||
|
$this->var_expires = array();
|
||||||
|
$this->sql_rowset = array();
|
||||||
|
$this->sql_row_pointer = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -232,6 +237,11 @@ class acm
|
||||||
unset($this->sql_rowset);
|
unset($this->sql_rowset);
|
||||||
unset($this->sql_row_pointer);
|
unset($this->sql_row_pointer);
|
||||||
|
|
||||||
|
$this->vars = array();
|
||||||
|
$this->var_expires = array();
|
||||||
|
$this->sql_rowset = array();
|
||||||
|
$this->sql_row_pointer = array();
|
||||||
|
|
||||||
$this->is_modified = false;
|
$this->is_modified = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,7 @@ class acp_inactive
|
||||||
'action' => $action,
|
'action' => $action,
|
||||||
'mark' => $mark,
|
'mark' => $mark,
|
||||||
'submit' => 1,
|
'submit' => 1,
|
||||||
|
'start' => ($start - sizeof($user_affected) < 0) ? 0 : $start - sizeof($user_affected),
|
||||||
);
|
);
|
||||||
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
|
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2674,6 +2674,19 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user;
|
||||||
|
|
||||||
|
$sql = 'SELECT COUNT(user_id) AS user_count
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_type = ' . USER_INACTIVE .
|
||||||
|
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '');
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$user_count = (int) $db->sql_fetchfield('user_count');
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if ($offset >= $user_count)
|
||||||
|
{
|
||||||
|
$offset = ($offset - $limit < 0) ? 0 : $offset - $limit;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason
|
$sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason
|
||||||
FROM ' . USERS_TABLE . '
|
FROM ' . USERS_TABLE . '
|
||||||
WHERE user_type = ' . USER_INACTIVE .
|
WHERE user_type = ' . USER_INACTIVE .
|
||||||
|
@ -2706,15 +2719,7 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
|
||||||
$users[] = $row;
|
$users[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(user_id) AS user_count
|
return $offset;
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_type = ' . USER_INACTIVE .
|
|
||||||
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '');
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
$user_count = (int) $db->sql_fetchfield('user_count');
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue