query("SET NAMES utf8;"); $st = $pdo->query("SELECT * FROM post ORDER BY no DESC LIMIT 8"); $recents = $st->fetchAll(); $channel = array( 'about' => BLOG_ROOT_URL.'rss.php', 'title' => BLOG_NAME, 'link' => BLOG_ROOT_URL.'blog.php', 'description' => 'Description', 'creator' => 'Yamo' ); $items = array(); foreach ($recents as $recent){ if($recent['format']!='locked'){ $descreption= mb_substr($recent['content'], 0, 255); $items[]=array('link' => BLOG_ROOT_URL.'blog.php?d=1&id='.$recent['no'], 'date' => date('Y-m-d\TH:i:s+09:00', $recent['time']), 'title' => $recent['title'], 'description' => $descreption); } } show_template('rss.tmpl', array( 'channel' => $channel, 'items' => $items )); } ?>