diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php index 3498ac3e60..08c9e41791 100755 --- a/main/inc/lib/blog.lib.php +++ b/main/inc/lib/blog.lib.php @@ -1,4 +1,4 @@ - 0) - { - while($blog_post = Database::fetch_array($result)) - { + if(Database::num_rows($result) > 0) { + $limit = api_get_setting('read_more_limit'); //nmbr of words in introduction text + if (empty($limit)) { + $limit = 200; + } + while($blog_post = Database::fetch_array($result)) { // Get number of comments $sql = "SELECT COUNT(1) as number_of_comments FROM $tbl_blogs_comments WHERE blog_id = '".(int)$blog_id."' AND post_id = '" . (int)$blog_post['post_id']."'"; $tmp = Database::query($sql); @@ -730,44 +732,32 @@ class Blog { $blog_post_date = api_convert_and_format_date($blog_post['date_creation'], null, date_default_timezone_get()); // Create an introduction text (but keep FULL sentences) - $limit = api_get_setting('read_more_limit'); //nmbr of words in introduction text + $introduction_text = ""; $words = 0; - $tok = strtok(make_clickable(stripslashes($blog_post['full_text'])), " "); - //original - //$tok = strtok(make_clickable(stripslashes(strip_tags($blog_post['full_text'],"