diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-02 21:28:59 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-02 21:28:59 +0000 |
commit | 3ea25a4f5efe9f5de5baf58a35d73850b5ad37db (patch) | |
tree | e6d9d912be6de0ac8a479b08b235671f27b3b2be /mod/blog | |
parent | 2eb99a3919c37a4d5600541820645f01fc651e37 (diff) | |
download | elgg-3ea25a4f5efe9f5de5baf58a35d73850b5ad37db.tar.gz elgg-3ea25a4f5efe9f5de5baf58a35d73850b5ad37db.tar.bz2 |
Determining which content header to use based on blog owner.
Primary navigation tabs should not display on other users' blog lists.
git-svn-id: http://code.elgg.org/elgg/trunk@5586 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog')
-rw-r--r-- | mod/blog/blog_lib.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/mod/blog/blog_lib.php b/mod/blog/blog_lib.php index d785b1a89..28c044c6b 100644 --- a/mod/blog/blog_lib.php +++ b/mod/blog/blog_lib.php @@ -19,8 +19,6 @@ function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) { global $CONFIG; - $content = elgg_view('page_elements/content_header', array('context' => $context, 'type' => 'blog', 'all_link' => "{$CONFIG->site->url}pg/blog")); - if ($guid) { $blog = get_entity($guid); @@ -31,6 +29,12 @@ function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) { $content = elgg_view_entity($blog, TRUE); } } else { + $content = elgg_view('page_elements/content_header', array( + 'context' => $context, + 'type' => 'blog', + 'all_link' => "{$CONFIG->site->url}pg/blog" + )); + $options = array( 'type' => 'object', 'subtype' => 'blog', @@ -38,13 +42,19 @@ function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) { 'order_by_metadata' => array('name'=>'publish_date', 'direction'=>'DESC', 'as'=>'int') ); + $loggedin_userid = get_loggedin_userid(); if ($owner_guid) { $options['owner_guid'] = $owner_guid; + + if ($owner_guid != $loggedin_userid) { + // do not show content header when viewing other users' posts + $content = elgg_view('page_elements/content_header_member', array('type' => 'blog')); + } } // show all posts for admin or users looking at their own blogs // show only published posts for other users. - if (!(isadminloggedin() || (isloggedin() && $owner_guid == get_loggedin_userid()))) { + if (!(isadminloggedin() || (isloggedin() && $owner_guid == $loggedin_userid))) { $options['metadata_name_value_pairs'] = array( array('name' => 'status', 'value' => 'published'), array('name' => 'publish_date', 'operand' => '<', 'value' => time()) |