]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Separated blog object view from comments.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 15 Apr 2010 19:51:36 +0000 (19:51 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 15 Apr 2010 19:51:36 +0000 (19:51 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5751 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/blog_lib.php
mod/blog/views/default/object/blog.php

index 0ecd48b860af3d55df924fe9db5348c3b037644c..de7cc1b96149f577ec9988e952797737a7410582 100644 (file)
@@ -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;
 }
 
index 6a8c308813567ba291cdb95bce3c7e0886b313e9..5749a858b261131e499721d7258e1e7b5e455bad 100644 (file)
@@ -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;