<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >How to write search result templates </TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="mnoGoSearch 3.3.9 reference manual" HREF="index.html"><LINK REL="UP" TITLE="Searching documents" HREF="msearch-doingsearch.html"><LINK REL="PREVIOUS" TITLE="Searching documents" HREF="msearch-doingsearch.html"><LINK REL="NEXT" TITLE="Designing search.htm" HREF="msearch-html.html"><LINK REL="STYLESHEET" TYPE="text/css" HREF="mnogo.css"><META NAME="Description" CONTENT="mnoGoSearch - Full Featured Web site Open Source Search Engine Software over the Internet and Intranet Web Sites Based on SQL Database. It is a Free search software covered by GNU license."><META NAME="Keywords" CONTENT="shareware, freeware, download, internet, unix, utilities, search engine, text retrieval, knowledge retrieval, text search, information retrieval, database search, mining, intranet, webserver, index, spider, filesearch, meta, free, open source, full-text, udmsearch, website, find, opensource, search, searching, software, udmsearch, engine, indexing, system, web, ftp, http, cgi, php, SQL, MySQL, database, php3, FreeBSD, Linux, Unix, mnoGoSearch, MacOS X, Mac OS X, Windows, 2000, NT, 95, 98, GNU, GPL, url, grabbing"></HEAD ><BODY CLASS="sect1" BGCOLOR="#EEEEEE" TEXT="#000000" LINK="#000080" VLINK="#800080" ALINK="#FF0000" ><!--#include virtual="body-before.html"--><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" ><SPAN CLASS="application" >mnoGoSearch</SPAN > 3.3.9 reference manual: Full-featured search engine software</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="msearch-doingsearch.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 10. Searching documents</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="msearch-html.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="templates" >How to write search result templates <A NAME="AEN5107" ></A ></A ></H1 ><P > <SPAN CLASS="application" >mnoGoSearch</SPAN > users can fully customize the search results <SPAN CLASS="emphasis" ><I CLASS="emphasis" >look and feel</I ></SPAN >. You can do it by editing the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >template</I ></SPAN > file <TT CLASS="filename" >search.htm</TT > which resides in the <TT CLASS="filename" >/etc/</TT > directory of your <SPAN CLASS="application" >mnoGoSearch</SPAN > installation. </P ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="templates-structure" >Template file structure</A ></H2 ><P >The template file is a usual <ACRONYM CLASS="acronym" >HTML</ACRONYM > file divided into blocks (sections). Keep in mind that you can just open the template file in your Web browser and get the idea of how the search results will look like. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > Lines in the template file should not exceed <TT CLASS="literal" >1024</TT > bytes. </P ></BLOCKQUOTE ></DIV ><P >Every section starts and ends with special <SPAN CLASS="emphasis" ><I CLASS="emphasis" >section delimiters</I ></SPAN > which look like <TT CLASS="literal" ><!--sectionname--></TT > and <TT CLASS="literal" ><!--/sectionname--></TT > correspondingly. The section delimiters should reside on separate lines. </P ><P >Every section consists of a <ACRONYM CLASS="acronym" >HTML</ACRONYM > formatted text with <SPAN CLASS="emphasis" ><I CLASS="emphasis" >variable references</I ></SPAN >. A variable reference is replaced by its value when <SPAN CLASS="application" >search.cgi</SPAN > is running. </P ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="templates-variable-formats" >Template variable formats</A ></H2 ><P >Template variables can be printed using a number of different formats: <P CLASS="literallayout" ><br> <CODE CLASS="varname" >$(x)</CODE > - a plain text value.<br> <CODE CLASS="varname" >$&(x)</CODE > - a <ACRONYM CLASS="acronym" >HTML</ACRONYM >-escaped value with search words highlighted.<br> <CODE CLASS="varname" >$%(x)</CODE > - a value escaped for use in <ACRONYM CLASS="acronym" >URLs</ACRONYM ><br> <CODE CLASS="varname" >$^(x)</CODE > - a <ACRONYM CLASS="acronym" >HTML</ACRONYM >-escaped value with search words highlighted.<br> </P > </P ><P > It is possible to specify the maximum number of characters printed by a variable. For example, <CODE CLASS="varname" >$(URL)</CODE > can return a very long <ACRONYM CLASS="acronym" >URL</ACRONYM > and break the search results layout. To limit the maximum length printed by a variable, use the <TT CLASS="literal" >$(URL:xx)</TT > syntax, where <TT CLASS="literal" >xx</TT > is the maximum number of characters to display. </P ><P > <CODE CLASS="varname" >$(URL:40)</CODE > will print the <ACRONYM CLASS="acronym" >URL</ACRONYM > variable value. In case when it is longer than <TT CLASS="literal" >40</TT > characters, only <TT CLASS="literal" >40</TT > characters will be displayed including the trailing dots: </P ><P > <KBD CLASS="userinput" >http://very.long.url/path/veery/long/...</KBD > </P ><P > Starting from the version <TT CLASS="literal" >3.3.1</TT >, it is also possible to display the rightmost characters: </P ><P > <CODE CLASS="varname" >$(URL:-40)</CODE > </P ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="templates-sect" >Template sections <A NAME="AEN5160" ></A ></A ></H2 ><P ><SPAN CLASS="application" >mnoGoSearch</SPAN > supports the following sections: </P ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="top-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >TOP</I ></SPAN > section</A ></H3 ><A NAME="AEN5168" ></A ><P > This section is printed in the very beginning of <SPAN CLASS="application" >search.cgi</SPAN > output and should usually start with <TT CLASS="literal" ><HTML><HEAD></TT > and so on. Also, this is the proper place to put a search form to. </P ><P > A number of variables is available in the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >top</I ></SPAN > section: <PRE CLASS="programlisting" > $(self) - the argument for the FORM ACTION tag $(q) - the search query $(cat) - the current category value $(tag) - the current tag value $(rN) - a random number (here N is a number between <TT CLASS="literal" >0</TT > and <TT CLASS="literal" >9</TT >) </PRE > </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B >If you want to print some random banners or random links in your search results, you can use the <CODE CLASS="varname" >$(r0)</CODE >..<CODE CLASS="varname" >$(r9)</CODE > variables. For example: <PRE CLASS="programlisting" > <A HREF="http://www.sitename.com/redirect.php?targetID=$(r0)"> Go to a random page of the site </A> </PRE > You can also initialize the <CODE CLASS="varname" >$(rX)</CODE > variables to a desired <SPAN CLASS="emphasis" ><I CLASS="emphasis" >number range</I ></SPAN > using the <B CLASS="command" ><A HREF="msearch-cmdref-r.html" >R0 - R9</A ></B > commands. </P ></BLOCKQUOTE ></DIV ><P >A example of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >top</I ></SPAN > section can look like this: <PRE CLASS="programlisting" > <!--top--> <HTML> <HEAD> <TITLE>mnoGoSearch: $&(q)</TITLE> </HEAD> <BODY> Search in the manual: <FORM METHOD=GET ACTION="$&(self)"> <INPUT TYPE="text" NAME="q" SIZE="30" VALUE="$&(q)"> <INPUT TYPE="hidden" NAME="ul" VALUE="/manual/"> <INPUT TYPE="hidden" NAME="ps" VALUE="20"> <INPUT TYPE="submit" VALUE="Search!"> </FORM> <!--/top--> </PRE > </P ><P >The example above includes some search parameters, described in details in <A HREF="msearch-doingsearch.html#search-params" >the Section called <I >Search parameters <A NAME="AEN4440" ></A ></I ></A >: </P ><P > The <CODE CLASS="varname" >ul</CODE > form variable is an <ACRONYM CLASS="acronym" >URL</ACRONYM > filter. It allows to limit results to a particular site or a site directory. For example, you can put the following code into your template: <PRE CLASS="programlisting" > Search through: <SELECT NAME="ul"> <OPTION VALUE="" SELECTED="$(ul)">Entire site <OPTION VALUE="/manual/" SELECTED="$(ul)">Manual <OPTION VALUE="/products/" SELECTED="$(ul)">Products <OPTION VALUE="/support/" SELECTED="$(ul)">Support </SELECT> </PRE > to limit your search to a particular site directory. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > The attribute <TT CLASS="literal" >SELECTED="$(ul)"</TT > in the above example (and in the other examples below) allows the selected option to be selected again by default on the next page displayed after pressing the <TT CLASS="literal" >Search!</TT > button. The attribute is replaced to either the <TT CLASS="literal" >SELECTED</TT > keyword, or to empty string, according to the current <CODE CLASS="varname" >$(ul)</CODE > value. </P ></BLOCKQUOTE ></DIV ><P > <CODE CLASS="varname" >ps</CODE > is the default page size (e.g. how many documents are displayed per page). </P ><P > <CODE CLASS="varname" >q</CODE > is the search query. </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="bottom-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >BOTTOM</I ></SPAN > section</A ></H3 ><A NAME="AEN5210" ></A ><P > This section is always displayed in the end of <SPAN CLASS="application" >search.cgi</SPAN > output and typically contains all closing tags which have their counterparts in the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >top</I ></SPAN > section. <DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > The position of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >bottom</I ></SPAN > section in the search template file does not matter. It is always displayed in the very end of output. Putting the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >bottom</I ></SPAN > section in the end of the template file is recommended solely for convenience reasons, to be able to view the template as an ordinary <ACRONYM CLASS="acronym" >HTML</ACRONYM > file in your Web browser. </P ></BLOCKQUOTE ></DIV > </P ><P >An example of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >bottom</I ></SPAN > section can look like this: <PRE CLASS="programlisting" > <!--bottom--> <P> <HR> <DIV ALIGN=right> <A HREF="http://search.mnogo.ru/"> <IMG SRC="mnogosearch.gif" BORDER=0 ALT="[Powered by mnoGoSearch]"> </A> </BODY> </HTML> <!--/bottom--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="restop-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >RESTOP</I ></SPAN > section</A ></H3 ><A NAME="AEN5227" ></A ><P > This section is included just before the search results. It's a good idea to use this section to put some statistics about the query just executed, with help of the following variables: </P ><P ></P ><UL ><LI ><P > <A NAME="AEN5234" ></A > <TT CLASS="literal" >$(first)</TT > - the offset of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >first</I ></SPAN > document displayed on this page. </P ></LI ><LI ><P > <A NAME="AEN5241" ></A > <TT CLASS="literal" >$(last)</TT > - the offset of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >last</I ></SPAN > document displayed on this page. </P ></LI ><LI ><P > <A NAME="AEN5248" ></A > <TT CLASS="literal" >$(total)</TT > - the total number of the documents found. </P ></LI ><LI ><P > <A NAME="AEN5254" ></A > <TT CLASS="literal" >$(W)</TT > - short word statistics with information about the number of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >exact</I ></SPAN > and the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >fuzzy</I ></SPAN > query word forms, delimited by the <TT CLASS="literal" >/</TT > sign for every query word. For example, if the <CODE CLASS="varname" >$(W)</CODE > value is <TT CLASS="literal" >test: 25/73</TT >, it means that <SPAN CLASS="application" >mnoGoSearch</SPAN > found <TT CLASS="literal" >25</TT > exact word forms <TT CLASS="literal" >test</TT >, and <TT CLASS="literal" >73</TT > fuzzy forms like <TT CLASS="literal" >tested</TT >, <TT CLASS="literal" >tests</TT >, <TT CLASS="literal" >testing</TT >, etc. </P ></LI ><LI ><P > <A NAME="AEN5272" ></A > <TT CLASS="literal" >$(WE)</TT > - extended word statistics including information about every exact and fuzzy word form found. </P ></LI ><LI ><P > <A NAME="AEN5278" ></A > <TT CLASS="literal" >$(SearchTime)</TT > - search query execution time. </P ></LI ><LI ><P > <A NAME="AEN5284" ></A > <TT CLASS="literal" >$(CurrentTimestamp)</TT > - current time, in seconds since <TT CLASS="literal" >00:00:00 UTC, January 1, 1970</TT >. </P ></LI ><LI ><P > <A NAME="AEN5291" ></A > <TT CLASS="literal" >$(ndocs)</TT > - the total number of documents in the database. </P ></LI ></UL ><P >This is an example of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >restop</I ></SPAN > section: <PRE CLASS="programlisting" > <!--restop--> <TABLE BORDER=0 WIDTH=100%> <TR> <TD>Search<BR>results:</TD> <TD><small>$(WE)</small></TD> <TD><small>$(W)</small></TD> </TR> </TABLE> <HR> <CENTER> Displaying documents $(first)-$(last) of total <B>$(total)</B> found. Search took <b>$(SearchTime)</b> seconds </CENTER> <!--/restop--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="res-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >RES</I ></SPAN > section</A ></H3 ><A NAME="AEN5301" ></A ><P > This section is displayed for every document from the current result page (<TT CLASS="literal" >10</TT > documents per page by default). </P ><P > The following variables are available in the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >RES</I ></SPAN > section: </P ><P ></P ><UL ><LI ><A NAME="AEN5310" ></A ><P ><CODE CLASS="varname" >$(URL)</CODE > - the <ACRONYM CLASS="acronym" >URL</ACRONYM > </P ></LI ><LI ><A NAME="AEN5317" ></A ><P ><CODE CLASS="varname" >$(Title)</CODE > - the Title </P ></LI ><LI ><A NAME="AEN5323" ></A ><P ><CODE CLASS="varname" >$(Score)</CODE > - the score (as calculated by <SPAN CLASS="application" >mnoGoSearch</SPAN >) </P ></LI ><LI ><A NAME="AEN5330" ></A ><P ><CODE CLASS="varname" >$(Body)</CODE > - a piece of text, to give an idea of what the document is about: <P ></P ><UL ><LI ><P > a smart excerpt with the query words in their context if <B CLASS="command" ><A HREF="msearch-stored.html" >CachedCopy</A ></B > is available, </P ></LI ><LI ><P > otherwise, the first couple of lines from the document body. </P ></LI ></UL > </P ></LI ><LI ><A NAME="AEN5343" ></A ><P ><CODE CLASS="varname" >$(Content-Type)</CODE > - the Content-type (for example, <TT CLASS="literal" >text/html</TT >) </P ></LI ><LI ><A NAME="AEN5350" ></A ><P ><CODE CLASS="varname" >$(Last-Modified)</CODE > - the modification date, using <A HREF="msearch-cmdref-dateformat.html" >DateFormat</A >. </P ></LI ><LI ><A NAME="AEN5357" ></A ><P ><CODE CLASS="varname" >$(Last-Modified-Timestamp)</CODE > - the modification date as a number of seconds since <TT CLASS="literal" >00:00:00 UTC, January 1, 1970</TT >. </P ></LI ><LI ><A NAME="AEN5364" ></A ><P ><CODE CLASS="varname" >$(Content-Length)</CODE > - the document Size (in bytes)</P ></LI ><LI ><A NAME="AEN5370" ></A ><P ><CODE CLASS="varname" >$(Content-Length-K)</CODE > - the document Size (in kilobytes)</P ></LI ><LI ><A NAME="AEN5376" ></A ><P ><CODE CLASS="varname" >$(Order)</CODE > - the document Number in the order of its appearance in the search results, starting from <TT CLASS="literal" >1</TT >. </P ></LI ><LI ><A NAME="AEN5383" ></A ><P ><CODE CLASS="varname" >$(DBOrder)</CODE > - the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >Original Database Document Order </I ></SPAN > - the original order of the document in its database result set, before multiple <A HREF="msearch-cmdref-dbaddr.html" >DBAddr</A > search results were merged into the final result. It is equal to <CODE CLASS="varname" >$(Order)</CODE > if only a single <A HREF="msearch-cmdref-dbaddr.html" >DBAddr</A > command is given in <TT CLASS="filename" >search.htm</TT >. This variable is mostly for debugging purposes. </P ></LI ><LI ><A NAME="AEN5394" ></A ><P ><CODE CLASS="varname" >$(DBNum)</CODE > - the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >Source Database Number</I ></SPAN > - the number of the database generated this document, in the order of appearance of the <A HREF="msearch-cmdref-dbaddr.html" >DBAddr</A > commands, starting from <TT CLASS="literal" >0</TT >. That is <TT CLASS="literal" >0</TT > means that the document was found in the database corresponding to the first <A HREF="msearch-cmdref-dbaddr.html" >DBAddr</A > command, <TT CLASS="literal" >1</TT > - to the second <A HREF="msearch-cmdref-dbaddr.html" >DBAddr</A > command, and so on. <CODE CLASS="varname" >$(DBNum)</CODE > is always <TT CLASS="literal" >0</TT > <TT CLASS="filename" >search.htm</TT > uses only a single <A HREF="msearch-cmdref-dbaddr.html" >DBAddr</A > command. This variable is mostly for debugging purposes. </P ></LI ><LI ><A NAME="AEN5411" ></A ><P ><CODE CLASS="varname" >$(meta.description)</CODE > - the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >description</I ></SPAN > meta tag value. </P ></LI ><LI ><A NAME="AEN5418" ></A ><P ><CODE CLASS="varname" >$(meta.keywords)</CODE > - the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >keywords</I ></SPAN > meta tag value. </P ></LI ><LI ><A NAME="AEN5425" ></A ><P ><CODE CLASS="varname" >$(DY)</CODE > - the document category with links, i.e. <TT CLASS="filename" >/home/computers/software/www/</TT > </P ></LI ><LI ><A NAME="AEN5432" ></A ><P ><CODE CLASS="varname" >$(CloneN.URL)</CODE > - the <ACRONYM CLASS="acronym" >URL</ACRONYM > of the <TT CLASS="literal" >N-th</TT > <SPAN CLASS="emphasis" ><I CLASS="emphasis" ><A HREF="msearch-cmdref-detectclones.html" >clone</A ></I ></SPAN >, where <TT CLASS="literal" >N</TT > is a number starting from <TT CLASS="literal" >0</TT >. The <CODE CLASS="varname" >$(CloneN)</CODE > variables appeared in <SPAN CLASS="application" >mnoGoSearch</SPAN > <TT CLASS="literal" >3.3.0</TT >. </P ></LI ><LI ><A NAME="AEN5448" ></A ><P ><CODE CLASS="varname" >$(PerSite)</CODE > - the total number of documents found on the same site when <B CLASS="command" ><A HREF="msearch-doingsearch.html#search-params" >GroupBySite</A ></B > is enabled, or <TT CLASS="literal" >0</TT > otherwise. </P ></LI ></UL ><P >Here is an example of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >res</I ></SPAN > section: <PRE CLASS="programlisting" > <!--res--> <DL><DT> <b>$(Order).</b><a href="$(URL)" TARGET="_blank"> <b>$(Title)</b></a> [<b>$(Score)</b>]<DD> $(Body)...<BR> <b>URL: </b> <A HREF="$(URL)" TARGET="_blank">$(URL)</A>($(Content-Type))<BR> $(Last-Modified), $(Content-Length) bytes<BR> <b>Description: </b>$(meta.description)<br> <b>Keywords: </b>$(meta.keywords)<br> </DL> <UL> $(CL) </UL> <!--/res--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="clone-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >CLONE</I ></SPAN > section</A ></H3 ><A NAME="AEN5462" ></A ><P > This section was supported in <SPAN CLASS="application" >mnoGoSearch</SPAN > versions prior to <TT CLASS="literal" >3.3.0</TT > and was removed in the later versions. Use the <CODE CLASS="varname" >$(CloneN.URL)</CODE > variables instead. </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="resbot-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >RESBOT</I ></SPAN > section</A ></H3 ><A NAME="AEN5472" ></A ><P > This section is included just after the last document. You can usually print the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >page navigation bar</I ></SPAN > here, which includes links to move to the next and the previous result pages. </P ><P >This is an example of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >resbot</I ></SPAN > section: <PRE CLASS="programlisting" > <!--resbot--> <HR> <CENTER> Result pages: $(NL)$(NB)$(NR) </CENTER> <!--/resbot--> </PRE > </P ></DIV ><P >The page navigator is constructed from the following template sections: </P ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="navleft-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >navleft, navleft_nop</I ></SPAN > sections</A ></H3 ><P >These sections are used to print the links to the previous result page. If the previous page exists, the code in <TT CLASS="literal" ><!--navleft--></TT > is used. The very first page does not have previous pages, so <TT CLASS="literal" ><!--navleft_nop--></TT > is used instead. <PRE CLASS="programlisting" > <!--navleft--> <TD><A HREF="$(NH)"><IMG...></A><BR> <A HREF="$(NH)">Prev</A></TD> <!--/navleft--> <!--navleft_nop--> <TD><IMG...><BR> <FONT COLOR=gray>Prev</FONT></TD> <!--/navleft_nop--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="navbar0-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >navbar0</I ></SPAN > section</A ></H3 ><A NAME="AEN5491" ></A ><P > This is used for printing the current page in the page list. <PRE CLASS="programlisting" > <!--navbar0--> <TD><IMG...><BR>$(NN)</TD> <!--navbar0--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="navright-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >navright, navright_nop</I ></SPAN > sections</A ></H3 ><A NAME="AEN5499" ></A ><P > These two sections are used to print the link to the next page. If the next page exists, the <TT CLASS="literal" ><!--navright--></TT > section is used. On the last page the <TT CLASS="literal" ><!--navright_nop--></TT > section is used instead. <PRE CLASS="programlisting" > <!--navright--> <TD> <A HREF="$(NH)"><IMG...></A> <BR> <A HREF="$(NH)">Next</A></TD> <!--/navright--> <!--navright_nop--> <TD> <IMG...> <BR> <FONT COLOR=gray>Next</FONT></TD> <!--/navright_nop--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="navbar1-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >navbar1</I ></SPAN > section</A ></H3 ><A NAME="AEN5509" ></A ><P > This template section is used to print the links to the other pages in the page list. <PRE CLASS="programlisting" > <!--navbar1--> <TD> <A HREF="$(HR)"> <IMG...></A><BR> <A HREF="$(NH)">$(NN)</A> </TD> <!--/navbar1--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="notfound-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >notfound</I ></SPAN > section</A ></H3 ><A NAME="AEN5517" ></A ><P > As the section name implies, the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >notfound</I ></SPAN > section is displayed in case when no documents were found and usually consists of a message with hints how to make the search condition less restrictive. </P ><P >This is an example of the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >notfound</I ></SPAN > section: <PRE CLASS="programlisting" > <!--notfound--> <CENTER> Sorry, search did not find any results.<P> <I>Try to compose a less restrictive search query or check spelling.</I> </CENTER> <HR> <!--/notfound--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="noquery-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >noquery</I ></SPAN > section</A ></H3 ><A NAME="AEN5528" ></A ><P > This section is displayed in case when the user gives an empty search query. For example: <PRE CLASS="programlisting" > <!--noquery--> <CENTER> You didn't type any words to search for. </CENTER> <HR> <!--/noquery--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="error-section" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >error</I ></SPAN > section</A ></H3 ><A NAME="AEN5536" ></A ><P > This section is displayed in case when some internal error occurred while searching. For example, when the database server is not available. You can use the <A NAME="AEN5540" ></A > <CODE CLASS="varname" >$(E)</CODE > variable to print the error text: <PRE CLASS="programlisting" > <!--error--> <CENTER> <FONT COLOR="#FF0000">An error occurred!</FONT> <P> <B>$(E)</B> </CENTER> <!--/error--> </PRE > </P ></DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="templates-var" >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >variables</I ></SPAN > section <A NAME="AEN5548" ></A ></A ></H3 ><P >This is a special section were you put configuration commands. </P ><P >The <SPAN CLASS="emphasis" ><I CLASS="emphasis" >variables</I ></SPAN > section can look like this: </P ><DIV CLASS="informalexample" ><P ></P ><A NAME="AEN5554" ></A ><PRE CLASS="programlisting" > <!--variables DBAddr mysql://foo:bar@localhost/search/?DBMode=blob LocalCharset iso-8859-1 BrowserCharset iso-8859-1 TrackQuery yes DetectClones yes HlBeg <font color="blue"><b><i> HlEnd </i></b> R1 100 Synonym synonym/english.syn --> </PRE ><P ></P ></DIV >The typical configuration commands are: <A HREF="msearch-cmdref-dbaddr.html" >DBAddr</A >, <A HREF="msearch-cmdref-localcharset.html" >LocalCharset</A >, <A HREF="msearch-cmdref-browsercharset.html" >BrowserCharset</A >, <A HREF="msearch-cmdref-detectclones.html" >DetectClones</A >, <A HREF="msearch-cmdref-groupbysite.html" >GroupBySite</A >, <A HREF="msearch-cmdref-hlbeg.html" >HlBeg</A >, <A HREF="msearch-cmdref-hlend.html" >HlEnd</A >, <A HREF="msearch-cmdref-dateformat.html" >DateFormat</A >. See <A HREF="msearch-cmdref.html" >Reference I, <I ><SPAN CLASS="application" >mnoGoSearch</SPAN > command reference</I ></A > for the description of all available commands. </DIV ><DIV CLASS="sect3" ><H3 CLASS="sect3" ><A NAME="templates-var-another" >Using the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >variables</I ></SPAN > section with operators <A NAME="AEN5568" ></A ></A ></H3 ><P >You can also use another <SPAN CLASS="emphasis" ><I CLASS="emphasis" >variables</I ></SPAN > section in combination with all operators supported by the <SPAN CLASS="application" >mnoGoSearch</SPAN > template language. You can set some variable values which will be used during search, for example search limits. </P ><P > <P ><B >Examples:</B ></P > <DIV CLASS="informalexample" ><P ></P ><A NAME="AEN5576" ></A ><PRE CLASS="programlisting" > <!--variables--> <!SET NAME="ul" CONTENT="/path/"> <!--/variable--> </PRE ><P ></P ></DIV > </P ></DIV ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="templates-incl" >Includes in templates</A ></H2 ><P >You can use the <TT CLASS="literal" ><!INCLUDE Content="http://hostname/path"></TT > operator to include content of an external document into search results. </P ><P > <SPAN CLASS="emphasis" ><I CLASS="emphasis" > WARNING: <TT CLASS="literal" ><!INCLUDE></TT > works only in the following template sections: </I ></SPAN > </P ><P CLASS="literallayout" ><br> <TT CLASS="literal" ><!--top--></TT ><br> <TT CLASS="literal" ><!--bottom--></TT ><br> <TT CLASS="literal" ><!--restop--></TT ><br> <TT CLASS="literal" ><!--resbot--></TT ><br> <TT CLASS="literal" ><!--notfound--></TT ><br> <TT CLASS="literal" ><!--error--></TT ><br> </P ><P > <P ><B >Example:</B ></P > <DIV CLASS="informalexample" ><P ></P ><A NAME="AEN5594" ></A ><PRE CLASS="programlisting" > <!--top--> .... <!INCLUDE CONTENT="http://hostname/banner?query=$&(q)"> ... <!--/top--> </PRE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="templates-sec" >Security issues</A ></H2 ><P > <SPAN CLASS="emphasis" ><I CLASS="emphasis" >WARNING</I ></SPAN >: Since the template file contains secure information such as database password, it is recommended to give proper permissions to the template file to protect it from reading by anyone but you and the search program. Otherwise your passwords may leak. </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="msearch-doingsearch.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="msearch-html.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Searching documents</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="msearch-doingsearch.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Designing <TT CLASS="filename" >search.htm</TT ></TD ></TR ></TABLE ></DIV ><!--#include virtual="body-after.html"--></BODY ></HTML >