From 54976984b863236469fed1aebfc181ecc1402bfe Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 14 May 2005 07:38:57 +0000 Subject: [PATCH] Break up long words inside the RSS feeds so that blocks are not stretched out stupidly by long URLs and so on --- blocks/rss_client/block_rss_client.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index 81edf13db25..efedee93124 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -170,7 +170,7 @@ class block_rss_client extends block_base { } if (empty($rss_record->preferredtitle)) { - $feedtitle = stripslashes_safe(rss_unhtmlentities($rss->channel['title'])); + $feedtitle = stripslashes_safe(rss_unhtmlentities($rss->channel['title'])); } else { $feedtitle = stripslashes_safe($rss_record->preferredtitle); } @@ -194,6 +194,8 @@ class block_rss_client extends block_base { if ($item['title'] == '') { // no title present, use portion of description $item['title'] = substr(strip_tags($item['description']), 0, 20) . '...'; + } else { + $item['title'] = break_up_long_words($item['title'], 30); } if ($item['link'] == '') { @@ -206,6 +208,7 @@ class block_rss_client extends block_base { if ($display_description && !empty($item['description'])){ + $item['description'] = break_up_long_words($item['description'], 30); $returnstring .= '
'. format_text($item['description'], FORMAT_MOODLE, $formatoptions, $this->courseid) . '
' ."\n";