function get_links()
 {
     // Loading the Searching data
     if ($this->sort_by == 'alphabetic') {
         $this->sort_by = 'login_name';
         $sorting_direction = 'ASC';
     } else {
         $this->sort_by = 'created';
         $sorting_direction = 'DESC';
     }
     global $network_info;
     $users = array();
     if ($this->search_data) {
         // load users on the basis of the search parameters.
         $users_count = User::user_search($this->search_data, $this->viewer_uid, $network_info->network_id);
         $this->Paging["count"] = $users_count['total_users'];
         $users = User::user_search($this->search_data, $this->viewer_uid, $network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction);
     } else {
         $this->Paging["count"] = Network::get_network_members($network_info->network_id, array('cnt' => TRUE));
         $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction);
         $users = Network::get_network_members($network_info->network_id, $params);
     }
     // echo "<pre>" . print_r($users,1) . "</pre>";
     $this->users_data = $users['users_data'];
 }
 function get_links()
 {
     // Loading the Searching data
     if ($this->sort_by == 'alphabetic') {
         $this->sort_by = 'login_name';
         $sorting_direction = 'ASC';
     } else {
         $this->sort_by = 'created';
         $sorting_direction = 'DESC';
     }
     $this->only_with_photo = !$this->no_photo_ok;
     $extra_condition = null;
     if ($this->only_with_photo) {
         $extra_condition = "U.picture IS NOT NULL";
     }
     $users = array();
     $this->users_data = array();
     if (empty($this->search_data)) {
         $this->search_data = @$this->search;
     }
     if ($this->search_data) {
         // load users on the basis of the search parameters.
         if ($this->only_with_photo) {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, TRUE, 'ALL', 0, 'U.' . $this->sort_by, 'DESC', $extra_condition);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction, $extra_condition);
         } else {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction);
         }
     } else {
         if ($this->only_with_photo) {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE, 'extra_condition' => $extra_condition));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction, 'extra_condition' => $extra_condition);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         } else {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         }
     }
     $users_count = count(@$users['users_data']);
     if ($users_count) {
         $user_profiles = $this->get_profile_data($users['users_data']);
         for ($cnt = 0; $cnt < $users_count; $cnt++) {
             if (empty($users['users_data'][$cnt]['picture'])) {
                 $users['users_data'][$cnt]['picture'] = 'files/default.png';
                 $big_img = uihelper_resize_img($users['users_data'][$cnt]['picture'], 120, 120, NULL, "alt=\"" . $users['users_data'][$cnt]['login_name'] . "\"");
                 $users['users_data'][$cnt]['big_picture'] = $big_img['url'];
             } else {
                 $img = uihelper_resize_mk_user_img($users['users_data'][$cnt]['picture'], 80, 80, 'alt="PA"');
                 $big_img = uihelper_resize_img($users['users_data'][$cnt]['picture'], 120, 120, NULL, "alt=\"" . $users['users_data'][$cnt]['login_name'] . "\"");
                 $users['users_data'][$cnt]['big_picture'] = $big_img['url'];
                 preg_match("/src=\"([^']*?)\"/", $img, $match);
                 //preg_match to get the src of the image
                 $users['users_data'][$cnt]['picture'] = $match[1];
             }
             $users['users_data'][$cnt] = array_merge($users['users_data'][$cnt], $user_profiles[$cnt]);
         }
         $this->users_data = $users['users_data'];
     }
 }
 function get_links()
 {
     // Loading the Searching data
     if ($this->sort_by == 'alphabetic') {
         $this->sort_by = 'login_name';
         $sorting_direction = 'ASC';
     } else {
         $this->sort_by = 'display_name';
         $sorting_direction = 'ASC';
     }
     $this->only_with_photo = !$this->no_photo_ok;
     $extra_condition = null;
     if ($this->only_with_photo) {
         $extra_condition = "U.picture IS NOT NULL";
     }
     $users = array();
     $this->users_data = array();
     if (empty($this->search_data)) {
         $this->search_data = @$this->search;
     }
     if ($this->search_data) {
         // load users on the basis of the search parameters.
         if ($this->only_with_photo) {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, TRUE, 'ALL', 0, 'U.' . $this->sort_by, 'DESC', $extra_condition);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction, $extra_condition);
         } else {
             $users_count = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE);
             $this->Paging["count"] = $users_count['total_users'];
             $users = User::user_search($this->search_data, $this->viewer_uid, PA::$network_info->network_id, FALSE, $this->Paging["show"], $this->Paging["page"], 'U.' . $this->sort_by, $sorting_direction);
         }
     } else {
         if ($this->only_with_photo) {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE, 'extra_condition' => $extra_condition));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction, 'extra_condition' => $extra_condition);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         } else {
             $this->Paging["count"] = Network::get_network_members(PA::$network_info->network_id, array('cnt' => TRUE));
             $params = array('page' => $this->Paging["page"], 'show' => $this->Paging["show"], 'sort_by' => $this->sort_by, 'direction' => $sorting_direction);
             $users = Network::get_network_members(PA::$network_info->network_id, $params);
         }
     }
     // Parag Jagdale - 10-17-10:	Modified to support new avatar image URL, width and height
     $users_count = count(@$users['users_data']);
     $users_to_show = array();
     if ($users_count) {
         $user_profiles = $this->get_profile_data($users['users_data']);
         for ($cnt = 0; $cnt < $users_count; $cnt++) {
             $userCreatedDate = $users['users_data'][$cnt]['created'];
             $userLoginDate = $users['users_data'][$cnt]['last_login'];
             if ($userCreatedDate != $userLoginDate) {
                 if (!isset($user_profiles[$cnt]['avatar']) || empty($user_profiles[$cnt]['avatar'])) {
                     $users['users_data'][$cnt]['avatar'] = PA::$url . '/files/default.png';
                     $big_img['url'] = PA::$url . '/files/default.png';
                     $users['users_data'][$cnt]['big_picture'] = $big_img['url'];
                 } else {
                     if (preg_match("|^http://|", $user_profiles[$cnt]['avatar'])) {
                         $users['users_data'][$cnt]['big_picture'] = $user_profiles[$cnt]['avatar'];
                         $users['users_data'][$cnt]['big_picture_width'] = $user_profiles[$cnt]['avatar_width'];
                         $users['users_data'][$cnt]['big_picture_height'] = $user_profiles[$cnt]['avatar_height'];
                     } else {
                         $amazon_full_url = get_full_amazon_s3_url($user_profiles[$cnt]['avatar']);
                         $users['users_data'][$cnt]['big_picture'] = $amazon_full_url;
                     }
                 }
                 $users_to_show['users_data'][$cnt] = array_merge($user_profiles[$cnt], $users['users_data'][$cnt]);
             }
         }
         $this->users_data = $users_to_show['users_data'];
     }
 }