diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-04 15:10:54 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-04-04 15:10:54 +0000 |
commit | e1fb557e88e9cb763f9f1006b80bf52756d62386 (patch) | |
tree | 6ed0b78fa51113a881c1d8ef35a297f4102c21be /mod | |
parent | 8d001be6fbce495a541175e5c430813fc5f7ccbb (diff) | |
download | elgg-e1fb557e88e9cb763f9f1006b80bf52756d62386.tar.gz elgg-e1fb557e88e9cb763f9f1006b80bf52756d62386.tar.bz2 |
Introducing the all blog posts page.
git-svn-id: https://code.elgg.org/elgg/trunk@404 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/everyone.php | 23 | ||||
-rw-r--r-- | mod/blog/index.php | 4 | ||||
-rw-r--r-- | mod/blog/languages/en.php | 1 | ||||
-rw-r--r-- | mod/blog/start.php | 1 |
4 files changed, 29 insertions, 0 deletions
diff --git a/mod/blog/everyone.php b/mod/blog/everyone.php new file mode 100644 index 000000000..a97733c46 --- /dev/null +++ b/mod/blog/everyone.php @@ -0,0 +1,23 @@ +<?php
+
+ /**
+ * Elgg view all blog posts from all users page
+ *
+ * @package ElggBlog
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Ben Werdmuller <ben@curverider.co.uk>
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ // Load Elgg engine
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+ if ($blogposts = get_entities('object','blog')) {
+ $body = elgg_view("blog/view",array('posts' => $blogposts));
+ }
+
+ // Display page
+ page_draw(elgg_echo('blog:everyone'),$body);
+
+?>
\ No newline at end of file diff --git a/mod/blog/index.php b/mod/blog/index.php index 23ccb9dcb..b7f1912f6 100644 --- a/mod/blog/index.php +++ b/mod/blog/index.php @@ -15,6 +15,10 @@ // Get the current page's owner
$page_owner = page_owner_entity();
+ if ($page_owner === false || is_null($page_owner)) {
+ $page_owner = $_SESSION['user'];
+ set_page_owner($page_owner->getGUID());
+ }
// Get any blog posts to display
$posts = $page_owner->getObjects('blog');
diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php index dbccfd98d..f534f2b01 100644 --- a/mod/blog/languages/en.php +++ b/mod/blog/languages/en.php @@ -9,6 +9,7 @@ 'blog' => "Blog",
'blog:user' => "%s's blog",
'blog:posttitle' => "%s's blog: %s",
+ 'blog:everyone' => "All blog posts",
'blog:read' => "Read blog",
diff --git a/mod/blog/start.php b/mod/blog/start.php index bd9dac913..d7def030d 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -33,6 +33,7 @@ add_menu(elgg_echo('blog'), $CONFIG->wwwroot . "mod/blog/",array(
menu_item(elgg_echo('blog:read'),$CONFIG->wwwroot."mod/blog/?username=" . $_SESSION['user']->username),
menu_item(elgg_echo('blog:addpost'),$CONFIG->wwwroot."mod/blog/add.php"),
+ menu_item(elgg_echo('blog:everyone'),$CONFIG->wwwroot."mod/blog/everyone.php"),
));
}
|