aboutsummaryrefslogtreecommitdiff
path: root/mod/members/pages
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 11:32:39 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 11:32:39 +0000
commit3cfad8ca8394976823bbacb728821ca371dfd6d8 (patch)
tree2340be281845fbae688986c7129b84c26e913a0b /mod/members/pages
parentdf9d347e7d5a316a7f5c85ba284ea68c26fe6d2c (diff)
downloadelgg-3cfad8ca8394976823bbacb728821ca371dfd6d8.tar.gz
elgg-3cfad8ca8394976823bbacb728821ca371dfd6d8.tar.bz2
Fixes #3231 welcome back, members plugin
git-svn-id: http://code.elgg.org/elgg/trunk@8895 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/members/pages')
-rw-r--r--mod/members/pages/members/index.php37
-rw-r--r--mod/members/pages/members/search.php44
2 files changed, 81 insertions, 0 deletions
diff --git a/mod/members/pages/members/index.php b/mod/members/pages/members/index.php
new file mode 100644
index 000000000..4f23c6322
--- /dev/null
+++ b/mod/members/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('members/sidebar'),
+ 'title' => $title . " ($num_members)",
+ 'buttons' => '',
+ 'filter_override' => elgg_view('members/nav', array('selected' => $vars['page'])),
+);
+
+$body = elgg_view_layout('content', $params);
+
+echo elgg_view_page($title, $body);
diff --git a/mod/members/pages/members/search.php b/mod/members/pages/members/search.php
new file mode 100644
index 000000000..39b54990e
--- /dev/null
+++ b/mod/members/pages/members/search.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Members search page
+ *
+ */
+
+if ($vars['search_type'] == 'tag') {
+ $tag = get_input('tag');
+
+ $title = elgg_echo('members:title:searchtag', array($tag));
+
+ $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));
+
+ global $CONFIG;
+ $params = array(
+ 'type' => 'user',
+ 'full_view' => false,
+ 'joins' => array("join {$CONFIG->dbprefix}users_entity u on e.guid=u.guid"),
+ 'wheres' => array("(u.name like \"%{$name}%\" or u.username like \"%{$name}%\")"),
+ );
+ $content .= elgg_list_entities($params);
+}
+
+$params = array(
+ 'title' => $title,
+ 'content' => $content,
+ 'sidebar' => elgg_view('members/sidebar'),
+);
+
+$body = elgg_view_layout('one_sidebar', $params);
+
+echo elgg_view_page($title, $body);