aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php88
1 files changed, 36 insertions, 52 deletions
diff --git a/index.php b/index.php
index 6ac4ca7a5..708e38ec9 100644
--- a/index.php
+++ b/index.php
@@ -1,52 +1,36 @@
-<?php
- /**
- * tidypics photo gallery main page
- *
- *
- */
-
- include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- //get the owner of the current page
- $owner = page_owner_entity();
-
-
- //if page owner cannot be found, forward to user's pictures instead (or world if not logged in)
- if (is_null($owner->username) || empty($owner->username)) {
- //if not logged in, see world pictures instead
- if (!isloggedin())
- forward('pg/photos/world');
-
- forward('pg/photos/owned/' . $_SESSION['user']->username);
- }
-
- // setup group menu for album index
- if ($owner instanceof ElggGroup) {
- add_submenu_item( sprintf(elgg_echo('album:group'),$owner->name),
- $CONFIG->wwwroot . "pg/photos/owned/" . $owner->username);
- if (can_write_to_container(0, $owner->guid)) {
- add_submenu_item( elgg_echo('album:create'),
- $CONFIG->wwwroot . 'pg/photos/new/' . $owner->username,
- 'tidypics');
- }
- }
-
- //set the title
- $title = sprintf(elgg_echo('album:user'), $owner->name);
- $area2 = elgg_view_title($title);
-
- // Get objects
- set_context('search');
- set_input('search_viewtype', 'gallery');
- if ($owner instanceof ElggGroup)
- $area2 .= list_entities("object", "album", $owner->guid, 10);
- //$area2 .= list_entities_groups("album", 0, $owner->guid, 10);
- else
- $area2 .= list_entities("object", "album", $owner->guid, 10);
-
- set_context('photos');
- $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
-
- // Finally draw the page
- page_draw($title, $body);
-?> \ No newline at end of file
+<?php
+/**
+ * Elgg index page for web-based applications
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+/**
+ * Start the Elgg engine
+ */
+require_once(dirname(__FILE__) . "/engine/start.php");
+
+elgg_set_context('main');
+
+// allow plugins to override the front page (return true to stop this front page code)
+if (elgg_trigger_plugin_hook('index', 'system', null, FALSE) != FALSE) {
+ exit;
+}
+
+if (elgg_is_logged_in()) {
+ forward('activity');
+}
+
+
+$content = elgg_view_title(elgg_echo('content:latest'));
+$content .= elgg_list_river();
+
+$login_box = elgg_view('core/account/login_box');
+
+$params = array(
+ 'content' => $content,
+ 'sidebar' => $login_box
+);
+$body = elgg_view_layout('one_sidebar', $params);
+echo elgg_view_page(null, $body);