Skip to content

Commit

Permalink
Reduce memory usage when viewing a specific flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcgirr83 committed Jul 5, 2020
1 parent 2c34c21 commit 4de7480
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controller/main_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public function getFlags($flag_id, $page = 0)
protected function display_flag($flag_id, $start, $limit)
{
// Get users that have the flag
$sql = 'SELECT *
$sql = 'SELECT user_regdate, user_lastvisit, username, user_colour, user_posts, user_id
FROM ' . USERS_TABLE . '
WHERE user_flag = ' . (int) $flag_id . '
AND ' . $this->db->sql_in_set('user_type', array(USER_NORMAL, USER_FOUNDER)) . '
Expand Down
4 changes: 2 additions & 2 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public function __construct(
static public function getSubscribedEvents()
{
return array(
'core.common' => 'common',
'core.user_setup' => 'user_setup',
'core.user_setup_after' => 'user_setup_after',
'core.index_modify_page_title' => 'index_modify_page_title',
'core.page_header_after' => 'page_header_after',
'core.ucp_profile_modify_profile_info' => 'user_flag_profile',
Expand Down Expand Up @@ -143,7 +143,7 @@ static public function getSubscribedEvents()
* @return null
* @access public
*/
public function common($event)
public function user_setup_after($event)
{
$this->nationalflags->build_users_and_flags();
}
Expand Down

0 comments on commit 4de7480

Please sign in to comment.