@~,()+^?\"·");
## Don't Change the Following Code
if ($action=='makeindex') {
Lock(2);
$page = RetrieveAuthPage($pagename, "admin");
if (!$page) { Abort("?admin password required"); }
$pagelist = $WikiDir->ls();
$i = 0;
echo "List of Indexed PmWiki Pages: ";
foreach($pagelist as $pagename) {
if (ereg($PagesNotIndexed, $pagename)) continue; // Wiki Pages excluded from the index file
echo "$pagename - ";
$page = ReadPage($pagename);
$file = $page['text'];
$file = strip_tags($file); // remove php/html tags
$file = ereg_replace($ExpressionsRemovedFormIndex, "" , $file);
$file = strtr($file, $SymbolsRemovedFromIndex, str_pad("", strlen($SymbolsRemovedFromIndex)));
$file = trim(ereg_replace("[[:space:]]+", " " , $file)); // reduce white space to single spaces
$list .= $pagename.":".$file."\n"; $i++;
}
$h = fopen( $SearchIndexFile, 'w' );
if( !$h ) Abort( "Couldn't open $fn for writing!" );
$list = substr ($list, 0, -1); // remove last '\n'
fwrite( $h, $list );
fclose( $h );
echo "".$i." Pages Indexed.";
exit;
}
function SearchIndexList($inclp, $exclp, $pats) {
global $SearchIndexFile;
$index = file( $SearchIndexFile );
foreach( $index as $t ) {
$t = rtrim( $t );
if (!$t) continue;
foreach($inclp as $i) if (!preg_match($i, $t)) continue 2;
foreach($exclp as $i) if (preg_match($i, $t)) continue 2;
list($pagename,$rest) = explode(":",$t,2);
$list .= $pagename.',';
}
$list = substr($list,0,-1); //remove last ',';
$list = explode( ',', $list );
$list = array_intersect ($list, $pats);
return $list;
}