]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't double-show summary and content
authorEvan Prodromou <evan@status.net>
Mon, 20 Jun 2011 14:26:24 +0000 (10:26 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 20 Jun 2011 14:26:24 +0000 (10:26 -0400)
plugins/Blog/Blog_entry.php
plugins/Blog/blogentrylistitem.php

index 34e4ea294ec3d1cb01dec3206740fe9e383d8a4d..0e4df28b82cb0472eb90b94a90281d252709e816 100644 (file)
@@ -127,6 +127,12 @@ class Blog_entry extends Managed_DataObject
             $be->summary = self::summarize($content);
         }
 
+        // Don't save an identical summary
+
+        if ($be->summary == $be->content) {
+            $be->summary = null;
+        }
+
         $url = common_local_url('showblogentry', array('id' => $be->id));
 
         if (!array_key_exists('uri', $options)) {
index 97a06acfa7e1451aadcc5dc17f043e39e699e875..ee937daa7728e7cdbba331636de88f5c32e270f7 100644 (file)
@@ -71,10 +71,11 @@ class BlogEntryListItem extends NoticeListItemAdapter
         $out->element('a', array('href' => $notice->bestUrl()), $entry->title);
         $out->elementEnd('h4');
 
-        $out->element('div', 'blog-entry-summary', $entry->summary);
-
-        // XXX: hide content initially; click More... for full text.
-
-        $out->element('div', 'blog-entry-content', $entry->content);
+        if (!empty($entry->summary)) {
+            $out->element('div', 'blog-entry-summary', $entry->summary);
+        } else {
+            // XXX: hide content initially; click More... for full text.
+            $out->element('div', 'blog-entry-content', $entry->content);
+        }
     }
 }