Commit d8a484f4 authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Fix event short description

parent 801d580e
......@@ -2843,9 +2843,8 @@ class Layout
$event['geo_name'] = $item['geo_name'];
$event['event_type'] = $item['type'];
$event['title'] = $item['title'];
$event['desc'] = $item['description'];
$this->th->Html2Text($item['description']);
$event['desc'] = $this->th->StringChunk($item['description'], 150)[0] . ' ...';
$event['desc'] = $this->th->StringPortion($item['description'], 150);
if($item['hdate_ts']>0)
$event['hdate'] = $this->FormatDate($item['hdate_ts']);
$this->TopicInit($item['id_topic']);
......
......@@ -626,6 +626,14 @@ class TextHelper
return $chunks;
}
public function StringPortion($string, $length) {
if (strlen($string)>$length) {
$string = substr($string,0,$length + 4);
$string = substr($string,0,strrpos($string,' ')) . ' ...';
}
return $string;
}
public function StringCut( &$string, $length, $dots="...", $is_unicode=false, $separator="" )
{
if($is_unicode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment