aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-14 12:54:15 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-14 12:54:15 +0000
commit53ab8cf80e4990ac1daf17c7a23931d26110e2f5 (patch)
treebb36b1a57232e43d3f874a09a2e3600af392b853 /pages
parent964aae2967218c594fe5fcbadfdcada731ef2a6e (diff)
downloadelgg-53ab8cf80e4990ac1daf17c7a23931d26110e2f5.tar.gz
elgg-53ab8cf80e4990ac1daf17c7a23931d26110e2f5.tar.bz2
Fixes #2723 members listing pages now in core
git-svn-id: http://code.elgg.org/elgg/trunk@7616 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'pages')
-rw-r--r--pages/members/index.php37
-rw-r--r--pages/members/search.php39
2 files changed, 76 insertions, 0 deletions
diff --git a/pages/members/index.php b/pages/members/index.php
new file mode 100644
index 000000000..82adf2a4a
--- /dev/null
+++ b/pages/members/index.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Members index
+ *
+ */
+
+$num_members = get_number_users();
+
+$title = elgg_echo('members');
+
+$options = array('type' => 'user', 'full_view' => false);
+switch ($vars['page']) {
+ case 'popular':
+ $options['relationship'] = 'friend';
+ $options['inverse_relationship'] = false;
+ $content = elgg_list_entities_from_relationship_count($options);
+ break;
+ case 'online':
+ $content = get_online_users();
+ break;
+ case 'newest':
+ default:
+ $content = elgg_list_entities($options);
+ break;
+}
+
+$params = array(
+ 'content' => $content,
+ 'sidebar' => elgg_view('core/members/sidebar'),
+ 'title' => $title . " ($num_members)",
+ 'buttons' => '',
+ 'filter_override' => elgg_view('core/members/nav', array('selected' => $vars['page'])),
+);
+
+$body = elgg_view_layout('content', $params);
+
+echo elgg_view_page($title, $body);
diff --git a/pages/members/search.php b/pages/members/search.php
new file mode 100644
index 000000000..1a0168660
--- /dev/null
+++ b/pages/members/search.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Members search page
+ *
+ */
+
+if ($vars['search_type'] == 'tag') {
+ $tag = get_input('tag');
+
+ $title = elgg_echo('members:title:searchtag', array($tag));
+ $content = elgg_view_title($title);
+
+ $options = array();
+ $options['query'] = $tag;
+ $options['type'] = "user";
+ $options['offset'] = $offset;
+ $options['limit'] = $limit;
+ $results = elgg_trigger_plugin_hook('search', 'tags', $options, array());
+ $count = $results['count'];
+ $users = $results['entities'];
+ $content .= elgg_view_entity_list($users, $count, $offset, $limit, false, false, true);
+} else {
+ $name = get_input('name');
+
+ $title = elgg_echo('members:title:searchname', array($name));
+ $content = elgg_view_title($title);
+
+ elgg_set_context('search');
+ $content .= list_user_search($name);
+}
+
+$params = array(
+ 'body' => $content,
+ 'sidebar' => elgg_view('core/members/sidebar'),
+);
+
+$body = elgg_view_layout('one_sidebar', $params);
+
+echo elgg_view_page($title, $body);