📄 modern.cf
字号:
# $Id: modern.cf,v 1.2 2002/07/30 by Harald Weinreich <harald@weinreichs.de>## Definitions for '{nph-}search.cgi' configuration.## A hash (#) in the first column denotes a comment and is not processed# even inside a definition. Hashes not in the first column are left as-is.## Variable substitution occurs on these definitions. If you want# a dollar-sign ($) to occur in the output, escape it with backslash (\).# Other metacharacters (quotes, asterisks, etc) probably don't need to be# escaped. Printf-like special characters are allowed: \n \t \r etc.## The ending newline is chopped off from each definiton. So## <FooBar># abcxyz# </FooBar>## becomes "abcxyz". You may have blank lines in between the beginning# and ending tags, or use the newline character \n.### CGI defaults.## In this section you can give default values for any attribute that would# normally be passed in from the CGI query form. The following attributes# are currently available:## brokerqueryconfig : Name of a broker specific configuration file# lifetime : Maximum lifetime of a query (see also <Lifetime> section)# caseflag : Whether the query is casesensitive ["on" or "off"]# wordflag : Match on word boundaries ["on" or "off"]# opaqueflag : Show matched lines ["on" or "off"]# descflag : Return object description ["on" or "off"]# noregexflag : Don't do regular expressions ["on" or "off"]# maxresultflag : Maximum number of results to return# maxobjflag : Maximum number of objects to return# maxlineflag : Maximum number of matched lines# weightflag : show weight of hit# csumflag : show link to indexing data# errorflag : Number of spelling errors (therefore it's not really a flag!)# broker : Name of broker# host : Name of broker host# attribute : Space sperated list of attributes to return# sort : Sort options ["by-rank"]# hp_url : Url of search page# These defaults mimic the values on the provided query-glimpse-modern.html form.<Default>caseflag : onwordflag : onopaqueflag : ondescflag : onnoregexflag : offweightflag : offcsumflag : offerrorflag : 0maxobjflag : 500maxlineflag : 30maxresultflag : 3000perpageflag : 10sort : by-rankcharset : ISO-8859-1attribute : headings type file-size#attribute : headings type file-size last-modification-time</Default># 'GLOBAL' VARIABLES: are defined globally within the {nph-}search.cgi program,# but not necessarily set at all times.## $query the user query string# $html_query the user query string, special HTML characters escaped# $bquery the query string sent to the broker# $host the broker hostname# $port the broker port# $hp_url the URL of the broker query (home) page# $maxresult the maximum number of matched lines the broker will return# $nobjects a running count of the number of objects returned# $nopaquelines a running count of the number of opaque (matched) lines# $filterhint a (HTML)-Text with a verbal description of the current broker filter## definitions here can be output in other definitions. Each definition# here is placed into the %CFG associative array. For example,# to print out the Timeout defined below, write $CFG{'Timeout'}.## The URL to the Harvest Project home page.#<HarvestUrl>http://harvest.sourceforge.net/</HarvestUrl># The amount of time to wait for the broker results.# Can use aritmetic # here also, eg: 5*60## We use a conservative 5 minutes here.#<Timeout>300</Timeout># InitFunction can be some perl code which gets eval'd before they# query is sent. Use this for any special hackings.#<InitFunction>$cs_urlX = $csumflag ? 'Y' : undef;</InitFunction># The MIME content type of the query results. Should be "text/html"# if we are going to return HTML tags.#<ContentType>text/html</ContentType>############################################################################### RESULT SECTION## The output of '{nph-}search.cgi' consists of the following tags:## ResultHeader# CreateNavBars# ResultSetBegin# ( Errors from 'broker' )# foreach object {# PrintObject# }# ResultSetEnd# EndBrokerResults# ( TruncateWarning )# ResultTrailer################################################################################# First output for the HTML containing the results. Should probably include# <TITLE> tag and the user query.#<ResultHeader><HEAD><TITLE>Search Results for: $html_query</TITLE><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><style><!--dt { margin-left:1px; }dd { margin-left:40px; }// --></style></HEAD><BODY bgcolor=white><H2>Search Results for: <font color="#800000">$html_query</font></H2>$filterhint</ResultHeader># Final HTML section for the output. Should probably contain a pointer# to the broker home-page ($hp_url) and a pointer to the Harvest# home page.#<ResultTrailer></BODY></HTML></ResultTrailer># Calculations to obtain $navigationBar# Original code by Javier Masa Marin <masa@rediris.es>#<CreateNavBars>if ($totalPages > 0){ # elements before and after current page in navigation bar local($navPart) = 5; $prevPage = ""; $prevPage = "\n\n<a href=\"".&create_link($page-1)."\"><= Prev</a> ·" if ($page > 1); $nextPage = ""; $nextPage = "· <a class=\"navBar\" href=\"".&create_link($page+1)."\">Next =></a>" if ($page < $totalPages); $pageList = ""; local($startP) = ($page <= $navPart) ? 1 : $page - $navPart; for ($i = $startP; $i < $page; $i++) { $pageList .= "<a href=\"".&create_link($i)."\">$i</a>\n"; } $pageList .= "<b><font color=\"#800000\" size=+1>$page</font></b>\n"; local($endP) = ($page + $navPart >= $totalPages) ? $totalPages : $page + $navPart; for ($i = $page+1; $i <= $endP; $i++) { $pageList .= "\n<a href=\"".&create_link($i)."\">$i</a>\n"; } $navigationBar = "\n$prevPage\n $pageList\n $nextPage" if ($totalPages > 1);}</CreateNavBars># Output just before beginning the loop over objects returned by the broker.#<ResultSetBegin><form method="GET" action="/Harvest/cgi-bin/search.cgi">\n<table border="0" cellspacing=0 cellpadding=4 width="100%"><tr bgcolor="#E0E0E0"> <td align=left width="20%" nowrap> $totnumber objects found </td> <td align=center width="60%"> $navigationBar </td> <td align=right width="20%"> Page: $page/$totalPages </td></tr><tr><td align=middle colspan=3> <input type=hidden name=broker value="$broker"> <input type=hidden name=hp_url value="$hp_url"> <input type=hidden name=caseflag value="$RQ{'caseflag'}"> <input type=hidden name=wordflag value="$RQ{'wordflag'}"># <input type=hidden name=opaqueflag value="$RQ{'opaqueflag'}"># <input type=hidden name=descflag value="$RQ{'descflag'}"># <input type=hidden name=maxresultflag value="$RQ{'maxresultflag'}"># <input type=hidden name=maxobjflag value="$RQ{'maxobjflag'}"># <input type=hidden name=maxlineflag value="$RQ{'maxlineflag'}"> <input type=hidden name=weightflag value="$RQ{'weightflag'}"> <input type=hidden name=attribute value="@atts"><a href="$hp_url">New Search:</a> <input type=text name=query value='$RQ{'query'}'> <input type=submit></td></tr></form></table><DL>\n</ResultSetBegin># output just after ending the loop over objects returned by the broker#<ResultSetEnd></DL><form method="GET" action="/Harvest/cgi-bin/search.cgi"><table border="0" width="100%" bgcolor="#E0E0E0"><tr> <td align="left" width="20%" nowrap> <input type=hidden name=broker value="$broker"> <input type=hidden name=hp_url value="$hp_url"> <input type=hidden name=caseflag value="$RQ{'caseflag'}"> <input type=hidden name=wordflag value="$RQ{'wordflag'}"># <input type=hidden name=opaqueflag value="$RQ{'opaqueflag'}"># <input type=hidden name=descflag value="$RQ{'descflag'}"># <input type=hidden name=maxresultflag value="$RQ{'maxresultflag'}"># <input type=hidden name=maxobjflag value="$RQ{'maxobjflag'}"># <input type=hidden name=maxlineflag value="$RQ{'maxlineflag'}"> <input type=hidden name=weightflag value="$RQ{'weightflag'}"> <input type=hidden name=attribute value="@atts"> <a href="$hp_url">Search:</a> <input type=text name=query size=15 value='$RQ{'query'}'> <input type=submit value="Go"> </td> <td align="center" width="60%"> $navigationBar </td> <td align="right" width="20%"><a href="$CFG{'HarvestUrl'}"><img alt="Powered by Harvest" border="0" src="$harvestIcon"></a></td></table></form></ResultSetEnd># EndBrokerResults is printed when the broker results end normally.#<EndBrokerResults>#\n<STRONG>$msg</STRONG><BR>\n</EndBrokerResults>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -