From 5eaed810d1e3b194dd01860d9ca4c86dbc50717e Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 15 Apr 2010 21:48:24 +0000 Subject: Added usage to the keywords. Restricting keywords to userlist, loginbox, and sitestats to custom front page. git-svn-id: http://code.elgg.org/elgg/trunk@5756 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../default/sitepages/keywords/site_stats.php | 12 ------ .../views/default/sitepages/keywords/sitestats.php | 12 ++++++ .../views/default/sitepages/keywords/user_list.php | 47 ---------------------- .../views/default/sitepages/keywords/userlist.php | 47 ++++++++++++++++++++++ 4 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 mod/sitepages/views/default/sitepages/keywords/site_stats.php create mode 100644 mod/sitepages/views/default/sitepages/keywords/sitestats.php delete mode 100644 mod/sitepages/views/default/sitepages/keywords/user_list.php create mode 100644 mod/sitepages/views/default/sitepages/keywords/userlist.php (limited to 'mod/sitepages/views/default') diff --git a/mod/sitepages/views/default/sitepages/keywords/site_stats.php b/mod/sitepages/views/default/sitepages/keywords/site_stats.php deleted file mode 100644 index 8ccb96794..000000000 --- a/mod/sitepages/views/default/sitepages/keywords/site_stats.php +++ /dev/null @@ -1,12 +0,0 @@ - 'user', - 'limit' => $limit -); - -if ($only_with_avatars == TRUE) { - $options['metadata_name_value_pairs'] = array('name' => 'icontime', 'operand' => '!=', 'value' => 0); -} - -switch ($list_type) { - case 'new': - $options['order_by'] = 'e.time_created DESC'; - break; - - case 'online': - // show people with a last action of < 10 minutes. - $last_action = time() - 10 * 60; - $options['joins'] = array("JOIN {$vars['config']->dbprefix}users_entity ue on ue.guid = e.guid"); - $options['wheres'] = array("ue.last_action > $last_action"); - break; - - case 'random': - $options['order_by'] = 'RAND()'; - break; - - default: - break; -} - -$users = elgg_get_entities_from_metadata($options); - -echo elgg_view_entity_list($users, count($users), 0, $limit, FALSE, FALSE, FALSE); \ No newline at end of file diff --git a/mod/sitepages/views/default/sitepages/keywords/userlist.php b/mod/sitepages/views/default/sitepages/keywords/userlist.php new file mode 100644 index 000000000..0961cb682 --- /dev/null +++ b/mod/sitepages/views/default/sitepages/keywords/userlist.php @@ -0,0 +1,47 @@ + 'user', + 'limit' => $limit +); + +if ($only_with_avatars == TRUE) { + $options['metadata_name_value_pairs'] = array('name' => 'icontime', 'operand' => '!=', 'value' => 0); +} + +switch ($list_type) { + case 'new': + $options['order_by'] = 'e.time_created DESC'; + break; + + case 'online': + // show people with a last action of < 10 minutes. + $last_action = time() - 10 * 60; + $options['joins'] = array("JOIN {$vars['config']->dbprefix}users_entity ue on ue.guid = e.guid"); + $options['wheres'] = array("ue.last_action > $last_action"); + break; + + case 'random': + $options['order_by'] = 'RAND()'; + break; + + default: + break; +} + +$users = elgg_get_entities_from_metadata($options); + +echo elgg_view_entity_list($users, count($users), 0, $limit, FALSE, FALSE, FALSE); \ No newline at end of file -- cgit v1.2.3