/i", "サイト内検索", $line); if (preg_match("/()/i", $line, $m)) { $separator = $m[1]; $separator = str_replace("?", '\?', $separator); $ssi = $m[2]; list($leftdoc, $rightdoc) = split($separator, $line); $line = $leftdoc; if ($ssi) { list($exe, $param) = split("\?", $ssi); if ($Init['ssiurl']) { $url = $System['protocol']. $_SERVER['SERVER_NAME']. $ssi; $line .= file_get_contents($url); } else { $url = $_SERVER['DOCUMENT_ROOT']. $ssi; if (is_file($_SERVER['DOCUMENT_ROOT']. $ssi)) { $line .= file_get_contents($url); } } } $line .= $rightdoc; } elseif (preg_match("/()/i", $line, $m)) { $cgi_doc = false; list($leftdoc, $rightdoc) = split($m[1], $line); $line = $rightdoc; } elseif (preg_match("/()/", $line, $m)) { $cgi_doc = true; list($leftdoc, $rightdoc) = split($m[1], $line); $html .= $leftdoc; if (is_file($System['path']. "/". $System['datadir']. "/sitedb/database.txt")) { $date = "最終更新日時 : ". jst_time(filemtime($System['path']. "/". $System['datadir']. "/sitedb/database.txt"), 7); } $html .= "
"; if ($_REQUEST['target'] == "sp") { $html .= " "; } else { $html .= "
キーワード : 
$date
"; } if ($Setup['Blank'] || $_REQUEST['keyword']) { if ($_REQUEST['keyword']) { if ($_REQUEST['target'] == "sp" && $Setup['spRoot']) { $root = str_replace('/', '\/', $Setup['spRoot']); $script = "news"; !$Init['nonExt'] && $script .= '\.php'; $Database = array_values(preg_grep("/\turl=($root|\/$script)\/.*\ttitle=.*". $_REQUEST['keyword']. ".*/i", $Database)); } else { $Database = array_values(preg_grep("/". $_REQUEST['keyword']. "/i", $Database)); } } $max = count($Database); if ($max < 1) { $html .= "
申し訳ありません。
指定のキーワードでページが見つかりません。
キーワードを変更して再度検索を実行してみてください。
"; } else { !$_REQUEST['start'] && $_REQUEST['start'] = 0; $start = $_REQUEST['start'] + 1; !$Setup['Pageview'] && $Setup['Pageview'] = 20; $end = $_REQUEST['start'] + $Setup['Pageview'] - 1; $end > $max - 1 && $end = $max - 1; $html .= "
"; if ($_REQUEST['target'] != "sp") $html .= "
    "; if ($_REQUEST['target'] == "sp" && !$Setup['type']) $html .= "
      "; for ($i = $_REQUEST['start']; $i <= $end; $i++) { $page = dbfields($Database[$i]); !$page['title'] && $page['title'] = "non title"; $text = ""; if ($_REQUEST['target'] == "sp" && !$Setup['type']) { $text = description2($page['text'], 160); } !$text && $text = description($page['text'], 160); $page['url'] = $protocol. $_SERVER['SERVER_NAME']. $page['url']; if ($_REQUEST['keyword']) { $page['text'] = preg_replace("/". $_REQUEST['keyword']. "/", "". $_REQUEST['keyword']. "", $page['text']); } if ($_REQUEST['target'] == "sp") { list($d, $t) = split(" ", $page['date']); $url = $page['url']; preg_match("/\/$script\//", $url) && $url .= '/sp/'; if (!$Setup['type']) { $html .= "
    • ". $page['title']. "

      $text

      ". $page['url']. "

      ". $page['date']. "

    • "; } else { $collapsed = "false"; if ($Setup['type'] == 2) $collapsed = "true"; $html .= "

      ". $page['title']. "

      $d

      $text

      more


      "; } } else { $html .= "
    • $text
      ". $page['url']. " [ 更新日時 : ". $page['date']. " ]
    • "; } } if ($_REQUEST['start'] > 0) { $st = $end - $Setup['Pageview'] + 1; $prevbutton = " "; } if ($_REQUEST['start'] > 0) { $st = $end + 1; $nextbutton = " "; } if ($_REQUEST['target'] == "sp") { !$Setup['type'] && $html .= "
    "; } else { $html .= "
$prevbutton $nextbutton
"; } $html .= "
"; } } else { $html .= "
申し訳ありません。
何かキーワードを指定して検索を実行してください。
"; } $html .= "
"; } !$cgi_doc && $html .= $line; } echo_encode($html); } else { errorpage(); } function description2($text, $len) { $Split = split("。", $text); $Match = array_values(preg_grep("/". $_REQUEST['keyword']. "/", $Split)); return($Match[0]); } ?>