$tag = get_input('tag');
//search members
$sidebar = elgg_view("members/search");
// get the correct content based on filter/search
switch ($filter) {
    case "pop":
        $filter_content = list_entities_by_relationship_count('friend', true, '', '', 0, 10, false);
        break;
    case "active":
        $filter_content = elgg_view("members/online");
        break;
        // search based on name
    // search based on name
    case "search":
        set_context('search');
        $filter_content = list_user_search($tag);
        break;
        // search based on tags
    // search based on tags
    case "search_tags":
        $filter_content = trigger_plugin_hook('search', '', $tag, "");
        $filter_content .= list_entities_from_metadata("", $tag, "user", "", "", 10, false, false);
        break;
    case "newest":
    case 'default':
        $filter_content = elgg_list_entities(array('type' => 'user', 'offset' => $offset, 'full_view' => FALSE));
        break;
}
// create the members navigation/filtering
$members = get_number_users();
$members_nav = elgg_view("members/members_sort_menu", array("count" => $members, "filter" => $filter));
/**
 * Generic search viewer
 * Given a GUID, this page will try and display any entity
 * 
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */
// Load Elgg engine
require_once 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('users:searchtitle'), $tag);
    $body = "";
    $body .= elgg_view_title($title);
    // elgg_view_title(sprintf(elgg_echo('searchtitle'),$tag));
    $body .= elgg_view('user/search/startblurb', array('tag' => $tag));
    $body .= list_user_search($tag);
    //$body = elgg_view_layout('two_column_left_sidebar','',$body);
} else {
    $title = elgg_echo('item:user');
    $body .= elgg_view_title($title);
    $body .= list_entities('user');
}
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
page_draw($title, $body);
Exemple #3
0
    case "newest":
        if (!isadminloggedin()) {
            $content .= list_entities_from_metadata("validated", "1", "user", "", "", 10, false, false);
        } else {
            $content = list_entities("user", "", 0, 10, false);
        }
        break;
    case "pop":
        $content = list_entities_by_relationship_count('friend', true);
        break;
    case "active":
        $content = elgg_view("members/online");
        break;
    case "search":
        set_context('search');
        $content = list_user_search($tag);
        break;
    case "search_tags":
        //$content = trigger_plugin_hook('search','',$tag,"");
        $content .= list_entities_from_metadata("", $tag, "user", "", "", 10, false, false);
        $members = get_entities_from_metadata("", $tag, "user", "", 0, 1000, 0, '', 0, true, false);
        break;
    case 'default':
        $content = list_entities("user", "", 0, 10, false, true);
        break;
}
$area2 .= elgg_view('page_elements/contentwrapper', array('body' => elgg_view("members/members_sort_menu", array("count" => $members, "filter" => $filter)) . $content, 'subclass' => 'members'));
//select the correct canvas area
$body = elgg_view_layout("sidebar_boxes", $area1, $area2);
// Display page
page_draw(sprintf(elgg_echo('members:members'), $page_owner->name), $body);
Exemple #4
0
            $html = elgg_echo('content:search:no-result');
        }
        $pagination = display_pager($current_page, $number_of_results, $page_size, '?tag=' . $tag . '&searchType=' . $searchType);
        $results_found_message = '';
        if ($number_of_results) {
            $results_found_message = elgg_echo('content:search:results-found') . $number_of_results;
        }
        $body = $pagination . $html . $pagination . $results_found_message;
    } else {
        if ($searchType == 'users') {
            $tag = get_input('tag');
            $objecttype = 'user';
            $title = 'users';
            // $pagination = display_pager($current_page, $number_of_results, $page_size, '?tag=' . $tag . '&searchType=' . $searchType);
            if (!empty($tag)) {
                $body = list_user_search($tag, $page_size);
            }
        } elseif ($searchType == 'tags') {
            if (!empty($tag)) {
                $body = "";
                //$meta_name, $meta_value = "", $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
                $body .= list_entities_from_metadata('tags', $tag, $objecttype, $subtype, $owner_guid_array, $page_size, false, false, true);
            }
        }
    }
} else {
    $body = elgg_echo(empty($tag) ? 'content:search:no-result' : 'content:search:too-short');
}
//$body = $body;
$body = elgg_view_layout('two_column_left_sidebar', '', $body);
page_draw(elgg_echo('search'), $body);