function plugin_xbel_action() { global $vars, $page_title, $rss_description, $whatsnew; $adm = empty($vars['adm']) ? 'page' : $vars['adm']; // ユーザ認証されていない $id = auth::check_auth(); if (empty($id)) { $adm = 'recent'; } $data = <<<EOD <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML" "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd"> <xbel version="1.0"> <title><![CDATA[{$page_title}]]></title> <desc><![CDATA[{$rss_description}]]></desc> EOD; change_uri('', 1); // Force absoluteURI. switch ($adm) { case 'list': $pages = xbel::get_data(); break; case 'recent': $pages = array($whatsnew); break; // list // list default: $page = empty($vars['page']) ? $whatsnew : $vars['page']; $pages = array($page); unset($page); } foreach ($pages as $page) { $links = xbel::get_link_list($page); $data .= xbel::put_body($links, $page); } $data .= "</xbel>\n"; pkwk_common_headers(); header('Content-type: application/xml'); print $data; exit; }