aboutsummaryrefslogtreecommitdiff
path: root/mod/custom_index/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/custom_index/index.php')
-rw-r--r--mod/custom_index/index.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/mod/custom_index/index.php b/mod/custom_index/index.php
new file mode 100644
index 000000000..43cab9723
--- /dev/null
+++ b/mod/custom_index/index.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Elgg custom index page
+ *
+ */
+
+elgg_push_context('front');
+
+elgg_push_context('widgets');
+
+$list_params = array(
+ 'type' => 'object',
+ 'limit' => 4,
+ 'full_view' => false,
+ 'view_type_toggle' => false,
+ 'pagination' => false,
+);
+
+//grab the latest 4 blog posts
+$list_params['subtype'] = 'blog';
+$blogs = elgg_list_entities($list_params);
+
+//grab the latest bookmarks
+$list_params['subtype'] = 'bookmarks';
+$bookmarks = elgg_list_entities($list_params);
+
+//grab the latest thewire
+$list_params['subtype'] = 'thewire';
+$thewire = elgg_list_entities($list_params);
+
+//grab the latest files
+$list_params['subtype'] = 'file';
+$files = elgg_list_entities($list_params);
+
+//get the newest members who have an avatar
+$newest_members = elgg_list_entities_from_metadata(array(
+ 'metadata_names' => 'icontime',
+ 'type' => 'user',
+ 'limit' => 10,
+ 'full_view' => false,
+ 'pagination' => false,
+ 'list_type' => 'gallery',
+ 'gallery_class' => 'elgg-gallery-users',
+ 'size' => 'small',
+));
+
+//newest groups
+$list_params['type'] = 'group';
+unset($list_params['subtype']);
+$groups = elgg_list_entities($list_params);
+
+//grab the login form
+$login = elgg_view("core/account/login_box");
+
+elgg_pop_context();
+
+// lay out the content
+$params = array(
+ 'blogs' => $blogs,
+ 'bookmarks' => $bookmarks,
+ 'files' => $files,
+ 'groups' => $groups,
+ 'login' => $login,
+ 'members' => $newest_members,
+ 'thewire' => $thewire,
+);
+$body = elgg_view_layout('custom_index', $params);
+
+// no RSS feed with a "widget" front page
+global $autofeed;
+$autofeed = FALSE;
+
+echo elgg_view_page('', $body);