Resource icon

[RAID101.com] Member List Manager 2.0

No permission to download
Don't know, but it really works with no problems for me and have it installed since I installed my XF 1.2.0 and have almost 40 add-ons now.
 
Hi there,

Today I noticed this add-on triggers a fatal error if for some reason XenForo_Model_User is requested before front_controller_pre_dispatch is called. In that situation, the controller is extended but the model is not extended and will cause issue. I think you should extend the model all the time.
 
i am getting some issues with this add one relating freddyshouse two factor authentication

http://xenforo.com/community/threads/freddyshouse-two-factor-authentication.47903/page-5

here are my last 2 quotes i have found the line that causes the error but unsure how to fix it
this error is starting to get really annoying:
5NsBn.png
well i traced the error to Member.php file i found:

Code:
<?php
class SortMem_ControllerPublic_Member extends XFCP_SortMem_ControllerPublic_Member
{
    public function actionIndex()
    {      
        $options = Xenforo_Application::get('options');
        $visitor = XenForo_Visitor::getInstance();
        $userModel = $this->_getUserModel();
        $usergroups = XenForo_Model::create('SortMem_Model_UserGroups');
        $sortables = Xenforo_Application::getSimpleCacheData('sort_mem_sortables');
      
        $userId = $this->_input->filterSingle('user_id', XenForo_Input::UINT);
        $ordermem = $this->_request->getParam('sort');
        $directmem = $this->_request->getParam('dir');
        $userfilter = array();
        $userfilter = $this->_request->getParam('userfilter');
        $defaultOrder = $options->sort_default_order;
        $defaultDir = $options->sort_default_direct;
        $canUseFilter = $visitor->hasPermission('general', 'CanFilterUsersSortMem');
      
        if ($userId)
        {
            return $this->responseReroute('XenForo_ControllerPublic_Member','member');
        }
        else if ($this->_input->inRequest('user_id'))
        {
            return $this->responseError(new XenForo_Phrase('posted_by_guest_no_profile'));
        }

        $username = $this->_input->filterSingle('username', XenForo_Input::STRING);
        if ($username !== '')
        {
            $user = $userModel->getUserByName($username);
            if ($user)
            {
                return $this->responseRedirect(
                    XenForo_ControllerResponse_Redirect::SUCCESS,
                    XenForo_Link::buildPublicLink('members', $user)
                );
            }
            else
            {
                $userNotFound = true;
            }
        }
        else
        {
            $userNotFound = false;
        }

        $page = $this->_input->filterSingle('page', XenForo_Input::UINT);
        $usersPerPage = XenForo_Application::get('options')->membersPerPage;
      
        $criteria = array(
                'user_state' => 'valid',
                'is_banned' => 0
            );
      
        $canUseSortCriteria = 0;
        foreach ($sortables AS &$sortcriteria){
            $sortcriteria['sort_phrase'] = new XenForo_Phrase($sortcriteria['sort_phrase']);
            $sortcriteria['show_phrase'] = new XenForo_Phrase($sortcriteria['show_phrase']);
            if(($ordermem == $sortcriteria['title']) && $sortcriteria['enable_sort'])
                $canUseSortCriteria = 1;
            $sortcriteria['column'] = explode('.', $sortcriteria['sort_column']);
        }
        if(!$canUseSortCriteria)
            $ordermem = '';
          
        if (($visitor->get('is_admin') && $options->sort_view_admin) OR ($visitor->get('is_moderator') && $options->sort_view_mod))
        {
            $groups = ($usergroups);
          
            if($userfilter)
                $groupscrit = $userfilter;
            else
                $groupscrit = '';
        }
        else
        {
            if($options->sort_filter_banned == 1)
            {
                $criteria['is_banned'] = 1;
            }
          
            if($options->SortMem_usergroups_user && $options->SortMem_usergroups)
                $groupschoose = array_intersect($options->SortMem_usergroups_user,$options->SortMem_usergroups);
            else
                $groupschoose = $options->SortMem_usergroups_user;          
          
            if($groupschoose)
                $groups = ($usergroups->get_user_groups($userfilter,$groupschoose));
            else
                $groups = array();
          
            if($userfilter && $canUseFilter)
                $groupscrit = array_intersect($userfilter,$options->SortMem_usergroups_user);
            else
                $groupscrit = $options->SortMem_usergroups;
          
          
          
            if (!$groupscrit)
                $groupscrit = $options->SortMem_usergroups;
              
            if($options->sort_filter_admins == 1)
            {
                $criteria['is_admin'] = 0;
            }
          
            if($options->sort_filter_mods == 1)
            {
                $criteria['is_moderator'] = 0;
            }
        }

        $criteria['user_group_id'] = $groupscrit;

        $criteria['secondary_group_ids'] = $groupscrit;
      
        if(!$ordermem && !$directmem){
            foreach ($sortables AS &$sortcriteria){
                if ($sortcriteria['is_default']){
                    $ordermem =  $sortcriteria['title'];
                    $directmem = $sortcriteria['default_order'];
                }
            }
          
        }
        elseif(!$directmem){
            foreach ($sortables AS &$sortcriteria){
                if ($sortcriteria['title'] == $ordermem){
                    $directmem = $sortcriteria['default_order'];
                }
            }
          
        }
              
        // users for the member list
        $users = $userModel->getUsersSM($criteria, array(
            'join' => XenForo_Model_User::FETCH_USER_FULL,
            'perPage' => $usersPerPage,
            'page' => $page,
            'order' => $ordermem,
            'direction' => $directmem
        ));

        // most recent registrations
        $latestUsers = $userModel->getLatestUsersSM($criteria, array('limit' => $options->sort_mlu));

        // most active users (highest post count)
        $activeUsers = $userModel->getMostActiveUsersSM($criteria, array('limit' => $options->sort_mau));
      
        $pageNavParams['sort'] = $ordermem;
        $pageNavParams['dir'] = $directmem;
        $pageNavParams['userfilter'] = $userfilter;
      
        $viewParams = array(
            'users' => $users,

            'totalUsers' => $userModel->countUsersSM($criteria),
            'page' => $page,
            'usersPerPage' => $usersPerPage,
            'ordermem' => $ordermem,
            'directmem' => $directmem,
            'pageNavParams' => $pageNavParams,

            'latestUsers' => $latestUsers,
            'activeUsers' => $activeUsers,

            'userNotFound' => $userNotFound,
            'groups' => $groups,
            'userfilter' => $userfilter,
            'canUseFilter' => $canUseFilter,
            'sortables' => $sortables
        );

        return $this->responseView('XenForo_ViewPublic_Member_List', 'member_list', $viewParams);
    }
  
    protected function _getUserModel()
    {
        return $this->getModelFromCache('XenForo_Model_User');
    }
}

where:
// users for the member list
$users = $userModel->getUsersSM($criteria, array(
'join' => XenForo_Model_User::FETCH_USER_FULL,
'perPage' => $usersPerPage,
'page' => $page,
'order' => $ordermem,
'direction' => $directmem

the error occurs more specifically $users = $userModel->getUsersSM($criteria, array(
line

i am no xenforo coder but the error lies in here not sure how to fix it though
File location library/SortMem/ControllerPublic/Member.php
 
please man fix your add on now i am getting errors with it again:


Fatal error: Call to undefined method FreddysHouse_TwoFactor_Model_User::getUsersSM() in /home/unkn0wn/public_html/forums/library/SortMem/ControllerPublic/Member.php on line 140
 
Does anyone know how to make it show in order of most 'likes' by default?

EDIT: Sorry, I see how now
 
Last edited:
Excellent add-on, Moz, very useful indeed. :D

A couple of things I've noticed is that if the Registration Date is set to show then it appears blank for all users. If the Last Activity is set to show then it displays in Unix time rather than 'proper' time.

View attachment 43603

Any possibility of a fix for these, please?
Hi Martok,

Don't think you got a response for this, did you end up getting it fixed? If so, how? I'm getting the same thing on my forum. Also the registration date is missing like yours is. :\
 
Hi Martok,

Don't think you got a response for this, did you end up getting it fixed? If so, how? I'm getting the same thing on my forum. Also the registration date is missing like yours is. :\
It wasn't fixed and I no longer use this add-on.
 
Top Bottom