]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Blog uses elgg_make_excerpt() now instead of its own.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 24 May 2010 20:02:23 +0000 (20:02 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 24 May 2010 20:02:23 +0000 (20:02 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6190 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/actions/blog/auto_save_revision.php
mod/blog/actions/blog/save.php
mod/blog/blog_lib.php
mod/blog/views/default/object/blog.php

index 520d575313faef44d1824537576458f083c65fb0..ce35c1295d2c3a8a34e20f7a559ba8fddc2e7fcf 100644 (file)
@@ -41,7 +41,7 @@ if ($title && $description) {
                $blog->access_id = ACCESS_PRIVATE;
                $blog->title = $title;
                $blog->description = $description;
-               $blog->excerpt = blog_make_excerpt($excerpt);
+               $blog->excerpt = elgg_make_excerpt($excerpt);
                // must be present or doesn't show up when metadata sorting.
                $blog->publish_date = time();
                if (!$blog->save()) {
index 0e8a696b936090a70ab7f3f92221906a962b418e..138c32bda82c63f112e3897348d1554c0d36dd7f 100644 (file)
@@ -78,9 +78,9 @@ foreach ($values as $name => $default) {
 
                case 'excerpt':
                        if ($value) {
-                               $value = blog_make_excerpt($value);
+                               $value = elgg_make_excerpt($value);
                        } else {
-                               $value = blog_make_excerpt($values['description']);
+                               $value = elgg_make_excerpt($values['description']);
                        }
                        $values[$name] = $value;
                        break;
index 9876b0a349979d7c55d8d39c25608f6462cb8a83..e2724ae0ba12a74db8ca14d14541e10c86f2ada3 100644 (file)
@@ -243,32 +243,6 @@ function blog_get_page_content_friends($user_guid) {
        return array('content' => $content);
 }
 
-/**
- * Returns an appropriate excerpt for a blog.
- * Will return up to 250 chars stopping at the nearest space.
- * If no spaces are found (like in Japanese) will crop off at the
- * 250 char mark.
- *
- * @param string $text
- * @param int $words
- * @return string
- */
-function blog_make_excerpt($text, $chars = 250) {
-       $text = trim(strip_tags($text));
-
-       // handle cases
-       $excerpt = elgg_substr($text, 0, $chars);
-       $space = elgg_strrpos($excerpt, ' ', 0);
-
-       // don't crop if can't find a space.
-       if ($space === FALSE) {
-               $space = $chars;
-       }
-       $excerpt = trim(elgg_substr($excerpt, 0, $space));
-
-       return $excerpt ;
-}
-
 /**
  * Returns a list of years and months for all blogs optionally for a user.
  * Very similar to get_entity_dates() except uses a metadata field.
index 0c8944f7d8250dd4d8ec4dede05755e45b460565..a45e72bd8bd56fef5a0d522ad38e1c2214eabf55 100644 (file)
@@ -22,11 +22,6 @@ $linked_title = "<a href=\"{$blog->getURL()}\" title=\"" . htmlentities($blog->t
 $categories = elgg_view('categories/view', $vars);
 $excerpt = $blog->excerpt;
 
-// add ellipses to excerpt it not the full post
-if ($excerpt != trim(strip_tags($blog->description))) {
-       $excerpt .= ' &#8230';
-}
-
 $body = autop($blog->description);
 $owner_icon = elgg_view("profile/icon",array('entity' => $owner, 'size' => 'tiny'));
 $tags = elgg_view('output/tags', array('tags' => $blog->tags));