aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-15 19:51:36 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-15 19:51:36 +0000
commitd4cf75af90a0071a275e2169f0a6795933ee8125 (patch)
tree7f0cff04d2e71cbf12d1847a46e5751c09a5ceda
parenteb3f65345410313a6b87149fdea504d0a66e53af (diff)
downloadelgg-d4cf75af90a0071a275e2169f0a6795933ee8125.tar.gz
elgg-d4cf75af90a0071a275e2169f0a6795933ee8125.tar.bz2
Separated blog object view from comments.
git-svn-id: http://code.elgg.org/elgg/trunk@5751 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/blog/blog_lib.php27
-rw-r--r--mod/blog/views/default/object/blog.php6
2 files changed, 14 insertions, 19 deletions
diff --git a/mod/blog/blog_lib.php b/mod/blog/blog_lib.php
index 0ecd48b86..de7cc1b96 100644
--- a/mod/blog/blog_lib.php
+++ b/mod/blog/blog_lib.php
@@ -18,7 +18,7 @@
*/
function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) {
global $CONFIG;
-
+
if ($guid) {
$blog = get_entity($guid);
@@ -27,6 +27,7 @@ function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) {
} else {
elgg_push_breadcrumb($blog->title, $blog->getURL());
$content = elgg_view_entity($blog, TRUE);
+ $content .= elgg_view_comments($blog);
}
} else {
$content = elgg_view('page_elements/content_header', array(
@@ -34,7 +35,7 @@ function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) {
'type' => 'blog',
'all_link' => "{$CONFIG->site->url}pg/blog"
));
-
+
$options = array(
'type' => 'object',
'subtype' => 'blog',
@@ -45,7 +46,7 @@ function blog_get_page_content_read($owner_guid = NULL, $guid = NULL) {
$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'));
@@ -123,7 +124,7 @@ function blog_get_page_content_edit($guid, $revision = NULL) {
*/
function blog_get_page_content_archive($owner_guid, $lower=0, $upper=0) {
global $CONFIG;
-
+
$now = time();
elgg_push_breadcrumb(elgg_echo('blog:archives'));
@@ -196,15 +197,15 @@ function blog_get_page_content_archive($owner_guid, $lower=0, $upper=0) {
*/
function blog_get_page_content_friends($user_guid) {
global $CONFIG;
-
+
elgg_push_breadcrumb(elgg_echo('friends'));
-
+
$content = elgg_view('page_elements/content_header', array(
'context' => 'friends',
'type' => 'blog',
'all_link' => "{$CONFIG->site->url}pg/blog"
));
-
+
if (!$friends = get_user_friends($user_guid, ELGG_ENTITIES_ANY_VALUE, 0)) {
$content .= elgg_echo('friends:none:you');
} else {
@@ -214,11 +215,11 @@ function blog_get_page_content_friends($user_guid) {
'full_view' => FALSE,
'order_by_metadata' => array('name'=>'publish_date', 'direction'=>'DESC', 'as'=>'int'),
);
-
+
foreach ($friends as $friend) {
$options['container_guids'][] = $friend->getGUID();
}
-
+
// admin / owners can see any posts
// everyone else can only see published posts
if (!(isadminloggedin() || (isloggedin() && $owner_guid == get_loggedin_userid()))) {
@@ -230,7 +231,7 @@ function blog_get_page_content_friends($user_guid) {
array('name' => 'status', 'value' => 'published')
);
}
-
+
$list = elgg_list_entities_from_metadata($options);
if (!$list) {
$content .= elgg_echo('blog:none');
@@ -238,7 +239,7 @@ function blog_get_page_content_friends($user_guid) {
$content .= $list;
}
}
-
+
return array('content' => $content);
}
@@ -252,12 +253,12 @@ function blog_get_page_content_friends($user_guid) {
function blog_make_excerpt($text, $words=60) {
$text = strip_tags($text);
preg_match("/([\S]+\s*){0,$words}/", $text, $matches);
-
+
$trimmed = trim($matches[0]);
if ($trimmed != $text) {
return "$trimmed &#8230";
}
-
+
return $trimmed;
}
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 6a8c30881..5749a858b 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -62,11 +62,6 @@ if ($blog->canEdit()) {
$edit;
if ($full) {
- if ($blog->comments_on != 'Off') {
- $comments = elgg_view_comments($blog);
- } else {
- $comments = '';
- }
echo <<<___END
<div class="blogpost clearfloat">
@@ -87,7 +82,6 @@ echo <<<___END
<span class="body">$body</span>
</div>
</div>
-$comments
___END;