修改time1.xml时间格式

This commit is contained in:
wlx 2010-01-14 08:23:02 +00:00
parent 6e24602fe3
commit 70e2592c5b
2 changed files with 7 additions and 6 deletions

View File

@ -308,13 +308,13 @@ class DataController extends Zend_Controller_Action
*/
function timelineAction()
{
$fn="time.xml";
$fn="time1.xml";
if (!file_exists($fn) || (time()-filemtime($fn)>3600*24))
{
$dateformat="D M j Y G:i:s O";
$dateformat="M j Y";
$md = new MetadataTable();
$db=$md->getAdapter();
$state=$db->query('select id,uuid,description,title,timebegin,timeend from metadata where timebegin is not null');
$state=$db->query('select id,uuid,description,title,timebegin,timeend from metadata where timebegin is not null order by timebegin');
$rows=$state->fetchAll();
$timexml='<data>';
foreach($rows as $row) {
@ -324,7 +324,8 @@ class DataController extends Zend_Controller_Action
$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).'</event>';
$timexml.=htmlspecialchars($desc);
$timexml.="</event>\n";
}
$timexml.='</data>';
$fp=fopen($fn,'w');

View File

@ -23,14 +23,14 @@ window.onload=function() {
date: date,
overview: true,
intervalPixels: 200,
theme:theme
theme: theme
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl = Timeline.create(document.getElementById("tl"), bandInfos);
tl.loadXML("/time.xml", function(xml, url) {
tl.loadXML("/time1.xml", function(xml, url) {
eventSource.loadXML(xml, url);
});
}