$nhurl="http://xxad.net/nicofc2/";
$nhttl="ニコはてな(Γedition) NICOFC2";
///////テスト期間
if (empty($_SERVER['QUERY_STRING'])) {
//何も変数がなかったので終了
echo "";
echo "
まともな処理が出来ません。はてなでも見てまったりしてて下さい。";
exit;
} else {
$url = $_SERVER['QUERY_STRING'];
$url = mb_convert_encoding($url, "UTF-8", "ASCII,JIS,UTF-8,EUC-JP,SJIS");
$urpat = "watch\/(.*)";
if ( preg_match ( "/".$urpat."/i", $url, $urlnext ) ){
$key=$urlnext[1];
}else{
$var = split ("[/._:@+]", $url);
$key=$var[0];
}
$key = mb_convert_kana($key, "KVa");
}
////
//ニコニコチャートジャンパー
$cnicochart1 = "nicochart.jp\/(.*)";
if ( preg_match ( "/".$cnicochart1."/i", $url, $cmnicochart1 ) ){
$index_jump="http://xxad.net/nicofc2/".$cmnicochart1[1];
header("Location: {$index_jump}");
exit;
}
$cnicochart2 = "url=(.*)";
if ( preg_match ( "/".$cnicochart2."/i", $url, $cmnicochart2 ) ){
$index_jump="http://xxad.net/nicofc2/".$cmnicochart2[1];
header("Location: {$index_jump}");
exit;
}
$cnicochart3 = "v=(.*)";
if ( preg_match ( "/".$cnicochart3."/i", $url, $cmnicochart3 ) ){
$index_jump="http://xxad.net/nicofc2/".$cmnicochart3[1];
header("Location: {$index_jump}");
exit;
}
$cnicochart4 = "nicoboom.org\/info\/(.*)";
if ( preg_match ( "/".$cnicochart4."/i", $url, $cmnicochart4 ) ){
$index_jump="http://xxad.net/nicofc2/".$cmnicochart4[1];
header("Location: {$index_jump}");
exit;
}
$url = str_replace("dic.nicovideo.jp/b/", "dic.nicovideo.jp/", $url);
$cnicochart5 = "dic.nicovideo.jp\/v\/(.*)";
if ( preg_match ( "/".$cnicochart5."/i", $url, $cmnicochart5 ) ){
$c5var = split ("[/-]", $cmnicochart5[1]);
$index_jump="http://xxad.net/nicofc2/".$c5var[0];
header("Location: {$index_jump}");
exit;
}
$cnicochart6 = "dic.nicovideo.jp\/a\/(.*)";
if ( preg_match ( "/".$cnicochart6."/i", $url, $cmnicochart6 ) ){
$c6var = split ("[/-]", $cmnicochart6[1]);
$index_jump="http://xxad.net/nicofc2/tag/".$c6var[0];
header("Location: {$index_jump}");
exit;
}
$cnicochart7 = "nicohatena\/(.*)";
if ( preg_match ( "/".$cnicochart7."/i", $url, $cmnicochart7) ){
$index_jump="http://xxad.net/nicofc2/".$cmnicochart7[1];
header("Location: {$index_jump}");
exit;
}
$cnicochart8 = "nicosound.anyap.info\/sound\/(.*)";
if ( preg_match ( "/".$cnicochart8."/i", $url, $cmnicochart8) ){
$index_jump="http://xxad.net/nicofc2/".$cmnicochart8[1];
header("Location: {$index_jump}");
exit;
}
//タグ用処理
$c1 = "tagnext\/(.*)";
if ( preg_match ( "/".$c1."/i", $url, $cm1 ) ){
$index_jump="http://nicofc2.blog62.fc2.com/blog-entry-2.html?nicotag=".$cm1[1];
header("Location: {$index_jump}");
exit;
}
//タグ用ぶっとばし処理
$cxx1 = "tag\/(.*)";
if ( preg_match ( "/".$cxx1."/i", $url, $cmxx1 ) ){
$index_jump="http://nicofc2.blog62.fc2.com/blog-entry-2.html?nicotag=".$cmxx1[1];
header("Location: {$index_jump}");
exit;
}
//検索用処理
$c2 = "search\/(.*)";
if ( preg_match ( "/".$c2."/i", $url, $cm2 ) ){
$index_jump="http://ghostmansion.net/color/nicohatena/ranking2.php?hatena=nicosearch&search=".$cm2[1];
header("Location: {$index_jump}");
exit;
}
//ランキング用処理
$c3 = "ranking(.*)";
if ( preg_match ( "/".$c3."/i", $url, $cm3 ) ){
$index_jump="http://xxad.net/nicofc2/";
header("Location: {$index_jump}");
exit;
}
//マイビデオ用処理
$c6 = "myvideo\/(.*)";
if ( preg_match ( "/".$c6."/i", $url, $cm6 ) ){
$index_jump="http://nicofc2.blog62.fc2.com/blog-entry-5.html?myvideo=".$cm6[1];
header("Location: {$index_jump}");
exit;
}
//マイリスト用処理
$c4 = "mylist\/(.*)";
if ( preg_match ( "/".$c4."/i", $url, $cm4 ) ){
$index_jump="http://nicofc2.blog62.fc2.com/blog-entry-4.html?mylist=".$cm4[1];
header("Location: {$index_jump}");
exit;
}
/*
//マイリスト用処理2
$c5 = "^[^sn]([1-9]+)(.*)";
if ( preg_match ( "/".$c5."/i", $url, $cm5 ) ){
$index_jump="http://xxad.net/nicofc2/mylist/".$cm5[0];
header("Location: {$index_jump}");
exit;
}
*/
$c101 = "video\/niconico\/(.*)";
if ( preg_match ( "/".$c101."/i", $url, $cm101 ) ){
$index_jump="http://xxad.net/nicofc2/".$cm101[1];
header("Location: {$index_jump}");
exit;
}
$c100 = "watch\/(.*)";
if ( preg_match ( "/".$c100."/i", $url, $cm100 ) ){
$index_jump="http://xxad.net/nicofc2/".$cm100[1];
header("Location: {$index_jump}");
exit;
}
$pattern = "(s|n)m([1-9]+[0-9]*)";
if ( preg_match ( "/".$pattern."/i", $key, $match ) ){
$key=$match[1]."m".$match[2];
$dtype=$match[1]."m";
}elseif ( preg_match ( "/([a-z])([a-z])([1-9]+[0-9]*)/i", $key, $match ) ){
$key=$match[1].$match[2].$match[3];
$dtype=$match[1].$match[2];
}else{
$index_jump="http://xxad.net/nicofc2/";
header("Location: {$index_jump}");
exit;
}
$index_jump="http://nicofc2.blog62.fc2.com/blog-entry-1.html?nicoid=".$key;
header("Location: {$index_jump}");
?>