'.$grouplist[0].' (latest)'; echo ''; // Article List button echo ''; // Newsgroups button (hidden) echo ''; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; } else { echo '

'; echo ''.basename(getcwd()).' / '; echo 'search results for: '.$_GET['terms'].'

'; echo ''; // Newsgroups button (hidden) echo ''; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; } echo ''; # Iterate through groups $local_groupfile=$spooldir."/".$config_name."/local_groups.txt"; $results=0; foreach($grouplist as $findgroup) { $groups = preg_split("/( |\t)/", $findgroup, 2); $findgroup = $groups[0]; // Find starting article number (last - $maxdisplay) $local_grouplist = file($local_groupfile, FILE_IGNORE_NEW_LINES); foreach($local_grouplist as $local_findgroup) { $name = explode(':', $local_findgroup); if (strcmp($name[0], $findgroup) == 0) { if (is_numeric($name[1])) $local = $name[1]; else { $thisgroup = $path."/".preg_replace('/\./', '/', $findgroup); $articles = scandir($thisgroup); $ok_article=array(); foreach($articles as $this_article) { if(!is_numeric($this_article)) { continue; } $ok_article[]=$this_article; } sort($ok_article); $local = $ok_article[key(array_slice($ok_article, -1, 1, true))]; if(!is_numeric($local)) $local = 0; } break; } } if($local < 1) $local = 1; // $overviewfp=fopen($spooldir."/".$findgroup."-overview", "r"); $overviewfp=popen($CONFIG['tac'].' '.$spooldir.'/'.$findgroup.'-overview', 'r'); if($overviewfp) { while (($overviewline = fgets($overviewfp)) !== false) { $article = explode("\t", $overviewline); if(intval($article[0]) < ($local - $maxdisplay)) { continue; } if(!strcmp($_GET['searchpoint'], "Subject")) { $searchme = quoted_printable_decode(mb_decode_mimeheader($article[1])); } if(!strcmp($_GET['searchpoint'], "Poster")) { $searchme = quoted_printable_decode(mb_decode_mimeheader($article[2])); } if(!strcmp($_GET['searchpoint'], "Message-ID")) { $searchme = $article[4]; } if(stripos($searchme, $_GET['terms']) === false) { continue; } # Generate link $url = $thissite."/article-flat.php?id=".$article[0]."&group="._rawurlencode($findgroup)."#".$article[0]; $groupurl = $thissite."/thread.php?group="._rawurlencode($findgroup); $fromoutput = explode("<", html_entity_decode($article[2])); // Just an email address? if(strlen($fromoutput[0]) < 2) { preg_match("/\<([^\)]*)\@/", html_entity_decode($article[2]), $fromaddress); $fromoutput[0] = $fromaddress[1]; } if(strpos($fromoutput[0], "(")) { preg_match("/\(([^\)]*)\)/", html_entity_decode($article[2]), $fromaddress); $fromoutput[0] = $fromaddress[1]; } if(($results % 2) != 0){ echo ''; if($results++ > ($maxdisplay - 2)) break; } fclose($overviewfp); } } echo '
'; } else { echo '
'; } echo '

'; echo ''.mb_decode_mimeheader($article[1])."\r\n"; echo '

'; echo ''.$findgroup.''; echo '

'; echo '

Posted: '.$article[3].' by: '.mb_decode_mimeheader($fromoutput[0]).'

'; echo '
'; echo "

".$results." matching articles found.

\r\n"; #echo "
Rocksolid Overboard version ".$version; include "tail.inc"; $thispage = ob_get_contents(); ob_end_clean(); echo $thispage; function highlightStr($haystack, $needle) { preg_match_all("/$needle+/i", $haystack, $matches); if (is_array($matches[0]) && count($matches[0]) >= 1) { foreach ($matches[0] as $match) { $haystack = str_replace($match, ''.$match.'', $haystack); } } return $haystack; } function _rawurlencode($string) { $string = rawurlencode(str_replace('+','%2B',$string)); return $string; } function _rawurldecode($string) { $string = rawurldecode(str_replace('%2B','+',$string)); return $string; } ?>