[geeklog-cvs] geeklog: Feed items still had '...' at the end of text if length...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Fri Mar 2 09:41:39 EST 2012


changeset 8501:5157dd2c3cce
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/5157dd2c3cce
user: Tom <websitemaster at cogeco.net>
date: Fri Mar 02 09:41:05 2012 -0500
description:
Feed items still had '...' at the end of text if length set to 1 (bug #0001431)

diffstat:

 system/lib-syndication.php |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 6eb91200d02b -r 5157dd2c3cce system/lib-syndication.php
--- a/system/lib-syndication.php	Thu Mar 01 18:29:23 2012 -0500
+++ b/system/lib-syndication.php	Fri Mar 02 09:41:05 2012 -0500
@@ -289,7 +289,8 @@
             $storytitle = stripslashes( $row['title'] );
             $fulltext = stripslashes( $row['introtext']."\n".$row['bodytext'] );
             $fulltext = PLG_replaceTags( $fulltext );
-            $storytext = COM_truncateHTML ( $fulltext, $contentLength, ' ...' );
+            $storytext = ($contentLength == 1) ? $fulltext : COM_truncateHTML ($fulltext, $contentLength, ' ...');
+ 
 
             $fulltext = trim( $fulltext );
             $fulltext = str_replace(array("\015\012", "\015"), "\012", $fulltext);
@@ -430,7 +431,7 @@
 
         $fulltext = stripslashes( $row['introtext']."\n".$row['bodytext'] );
         $fulltext = PLG_replaceTags( $fulltext );
-        $storytext = COM_truncateHTML ( $fulltext, $contentLength, ' ...' );
+        $storytext = ($contentLength == 1) ? $fulltext : COM_truncateHTML ($fulltext, $contentLength, ' ...');
         $fulltext = trim( $fulltext );
         $fulltext = str_replace(array("\015\012", "\015"), "\012", $fulltext);
 
@@ -533,9 +534,7 @@
                 if ($A['content_length'] != 1) {
                     $count = count($content);
                     for ($i = 0; $i < $count; $i++ ) {
-                        $content[$i]['summary'] = COM_truncateHTML(
-                                    $content[$i]['text'], $A['content_length'], ' ...');
-      
+                        $content[$i]['summary'] = ($A['content_length'] == 1) ? $content[$i]['text'] : COM_truncateHTML ($content[$i]['text'], $A['content_length'], ' ...');
                     }
                 }
             }
@@ -655,7 +654,9 @@
 */
 function SYND_truncateSummary($text, $length)
 {
-    return COM_truncateHTML ($text, $length, ' ...');
+    $storytext = ($length == 1) ? $text : COM_truncateHTML ($text, $length, ' ...');
+    
+    return $storytext;
 }
 
 



More information about the geeklog-cvs mailing list