aboutsummaryrefslogtreecommitdiff
path: root/mod/blog
diff options
context:
space:
mode:
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-09 09:39:34 +0000
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-09 09:39:34 +0000
commitff4779ddb3ef005553187e4486d4d775220d8b8f (patch)
tree7765c79ad2cffd028dd5da9d1db68ca176faf9a3 /mod/blog
parent9bb993778bc7a0c6f17673e509ed147202e69ee7 (diff)
downloadelgg-ff4779ddb3ef005553187e4486d4d775220d8b8f.tar.gz
elgg-ff4779ddb3ef005553187e4486d4d775220d8b8f.tar.bz2
Updated new page canvases (and calls to elgg_view_layout) so that empty vars are not required.
git-svn-id: http://code.elgg.org/elgg/trunk@5316 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog')
-rw-r--r--mod/blog/all.php39
-rw-r--r--mod/blog/archive.php106
-rw-r--r--mod/blog/everyone.php2
-rw-r--r--mod/blog/friends.php86
-rw-r--r--mod/blog/index.php108
-rw-r--r--mod/blog/preview.php88
-rw-r--r--mod/blog/read.php123
-rw-r--r--mod/blog/shared.php59
8 files changed, 356 insertions, 255 deletions
diff --git a/mod/blog/all.php b/mod/blog/all.php
new file mode 100644
index 000000000..ab1832d99
--- /dev/null
+++ b/mod/blog/all.php
@@ -0,0 +1,39 @@
+<?php
+
+ /**
+ * Elgg view all blog posts from all users page
+ */
+
+ // Load Elgg engine
+ define('everyoneblog','true');
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+ // Get the current page's owner
+ $page_owner = $_SESSION['user'];
+ set_page_owner($_SESSION['guid']);
+
+ //set blog title
+ //$area1 = elgg_view('blog/blog_header', array('context' => "everyone", 'type' => 'blog'));
+ set_context('search');
+ $area2 .= "<div id='blogs'>" . list_entities('object','blog',0,10,false) . "<div class='clearfloat'></div></div>";
+ set_context('blog');
+
+ // Get categories, if they're installed
+ global $CONFIG;
+ //$area3 = elgg_view('blog/categorylist',array('baseurl' => $CONFIG->wwwroot . 'search/?subtype=blog&tagtype=universal_categories&tag=','subtype' => 'blog'));
+ //include a view for plugins to extend
+ //$area3 .= elgg_view("blogs/favourite", array("object_type" => 'blog'));
+ //get the latest comments on all blogs
+ $comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc");
+ //$area3 .= elgg_view('page_elements/latest_comments', array('comments' => $comments));
+ //include a view for plugins to extend
+ //$area3 .= elgg_view("blogs/sidebar_options", array("object_type" => 'blog'));
+
+ $area3 .= elgg_view('blog/stats');
+
+ $body = elgg_view_layout("one_column_with_sidebar", $area1.$area2, $area3);
+
+ // Display page
+ page_draw(elgg_echo('blog:all'),$body);
+
+?> \ No newline at end of file
diff --git a/mod/blog/archive.php b/mod/blog/archive.php
index a1a6a528e..9648c75c0 100644
--- a/mod/blog/archive.php
+++ b/mod/blog/archive.php
@@ -1,50 +1,56 @@
-<?php
-
- /**
- * Elgg blog archive page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // 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($_SESSION['guid']);
- }
-
- // Get timestamp upper and lower bounds
- $timelower = (int) get_input('param2');
- $timeupper = (int) get_input('param3');
- if (empty($timelower)) {
- forward('pg/blog/'.$page_owner->username);
- exit;
- }
- if (empty($timeupper)) {
- $timeupper = $timelower + (86400 * 30);
- }
-
- // Set blog title
- $area2 = elgg_view_title(sprintf(elgg_echo('date:month:'.date('m',$timelower)),date('Y',$timelower)));
-
- // Get a list of blog posts
- $area2 .= list_user_objects($page_owner->getGUID(),'blog',10,false,false,true,$timelower,$timeupper);
-
- // Get blog tags
-
- // Get blog categories
-
- // Display them in the page
- $body = elgg_view_layout("two_column_left_sidebar", '', $area1 . $area2);
-
- // Display page
- page_draw(sprintf(elgg_echo('blog:user'),$page_owner->name),$body);
-
-?> \ No newline at end of file
+<?php
+
+/**
+ * Elgg blog archive page
+ */
+
+// Load Elgg engine
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+// 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($_SESSION['guid']);
+}
+//set breadcrumbs if in a group
+//$area1 = elgg_view('elggcampus_layout/breadcrumbs_general', array('object_type' => 'blog'));
+// Get timestamp upper and lower bounds
+$timelower = (int) get_input('param2');
+$timeupper = (int) get_input('param3');
+if (empty($timelower)) {
+ forward('pg/blog/'.$page_owner->username);
+ exit;
+}
+if (empty($timeupper)) {
+ $timeupper = $timelower + (86400 * 30);
+}
+
+// Set blog title
+$area2 = elgg_view_title(sprintf(elgg_echo('date:month:'.date('m',$timelower)),date('Y',$timelower)));
+
+set_context('search');
+// Get a list of blog posts
+$blogs = list_user_objects($page_owner->getGUID(),'blog',10,false,false,true,$timelower,$timeupper);
+$area2 .= "<div id=\"blogs\">" . $blogs . "<div class='clearfloat'></div></div>";
+set_context('blog');
+
+///if the logged in user is not looking at their stuff, display the ownerblock otherwise
+//show the users favourites
+if(page_owner() != get_loggedin_user()->guid){
+ $area3 = elgg_view('blog/ownerblock');
+}
+
+//get the latest comments on user's blog posts
+$comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc",0,0,page_owner());
+$area3 .= elgg_view('elggcampus_layout/latest_comments', array('comments' => $comments));
+//a view for the favourites plugin to extend
+$area3 .= elgg_view("blogs/sidebar_options", array("object_type" => 'blog'));
+//display archive
+$area3 .= elgg_view("blog/archive");
+
+// Display them in the page
+$body = elgg_view_layout("one_column_with_sidebar", $area1 . $area2, $area3);
+
+// Display page
+page_draw(sprintf(elgg_echo('blog:user'),$page_owner->name),$body); \ No newline at end of file
diff --git a/mod/blog/everyone.php b/mod/blog/everyone.php
index 47d22f35b..9270b33a6 100644
--- a/mod/blog/everyone.php
+++ b/mod/blog/everyone.php
@@ -29,7 +29,7 @@
global $CONFIG;
$area3 = elgg_view('blog/categorylist',array('baseurl' => $CONFIG->wwwroot . 'search/?subtype=blog&tagtype=universal_categories&tag=','subtype' => 'blog'));
- $body = elgg_view_layout("two_column_left_sidebar", '', $area2, $area3);
+ $body = elgg_view_layout("one_column_with_sidebar", $area2, $area3);
// Display page
page_draw(elgg_echo('blog:everyone'),$body);
diff --git a/mod/blog/friends.php b/mod/blog/friends.php
index 2cef9c9e8..24aa36c8b 100644
--- a/mod/blog/friends.php
+++ b/mod/blog/friends.php
@@ -1,47 +1,41 @@
-<?php
-
- /**
- * Elgg blog friends page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- define('everyoneblog','true');
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // 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($_SESSION['guid']);
- }
- if (!($page_owner instanceof ElggEntity)) forward();
-
- //set the title
- if($page_owner == $_SESSION['user']){
- $title = elgg_echo('blog:yourfriends');
- }else{
- $title = $page_owner->name . "'s " . elgg_echo('blog:friends');
- }
-
- $area2 = elgg_view_title($title);
-
- // Get a list of blog posts
- $area2 .= "<div id='blogs'>" . list_user_friends_objects($page_owner->getGUID(),'blog',10,false) . "<div class='clearfloat'></div></div>";
-
- // Get categories, if they're installed
- global $CONFIG;
- $area3 = elgg_view('blog/categorylist',array('baseurl' => $CONFIG->wwwroot . 'search/?subtype=blog&owner_guid='.$page_owner->guid.'&friends='.$page_owner->guid.'&tagtype=universal_categories&tag=','subtype' => 'blog'));
-
- // Display them in the page
- $body = elgg_view_layout("two_column_left_sidebar", '', $area1 . $area2, $area3);
-
- // Display page
- page_draw($title, $body);
-
+<?php
+
+ /**
+ * Elgg blog friends page
+ */
+
+ // Load Elgg engine
+ define('everyoneblog','true');
+ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+ // 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($_SESSION['guid']);
+ }
+ if (!($page_owner instanceof ElggEntity)) forward();
+
+ //set blog title
+ $area1 = elgg_view('blog/blog_header', array('context' => "friends", 'type' => 'blog'));
+
+ // Get a list of blog posts
+ set_context('search');
+ $area2 .= "<div id='blogs'>" . list_user_friends_objects($page_owner->getGUID(),'blog',10,false) . "<div class='clearfloat'></div></div>";
+ set_context('blog');
+
+ // Get categories, if they're installed
+ global $CONFIG;
+ //$area3 .= elgg_view("blogs/favourite", array("object_type" => 'blog'));
+ $comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc");
+ $area3 .= elgg_view('page_elements/latest_comments', array('comments' => $comments));
+ //include a view for plugins to extend
+ $area3 .= elgg_view("blogs/sidebar_options", array("object_type" => 'blog'));
+
+ // Display them in the page
+ $body = elgg_view_layout("one_column_with_sidebar", $area1.$area2, $area3);
+
+ // Display page
+ page_draw(elgg_echo('blog:friends'),$body);
+
?> \ No newline at end of file
diff --git a/mod/blog/index.php b/mod/blog/index.php
index 7c23e4089..5d03ce485 100644
--- a/mod/blog/index.php
+++ b/mod/blog/index.php
@@ -1,53 +1,55 @@
-<?php
-
- /**
- * Elgg blog index page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // Get the current page's owner
- $page_owner = page_owner_entity();
- if ($page_owner === false || is_null($page_owner)) {
-
- // guess that logged in user is the owner - if no logged in send to all blogs page
- if (!isloggedin()) {
- forward('mod/blog/everyone.php');
- }
-
- $page_owner = $_SESSION['user'];
- set_page_owner($_SESSION['guid']);
- }
-
- //set blog title
- if($page_owner == $_SESSION['user']){
- $area2 = elgg_view_title(elgg_echo('blog:your'));
- }else{
- //$area1 = elgg_view_title($page_owner->username . "'s " . elgg_echo('blog'));
- }
-
- // Get a list of blog posts
- $area2 .= "<div id=\"blogs\">";
- $area2 .= elgg_list_entities(array('type' => 'object', 'subtype' => 'blog', 'container_guid' => page_owner(), 'limit' => 10, 'full_view' => FALSE, 'view_type_toggle' => FALSE));
- $area2 .= "<div class='clearfloat'></div></div>";
-
- // Get blog tags
-
- // Get categories, if they're installed
- global $CONFIG;
- $area3 = elgg_view('blog/categorylist',array('baseurl' => $CONFIG->wwwroot . 'search/?subtype=blog&owner_guid='.$page_owner->guid.'&tagtype=universal_categories&tag=','subtype' => 'blog', 'owner_guid' => $page_owner->guid));
-
- // Display them in the page
- $body = elgg_view_layout("two_column_left_sidebar", '', $area1 . $area2, $area3);
-
- // Display page
- page_draw(sprintf(elgg_echo('blog:user'),$page_owner->name),$body);
-
-?> \ No newline at end of file
+<?php
+
+/**
+ * Elgg blog index page
+ */
+
+// Load Elgg engine
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+// 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($_SESSION['guid']);
+}
+
+//set breadcrumbs if in a group
+//$area1 = elgg_view('elggcampus_layout/breadcrumbs_general', array('object_type' => 'blog'));
+
+//set blog header
+if(page_owner()== get_loggedin_user()->guid){
+ $area1 .= elgg_view('blog/blog_header', array('context' => "own", 'type' => 'blog'));
+}elseif($page_owner instanceof ElggGroup){
+ $area1 .= elgg_view('groups/blog_header_group');
+}else{
+ $area1 .= elgg_view('blog/blog_header_visit', array('type' => 'blog'));
+}
+
+// Get a list of blog posts
+set_context('search');
+$blogs = list_user_objects($page_owner->getGUID(),'blog',10,false, false);
+if(!$blogs && ($page_owner->guid == get_loggedin_user()->guid))
+ $blogs = elgg_view('help/blogs');
+$area2 = "<div id=\"blogs\">" . $blogs . "<div class='clearfloat'></div></div>";
+set_context('blog');
+//if the logged in user is not looking at their stuff, display the ownerblock otherwise
+//show the users favourites
+if(page_owner() != get_loggedin_user()->guid){
+ $area3 = elgg_view('blog/ownerblock');
+}else{
+ //a view for the favourites plugin to extend
+ //$area3 .= elgg_view("blogs/favourite", array("object_type" => 'blog'));
+}
+//get the latest comments on user's blog posts
+$comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc",0,0,page_owner());
+$area3 .= elgg_view('page_elements/latest_comments', array('comments' => $comments));
+//a view for the favourites plugin to extend
+$area3 .= elgg_view("blogs/sidebar_options", array("object_type" => 'blog'));
+//display archive
+$area3 .= elgg_view("blog/archive");
+// Display them in the page
+$body = elgg_view_layout("one_column_with_sidebar", $area1.$area2, $area3);
+
+// Display page
+page_draw(sprintf(elgg_echo('blog:user'),$page_owner->name),$body); \ No newline at end of file
diff --git a/mod/blog/preview.php b/mod/blog/preview.php
index 88d293487..93e11c222 100644
--- a/mod/blog/preview.php
+++ b/mod/blog/preview.php
@@ -1,47 +1,41 @@
-<?php
-
- /**
- * Elgg blog: preview page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.org/
- */
-
- require_once(dirname(dirname(dirname(__FILE__))).'/engine/start.php');
-
- // Make sure we're logged in (send us to the front page if not)
- gatekeeper();
-
- // Get input data
-
- $blogpost = new stdClass;
- $blogpost->title = get_input('blogtitle');
- $blogpost->description = get_input('blogbody');
- $blogpost->tags = get_input('blogtags');
- $blogpost->access = get_input('access_id');
- $blogpost->comments_on = get_input('comments_select');
- $blogpost->time_created = time();
-
- // Convert string of tags into a preformatted array
- $blogpost->tags = string_to_tag_array($blogpost->tags);
-
- // Display it
- $area2 = elgg_view("blog/previewpane") .
- elgg_view("object/blog",array(
- 'entity' => $blogpost,
- 'entity_owner' => $_SESSION['user']->guid,
- 'comments' => false,
- 'full' => true
- ));
-
- // Set the title appropriately
- $title = sprintf(elgg_echo("blog:posttitle"),$_SESSION['user']->name,$blogpost->title);
-
- // Display through the correct canvas area
- $body = elgg_view_layout("two_column_left_sidebar", '', $area1 . $area2);
- page_draw($blogpost->title,$body);
-
-?>
+<?php
+
+ /**
+ * Elgg blog: preview page
+ */
+
+ require_once(dirname(dirname(dirname(__FILE__))).'/engine/start.php');
+
+ // Make sure we're logged in (send us to the front page if not)
+ gatekeeper();
+
+ // Get input data
+
+ $blogpost = new stdClass;
+ $blogpost->title = get_input('blogtitle');
+ $blogpost->description = get_input('blogbody');
+ $blogpost->tags = get_input('blogtags');
+ $blogpost->access = get_input('access_id');
+ $blogpost->comments_on = get_input('comments_select');
+ $blogpost->time_created = time();
+
+ // Convert string of tags into a preformatted array
+ $blogpost->tags = string_to_tag_array($blogpost->tags);
+
+ // Display it
+ $area2 = elgg_view("blog/previewpane") .
+ elgg_view("object/blog",array(
+ 'entity' => $blogpost,
+ 'entity_owner' => $_SESSION['user']->guid,
+ 'comments' => false,
+ 'full' => true
+ ));
+
+ // Set the title appropriately
+ $title = sprintf(elgg_echo("blog:posttitle"),$_SESSION['user']->name,$blogpost->title);
+
+ // Display through the correct canvas area
+ $body = elgg_view_layout("one_column_with_sidebar", $area1 . $area2);
+ echo page_draw($blogpost->title,$body);
+
+?>
diff --git a/mod/blog/read.php b/mod/blog/read.php
index 7be396759..291a7bdf8 100644
--- a/mod/blog/read.php
+++ b/mod/blog/read.php
@@ -1,59 +1,66 @@
-<?php
-
- /**
- * Elgg read blog post page
- *
- * @package ElggBlog
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- */
-
- // Load Elgg engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-
- // Get the specified blog post
- $post = (int) get_input('blogpost');
-
- // If we can get out the blog post ...
- if ($blogpost = get_entity($post)) {
-
- // Get any comments
- //$comments = $blogpost->getAnnotations('comments');
-
- // Set the page owner
- if ($blogpost->container_guid) {
- set_page_owner($blogpost->container_guid);
- } else {
- set_page_owner($blogpost->owner_guid);
- }
-
- // Display it
- $area2 = elgg_view_entity($blogpost, true);
- /*$area2 = elgg_view("object/blog",array(
- 'entity' => $blogpost,
- 'entity_owner' => $page_owner,
- 'comments' => $comments,
- 'full' => true
- ));
- */
- // Set the title appropriately
- $title = sprintf(elgg_echo("blog:posttitle"),$page_owner->name,$blogpost->title);
-
- // Display through the correct canvas area
- $body = elgg_view_layout("two_column_left_sidebar", '', $area1 . $area2);
-
- // If we're not allowed to see the blog post
- } else {
-
- // Display the 'post not found' page instead
- $body = elgg_view("blog/notfound");
- $title = elgg_echo("blog:notfound");
-
- }
-
- // Display page
- page_draw($title,$body);
-
+<?php
+
+ /**
+ * Elgg read blog post page
+ * @package ElggBlog
+ * @copyright Curverider Ltd 2008-2009
+ */
+
+// Load Elgg engine
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+// Get the specified blog post
+$post = (int) get_input('blogpost');
+
+// If we can get out the blog post ...
+if ($blogpost = get_entity($post)) {
+ // Set variables
+ $blog_acl = '';
+ // Set the page owner
+ if ($blogpost->container_guid)
+ set_page_owner($blogpost->container_guid);
+ else
+ set_page_owner($blogpost->owner_guid);
+
+ //set breadcrumbs
+ //$area2 = elgg_view('elggcampus_layout/breadcrumbs', array('object_title' => $blogpost->title, 'object_type' => 'blog'));
+ // Display it
+ $area2 .= elgg_view_entity($blogpost, true);
+ //get the blog's access level
+ $blog_acl = get_readable_access_level($blogpost->access_id);
+ // Set the title appropriately
+ $title = $blogpost->title;
+ //set blog ownerblock if not your own
+ if($blogpost->owner_guid != get_loggedin_user()->guid){
+ $area3 = elgg_view('blog/ownerblock');
+ }
+ //display the read sidebar
+ //$area3 .= elgg_view('blog/read_sidebar', array('blog_acl' => $blog_acl, 'entity' => $blogpost));
+ //if the logged in user is not looking at their stuff, display the ownerblock otherwise
+ //show the users favourites
+ if(page_owner() != get_loggedin_user()->guid){
+ $area3 = elgg_view('blog/ownerblock');
+ }else{
+ //a view for the favourites plugin to extend
+ $area3 .= elgg_view("blogs/sidebar_options", array("object_type" => 'blog'));
+ }
+ //display archive
+ $area3 .= elgg_view("blog/archive");
+ //get the latest comments on user's blog posts
+ $comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc",0,0,page_owner());
+ $area3 .= elgg_view('page_elements/latest_comments', array('comments' => $comments));
+
+ // Display through the correct canvas area
+ $body = elgg_view_layout("one_column_with_sidebar", $area1.$area2, $area3);
+
+// If we're not allowed to see the blog post
+} else {
+ // Display the 'post not found' page instead
+ $body = elgg_view("blog/notfound");
+ $title = elgg_echo("blog:notfound");
+}
+
+// Display page
+page_draw($title,$body);
+
?> \ No newline at end of file
diff --git a/mod/blog/shared.php b/mod/blog/shared.php
new file mode 100644
index 000000000..67dae202e
--- /dev/null
+++ b/mod/blog/shared.php
@@ -0,0 +1,59 @@
+<?php
+
+/**
+ * Elgg blog shared page
+ */
+
+// Load Elgg engine
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+// 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($_SESSION['guid']);
+}
+
+//get the shared access collection
+$sac = get_input('sac');
+
+//set breadcrumbs
+//$area1 = elgg_view('elggcampus_layout/breadcrumbs_general', array('object_type' => 'blog', 'context' => 'shared', 'sac' => $sac));
+
+//set blog header
+if(page_owner()== get_loggedin_user()->guid){
+ $area1 .= elgg_view('blog/blog_header', array('context' => "own", 'type' => 'blog'));
+}elseif($page_owner instanceof ElggGroup){
+ $area1 .= elgg_view('groups/blog_header_group');
+}else{
+ $area1 .= elgg_view('blog/blog_header_visit', array('type' => 'blog'));
+}
+
+// Get a list of blog posts
+set_context('search');
+$get_blogs = list_entities_from_access_id($sac, "object", "blog", 0, 10, false, false,true);
+if($get_blogs != "")
+ $area2 = "<div id=\"blogs\">" . $get_blogs . "<div class='clearfloat'></div></div>";
+else
+ $area2 = "<div class=\"ContentWrapper\">There are no blog posts in this work group.</div>";
+set_context('blog');
+//if the logged in user is not looking at their stuff, display the ownerblock otherwise
+//show the users favourites
+if(page_owner() != get_loggedin_user()->guid){
+ $area3 = elgg_view('blog/ownerblock');
+}else{
+ //a view for the favourites plugin to extend
+ $area3 .= elgg_view("blogs/favourite", array("object_type" => 'blog'));
+}
+//get the latest comments on user's blog posts
+$comments = get_annotations(0, "object", "blog", "generic_comment", "", 0, 4, 0, "desc",0,0,page_owner());
+$area3 .= elgg_view('page_elements/latest_comments', array('comments' => $comments));
+//a view for the favourites plugin to extend
+$area3 .= elgg_view("blogs/sidebar_options", array("object_type" => 'blog'));
+//display archive
+$area3 .= elgg_view("blog/archive");
+// Display them in the page
+$body = elgg_view_layout("one_column_with_sidebar", $area1.$area2, $area3);
+
+// Display page
+page_draw(sprintf(elgg_echo('blog:workgroup'),$page_owner->name),$body); \ No newline at end of file