Allow show 'Read more' link when adding page-break to blog post - refs BT#12324

pull/2487/head
Angel Fernando Quiroz Campos 9 years ago
parent 6a26112ba0
commit e4b9278f0c
  1. 2
      main/inc/lib/api.lib.php
  2. 6
      main/inc/lib/blog.lib.php

@ -613,6 +613,8 @@ define('MAX_ONLINE_USERS', 12);
// Number of characters maximum to show in preview of course blog posts
define('BLOG_MAX_PREVIEW_CHARS', 800);
// HTML string to replace with a 'Read more...' link
define('BLOG_PAGE_BREAK', '<div style="page-break-after: always"><span style="display: none;">&nbsp;</span></div>');
// Make sure the CHAMILO_LOAD_WYSIWYG constant is defined
// To remove CKeditor libs from HTML, set this constant to true before loading

@ -3075,6 +3075,12 @@ class Blog
*/
private static function getPostExtract($fullText, $length = BLOG_MAX_PREVIEW_CHARS)
{
$parts = explode(BLOG_PAGE_BREAK, $fullText);
if (count($parts) > 1) {
return $parts[0];
}
// Remove any HTML from the string
$text = strip_tags($fullText);
$text = api_html_entity_decode($text);

Loading…
Cancel
Save