/** * Returns a formatted list of users suitable for injecting into search. * */ function search_list_users_by_name($hook, $user, $returnvalue, $tag) { // Change this to set the number of users that display on the search page $threshold = 4; $object = get_input('object'); if (!get_input('offset') && (empty($object) || $object == 'user')) { if ($users = search_for_user($tag, $threshold)) { $countusers = search_for_user($tag, 0, 0, "", true); $return = elgg_view('user/search/startblurb', array('count' => $countusers, 'tag' => $tag)); foreach ($users as $user) { $return .= elgg_view_entity($user); } $return .= elgg_view('user/search/finishblurb', array('count' => $countusers, 'threshold' => $threshold, 'tag' => $tag)); return $return; } } }
* @package Elgg * @subpackage Core * @author Curverider Ltd * @link http://elgg.org/ */ // Load Elgg engine require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; // Set context set_context('search'); // Get input $tag = stripslashes(get_input('tag')); if (!empty($tag)) { $title = sprintf(elgg_echo('content_item:content_search_title'), $tag); $body = ""; $body .= elgg_view_title($title); // elgg_view_title(sprintf(elgg_echo('searchtitle'),$tag)); $body .= elgg_view('user/search/startblurb', array('tag' => $tag)); $offset = (int) get_input('offset'); $limit = 50; $count = (int) search_for_user($tag, 50, 0, '', true); $entities = search_for_user($tag, $limit, $offset); $body .= elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, false); /// The above code instead of the line below //$body .= list_user_search($tag); } else { $title = elgg_echo('item:user'); $body .= elgg_view_title($title); $body .= list_entities('user'); } $body = elgg_view_layout('one_column', $body); page_draw($title, $body);
Foobar is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with groups-invite-any. If not, see <http://www.gnu.org/licenses/>. */ gatekeeper(); action_gatekeeper(); $group = get_entity(get_input('entity')); set_page_owner($group->getGUID()); set_context('groups'); $name = get_input('name'); if ($name) { $users = search_for_user($name, get_plugin_setting('maxusers', 'groupsfrommembers')); $nusers = search_for_user($name, 0, 0, '', true); } $title = elgg_echo("groups:invite"); $area2 = elgg_view_title($title); $context = get_context(); set_context('groupsfrommembers'); if ($group && $group->canEdit()) { $area2 .= elgg_view('forms/groups/invite', array('entity' => $group, 'users' => $users, 'nusers' => $nusers)); } else { $area2 .= elgg_echo("groups:noaccess"); } set_context($context); $body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); page_draw($title, $body);
} } //get filter $limit = get_input('limit', 20); $offset = get_input('offset', 0); $filter = get_input("filter"); if (!$filter) { $filter = "newest"; } // search options $tag = get_input('tag'); //search members $area1 = elgg_view("members/search"); //user name search if ($search_name) { $area1 .= search_for_user($search_name, $limit, 0, "", false); } //user search on tag if ($search_tag) { $area1 .= list_user_search($search_tag, $limit); } // count members $members = get_number_users(); // title $area2 = elgg_view_title(elgg_echo("members:members")); //get the correct view based on filter switch ($filter) { case "newest": if (!isadminloggedin()) { $content .= list_entities_from_metadata("validated", "1", "user", "", "", 10, false, false); } else {