PHP版Yomi-SearchにRSS出力機能をつける
PHP版のYomi-SearchにRSS出力機能をつける改造です。
まず、下記のファイルをダウンロードし、phpフォルダの中に入れてください。
そして、rssを出力する記載をテンプレートに行います。
yomi.php(index.php)の39行目に追加
if($_GET['page'] < 1 or $_GET['page'] > 1000){$_GET['page'] = 1;}
if($_GET["output"]!="xml") header("Content-type: text/html; charset=EUC-JP");
#各モードへ分岐
template/category.htm の1行目と5行目に下記を追加
<?php
if($_GET["output"]=="xml") require $cfg[sub_path]."rss.php";
?>
<html>
<head>
<title><?=$title?></title>
<link rel="alternate" type="application/rss+xml" href="<?=$cfg[script]?>?mode=<?=$_GET["mode"]?>&path=<?=$_GET["path"]?>&output=xml" />
<link rel="stylesheet" href="style.css" type="text/css">
template/top.htm の5行目に下記を追加
<title><?=$cfg[search_name]?></title>
<link rel="alternate" type="application/rss+xml" href="<?=$cfg[home]?>?mode=new&path=&output=xml" />
<link rel="stylesheet" href="style.css" type="text/css">
あとはIE7やFireox等でアクセスすると、トップページ及びカテゴリページにRSS表示がされているのを確認できると思います。
カテゴリページに表示されるRSSは、各カテゴリの登録サイトを、トップページのRSSは全体の新着サイトを表しています。