<?
include_once("/home/sites/chicappa.jp/users/chicappa.jp-net-tool/web/net-tool-jp/inc/mysql.inc");
include_once("{$_SERVER['DOCUMENT_ROOT']}/inc/menus.inc");

function showfiles($dir){
	global $filelist;
	foreach($filelist[$dir] as $key => $val){
		if($key=="detail" or $key=="search.php") continue;
		if(!strpos($key,".php")){
			showfiles($dir.$key."/");
		}else{
			if($dir=="/list/point/" and $key!="index.php"){
				$val[1] = "{$val[0]} - ポイントサイト";
				$val[2] = "{$val[0]}のポイントサイトの一覧です";
			}elseif($dir=="/list/quest/" and $key!="index.php"){
				$val[1] = "{$val[0]} - アンケートサイト";
				$val[2] = "{$val[0]}のアンケートサイトの一覧です";
			}elseif($dir=="/list/read/" and $key!="index.php"){
				$val[1] = "{$val[0]} - リードメール";
				$val[2] = "{$val[0]}のリードメールの一覧です";
			}
?>
   <item>
    <title><?=$val[1]?></title>
    <description><![CDATA[<?=strip_tags($val[2])?>]]></description>
    <link>http://point.net-tool.jp<?=$dir.$key?></link>
    <guid>http://point.net-tool.jp<?=$dir.$key?></guid>
  </item>
<?		}
	}
}

header ("Content-Type: application/xml; charset=UTF-8");
?>
<?='<?xml version="1.0" encoding="UTF-8"?>'?>
<rss version="2.0">
 <channel>
  <title>ポイントサイト比較検索ポイントサーチ</title>
  <link>http://point.net-tool.jp</link>
  <description><![CDATA[アーカイブされたデータから独自の算定式に基づくランキングやユーザーによる検索結果からポイントサイトを比較攻略できます。お小遣い、副収入が稼ぎやすい還元率の高いポイントサイトから懸賞サイトまで。あなたに合ったポイントサービスが見つけられます]]></description>
  <language>ja</language>
  <copyright>Copyright 2008</copyright>
  <lastBuildDate>Sun, 20 Jan 2008 2:32:16 +900</lastBuildDate>
<?showfiles("/")?>
<?$rst = mysql_query_or_die("select sitename,text from point_site");
while($col=mysql_fetch_assoc($rst)){?>
   <item>
    <title><?=$col["sitename"]?></title>
    <description><![CDATA[<?=str_replace("\r\n","",strip_tags(mb_substr($col["text"],0,mb_strpos($col["text"],"。"))))?>]]></description>
    <link>http://point.net-tool.jp/detail/<?=urlencode($col["sitename"])?></link>
    <guid>http://point.net-tool.jp/detail/<?=urlencode($col["sitename"])?></guid>
  </item>
<?}?>
 </channel>
</rss>

