time() - 5*3600*24){ $newflg = 1; }else{ $newflg = 0; } /*if(mb_strlen($descr, PUT_CHAR) > BODY_LENGTH){ $descr = mb_substr($descr, 0, BODY_LENGTH, PUT_CHAR) . "..."; }*/ $heisei = date("Y", $time) - 1988; $blog[$url] = array( "date" => date("Y.n.j", $time), "time" => $time, "newflg" => $newflg, "url" => $url, "title" => $title, "descr" => $descr); } } /** * ブログ配列ソート */ function cmp($a, $b) { if($a["time"] == $b["time"]){ return 0; } return ($a["time"] < $b["time"]) ? 1 : -1; } header("Pragma: no-cache"); $blog = array(); $xml = rss_parse("blog/atom.xml"); if(is_array($xml["entry"])){ make_list($xml, $blog); } if(count($blog) <= 0){ print("There is no latest information.\n"); exit(); } initialize_smarty(); $smarty->assign("blog", $blog); $smarty->display("rss_puller.html"); ?>