$[Search Results]", 'markup:(:searchresults fmt=custom list=normal:)', 'wiki:$[PmWiki.SearchQuickReference]')); $FPLFunctions['custom'] = 'FPLCustom'; SDV($NoMatchesFmt,"
No matches.
"); SDV($SearchResultsFmt,"\$[SearchFor]

$HTMLVSpace\$MatchList $HTMLVSpace\$[SearchFound]$HTMLVSpace

"); $SearchTagFmt = ($action=='search' || preg_match('/SearchWiki$/',$pagename)) ? 'Searching Wiki' : "

$[Search Wiki]:
"; Markup('searchbox','>links','/\(:searchbox:\)/', FmtPageName("
", $pagename)); SDV($ActDescription,'last modified'); if ($action=='search') { $ActDescription = 'search performed'; $CurrentTime = strftime($TimeFmt,$Now); $text = stripmagic($HTTP_GET_VARS['q']); $jumpto=''; if (preg_match("/^$GroupPattern([\\/.])$NamePattern$/",$text)) $jumpto=$text; elseif (preg_match("/^$NamePattern$/",$text)) $jumpto = (isset($HTTP_GET_VARS['group'])) ? stripmagic($HTTP_GET_VARS['group']).".$text" : FmtPageName("\$Group.$text",$pagename); if ($jumpto && PageExists($jumpto)) Redirect($jumpto); } SDV($PublishSearch,false); SDV($PublishSearchChecked,false); SDV($EnablePDF,false); XLSDV('en',array( 'SearchFor' => 'Results of searching $Haystack for $Needle.', 'SearchFound' => '$MatchCount pages found out of $MatchSearched pages searched.')); if ($PublishSearch) { if ($action=='search' || FmtPageName('$Group',$pagename)=='Category') { $checked = ($PublishSearchChecked) ? "checked='checked'" : ''; $FPLByGroupStartFmt = "
"; $FPLByGroupEndFmt = "
$HTMLVSpace "; $FPLByGroupEndFmt .= ($action=='search') ? " " : ""; $FPLByGroupEndFmt .= ($EnablePDF) ? " PDF
" : ""; $FPLByGroupGFmt = "
\$Group
"; $FPLByGroupIFmt = "
\$Title
"; } } function Needle($incl,$excl) { $n = str_replace('$LQ$RQ','','$LQ'.join('$RQ and $LQ',$incl).'$RQ'); foreach($excl as $w) { $n .= " not \$LQ$w\$RQ"; } if ($n) return str_replace('$LQ','‘', str_replace('$RQ','’',htmlspecialchars(trim($n)))); else return 'all'; } function FPLCustom($pagename,&$pagelist,$opt) { global $NoMatchesFmt,$FmtV,$FmtP; $FmtV['$Haystack'] = ($GLOBALS['SearchGroup']) ? '‘'.$GLOBALS['SearchGroup'].'’ group' : 'all groups'; $FmtV['$Needle'] = Needle($GLOBALS['SearchIncl'],$GLOBALS['SearchExcl']); return ($FmtV['$MatchCount']==0) ? $NoMatchesFmt : FPLByGroup($pagename,$pagelist,$opt); } function HandleSearch($pagename) { global $HandleSearchFmt,$PageStartFmt,$PageSearchFmt,$PageEndFmt,$FmtP; $FmtP['/\\$LastModified/e'] = '$GLOBALS[\'CurrentTime\']'; SDV($HandleSearchFmt,array(&$PageStartFmt, &$PageSearchFmt, &$PageEndFmt)); PrintFmt($pagename,$HandleSearchFmt); } ?>