增加时间XML输出时的特殊字符处理,以及默认GMT+8
This commit is contained in:
parent
1e1513a817
commit
e69fb93f37
|
@ -151,13 +151,13 @@ class WaterController extends DataController
|
|||
$rows=$this->db->fetchAll("select id,uuid,description,title,timebegin,timeend from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and timebegin is not null order by timebegin");
|
||||
$timexml='<data>';
|
||||
foreach($rows as $row) {
|
||||
$timexml.='<event start="'.date($dateformat,strtotime($row['timebegin'])).'" ';
|
||||
$timexml.='<event start="'.date($dateformat,strtotime($row['timebegin'])).' GMT+0800" ';
|
||||
if ($row['timeend']!='' && $row['timeend']!=$row['timebegin']) $timexml.=' end="'.date($dateformat,strtotime($row['timeend'])).'" isDuration="true"';
|
||||
$timexml.= ' title="'.mb_substr($row['title'],31).'" image="/images/westdc_40w.gif" link="/water/'.$row['uuid'].'">';
|
||||
$timexml.= ' title="'.htmlspecialchars(mb_substr($row['title'],31)).'" image="/images/westdc_40w.gif" link="/water/'.$row['uuid'].'">';
|
||||
$desc_length=mb_strlen($row['description'],"UTF-8");
|
||||
$desc=mb_substr($row['description'],0,($desc_length>300)?300:$desc_length,"UTF-8");
|
||||
if ($desc_length>300) $desc.=" ...";
|
||||
//$timexml.=htmlspecialchars($desc);
|
||||
$timexml.=htmlspecialchars($desc);
|
||||
$timexml.="</event>\n";
|
||||
}
|
||||
$timexml.='</data>';
|
||||
|
|
Loading…
Reference in New Issue