Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. protected function _getNotableMembers($type, $limit)
  2.     {
  3.         $userModel = $this->_getUserModel();
  4.  
  5.         $notableCriteria = array(
  6.             'is_banned' => 0
  7.         );
  8.         if ($type == 'equipe')
  9.         {
  10.             $notableCriteria['user_group_id'] = array(15,14,13,12,11);
  11.         }
  12.         $typeMap = array(
  13.             'messages' => 'message_count',
  14.             'likes' => 'like_count',
  15.             'equipe' => 'user_group_id'
  16.         );
  17.         if (XenForo_Application::getOptions()->enableTrophies)
  18.         {
  19.             $typeMap['points'] = 'trophy_points';
  20.         }
  21.  
  22.         if (!isset($typeMap[$type]))
  23.         {
  24.             return false;
  25.         }
  26.  
  27.         $field = $typeMap[$type];
  28.  
  29.         if ($type != 'equipe'){
  30.             $notableCriteria[$field] = array('>', 0);
  31.         }
  32.        
  33.        
  34.  
  35.         return array($userModel->getUsers($notableCriteria, array(
  36.             'join' => XenForo_Model_User::FETCH_USER_FULL,
  37.             'limit' => $limit,
  38.             'order' => $field,
  39.             'direction' => ($type == 'equipe' ? 'asc' : 'desc'),
  40.             'direction' => 'desc'
  41.         )), $typeMap[$type]);
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement