File: msearch-templates.html

package info (click to toggle)
mnogosearch 3.3.7-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 17,484 kB
  • ctags: 4,565
  • sloc: ansic: 94,097; xml: 16,864; sh: 8,915; makefile: 1,727; perl: 801; php: 561; sql: 15
file content (2021 lines) | stat: -rw-r--r-- 40,861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
<!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.7 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.html"
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"
>mnoGoSearch 3.3.7 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 8. 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="AEN3225"
></A
></A
></H1
><P
>mnoGoSearch users have an ability to customize search
results (output of <TT
CLASS="filename"
>search.cgi</TT
> or
<TT
CLASS="filename"
>search.php</TT
>). You may do it by providing a template
<TT
CLASS="filename"
>search.htm</TT
> file, which should be located in the /etc/
directory of mnoGoSearch's installation.</P
><P
>The template file is an usual HTML file, which is divided into
sections. Keep in mind that you can just open the template file in your
favorite browser and get the idea of how the search results will look
like.</P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>Each template line should not exceed 1024 bytes.</P
></BLOCKQUOTE
></DIV
><P
>Each section begins with &#60;!--sectionname--&#62; and
ends with &#60;!--/sectionname--&#62; delimiters, which should reside on
a separate line.</P
><P
>Each section consists of HTML formatted text with
special meta symbols. Every meta symbol is replaced by it's
corresponding string. You can think of meta symbols as of variables,
which will have their appropriate values while displaying search
results.</P
><P
>Format of variables is the following:
	<PRE
CLASS="programlisting"
>&#13;$(x)	- plain value
$&#38;(x)	- HTML-escaped value and search words highlighted.
$%(x) 	- value escaped to be used in URLs
$^(x) 	- search words highlighted.
</PRE
>
</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="templates-sect"
>Template sections
<A
NAME="AEN3240"
></A
></A
></H2
><P
>The following section names are defined:</P
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="top-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>TOP</I
></SPAN
> section</A
></H3
><A
NAME="AEN3247"
></A
><P
>&#13;This section is
included first on every page. You should begin this section with
&#60;HTML&#62;&#60;HEAD&#62; and so on. Also, this is a definitive place
to provide a search form. There are several special meta symbols you may
use in this section:

		<PRE
CLASS="programlisting"
>&#13;$(self)  - argument for FORM ACTION tag
$(q)     - a search query
$(cat)   - current category value
$(tag)   - current tag value
$(rN)    - random number (here N is a number)
</PRE
>
</P
><P
>If you want to include some random banners on
your pages, please use $(rN). You should also place string like "RN
xxxx" in 'variables' section (see below), which will give you a range
0..xxxx for $(rN). You can use up as many random numbers as you
want.</P
><P
>Example: <TT
CLASS="literal"
>$(r0), $(r1), $(r45)</TT
> etc.</P
><P
>Simple <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>top</I
></SPAN
> section should be like this:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--top--&#62;
&#60;HTML&#62;
&#60;HEAD&#62;
 &#60;TITLE&#62;mnoGoSearch: $(q)&#60;/TITLE&#62;
&#60;/HEAD&#62;
&#60;BODY&#62;

&#60;FORM METHOD=GET ACTION="$(self)"&#62;
 &#60;INPUT TYPE="hidden" NAME="ul" VALUE=""&#62;
 &#60;INPUT TYPE="hidden" NAME="ps" VALUE="20"&#62;
 Search for: &#60;INPUT TYPE="text" NAME="q" SIZE=30 
 VALUE="$&#38;(q)"&#62;
 &#60;INPUT TYPE="submit" VALUE="Search!"&#62;&#60;BR&#62;
&#60;/FORM&#62;
&#60;!--/top--&#62;
</PRE
>
</P
><P
>Some variables are defined in FORM.</P
><P
>&#13;			<TT
CLASS="literal"
>lang</TT
> limits results by language. The value is a two-letter language code.
			<PRE
CLASS="programlisting"
>&#13;&#60;SELECT NAME="lang"&#62;
&#60;OPTION VALUE="en" SELECTED="$(lang)"&#62;English
.....
&#60;/SELECT&#62;
    </PRE
>
</P
><P
>&#13;			<TT
CLASS="literal"
>ul</TT
> is the filter for
URL. It allows you to limit results to particular site or section
etc. For example, you can put the following in the form</P
><P
>Search through:
			<PRE
CLASS="programlisting"
>&#13;&#60;SELECT NAME="ul"&#62;
&#60;OPTION VALUE=""            SELECTED="$(ul)"&#62;Entire site
&#60;OPTION VALUE="/manual/"    SELECTED="$(ul)"&#62;Manual
&#60;OPTION VALUE="/products/"  SELECTED="$(ul)"&#62;Products
&#60;OPTION VALUE="/support/"   SELECTED="$(ul)"&#62;Support
&#60;/SELECT&#62;
</PRE
>
</P
><P
>to limit your search to particular section.</P
><P
>The expression
<TT
CLASS="literal"
>SELECTED="$(ul)"</TT
> in the above example (and all the
examples below) allows the selected option to be reproduced on the next
pages. If the search front-end finds that expression it prints the string
SELECTED only in the case the OPTION VALUE given is equal to that
variable.</P
><P
>&#13;			<TT
CLASS="literal"
>ps</TT
> is the default page size (e.g. how many documents are displayed per page).</P
><P
>&#13;			<TT
CLASS="literal"
>q</TT
> is the query itself.</P
><P
>&#13;			<TT
CLASS="literal"
>pn</TT
> is ps*np. This variable
is not used by mnoGoSearch, but may be useful for example in
&#60;!INCLUDE CONTENT="..."&#62; directive if you want to include results
produced by another search engine.</P
><P
>Following variables are concerning advanced search capabilities:</P
><P
></P
><UL
><LI
><P
>&#13;					<TT
CLASS="literal"
>m</TT
> can be
used to choose the default search type if your query consists of more than
one word and no boolean operators given. If m=any, the search will try to find at least one
word. If case m=all, the search is more restrictive - all words should
be in the document.
		</P
></LI
><LI
><P
>&#13;					<TT
CLASS="literal"
>dt</TT
> is a time limiting type. There are three types supported.</P
><P
>If 'dt' is 'back', that means
you want to limit the results to recent pages, and you should specify this
"recentness" in variable 'dp' in the form
<TT
CLASS="literal"
>xxxA[yyyB[zzzC]]</TT
>. Spaces are allowed between xxx
and A and yyy and so on). xxx, yyy, zzz are numbers (can be negative!).
A, B, C can be one of the following (the letters are the same as in
strptime/strftime	functions):

				<PRE
CLASS="programlisting"
>&#13; s - second
 M - minute
 h - hour
 d - day
 m - month
 y - year
</PRE
>
</P
><P
>Examples:
				<PRE
CLASS="programlisting"
>&#13;  4h30m     - 4 hours and 30 minutes
  1Y6M-15d  - 1 year and six month minus 15 days
  1h-60m+1s - 1 hour minus 60 minutes plus 1 second
</PRE
>
</P
><P
>If 'dt' is 'er' (which is short
for newer/older), that means the search	will be limited to pages newer
or older than the date given. Variable dx is newer/older flag (1 means
"newer" or "after", -1 means "older" or "before"). The date is separated
into fields as follows:

				<PRE
CLASS="programlisting"
>&#13;  'dm' - month (0 - January, 1 - February, .., 11 - December)
  'dy' - year (four digits, for example 1999 or 2000)
  'dd' - day (1...31)
</PRE
>
</P
><P
>If 'dt' is 'range', it means
the search is done within a given range of dates. Variables 'db' and 'de' are used
here and stand for beginning and end date. Each date is a string in the
form dd/mm/yyyy, where dd is the day, mm is the month and yyyy is a four-digits
year.</P
><P
>&#13;				You can also use 'dstmp' variable in
combination with 'dx' to specify date limit in seconds since 00:00:00 UTC, January 1, 1970.
If 'dx' is -1 then search returns documents older than the given 'dstmp' value,
otherwise, newer than the given 'dstmp' value.
				</P
><P
>This is the example of FORM part where you can choose between different time limiting options.
					<PRE
CLASS="programlisting"
>&#13;&#60;!-- 'search with time limits' options --&#62;
&#60;TR&#62;&#60;TD&#62;
&#60;TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0&#62;
&#60;CAPTION&#62; 
Limit results to pages published within
a specified period of time.&#60;BR&#62;
&#60;FONT SIZE=-1&#62;&#60;I&#62;(Please select only one option)
&#60;/I&#62;&#60;/FONT&#62;
&#60;/CAPTION&#62;
&#60;TR&#62;
&#60;TD VALIGN=center&#62;&#60;INPUT TYPE=radio NAME="dt" 
VALUE="back" CHECKED&#62;&#60;/TD&#62;
&#60;TD&#62;&#60;SELECT NAME="dp"&#62;
&#60;OPTION VALUE="0" SELECTED="$(dp)"&#62;anytime
&#60;OPTION VALUE="10M" SELECTED="$(dp)"&#62;within the last ten minutes
&#60;OPTION VALUE="1h" SELECTED="$(dp)"&#62;within the last hour
&#60;OPTION VALUE="7d" SELECTED="$(dp)"&#62;within the last week
&#60;OPTION VALUE="14d" SELECTED="$(dp)"&#62;within the last 2 weeks
&#60;OPTION VALUE="1m" SELECTED="$(dp)"&#62;within the last month
&#60;OPTION VALUE="3m" SELECTED="$(dp)"&#62;within the last 3 months
&#60;OPTION VALUE="6m" SELECTED="$(dp)"&#62;within the last 6 months
&#60;OPTION VALUE="1y" SELECTED="$(dp)"&#62;within the last year
&#60;OPTION VALUE="2y" SELECTED="$(dp)"&#62;within the last 2 years
&#60;/SELECT&#62;
&#60;/TD&#62;
&#60;/TR&#62;
&#60;TR&#62;
&#60;TD VALIGN=center&#62;&#60;INPUT type=radio NAME="dt" VALUE="er"&#62;
&#60;/TD&#62;
&#60;TD&#62;&#60;SELECT NAME="dx"&#62;
&#60;OPTION VALUE="1" SELECTED="$(dx)"&#62;After
&#60;OPTION VALUE="-1" SELECTED="$(dx)"&#62;Before
&#60;/SELECT&#62;
</PRE
>
</P
><P
>or on
					<PRE
CLASS="programlisting"
>&#13;&#60;SELECT NAME="dm"&#62;
&#60;OPTION VALUE="0" SELECTED="$(dm)"&#62;January
&#60;OPTION VALUE="1" SELECTED="$(dm)"&#62;February
&#60;OPTION VALUE="2" SELECTED="$(dm)"&#62;March
&#60;OPTION VALUE="3" SELECTED="$(dm)"&#62;April
&#60;OPTION VALUE="4" SELECTED="$(dm)"&#62;May
&#60;OPTION VALUE="5" SELECTED="$(dm)"&#62;June
&#60;OPTION VALUE="6" SELECTED="$(dm)"&#62;July
&#60;OPTION VALUE="7" SELECTED="$(dm)"&#62;August
&#60;OPTION VALUE="8" SELECTED="$(dm)"&#62;September
&#60;OPTION VALUE="9" SELECTED="$(dm)"&#62;October
&#60;OPTION VALUE="10" SELECTED="$(dm)"&#62;November
&#60;OPTION VALUE="11" SELECTED="$(dm)"&#62;December
&#60;/SELECT&#62;
&#60;INPUT TYPE=text NAME="dd" VALUE="$(dd)" SIZE=2 maxlength=2&#62;
,
&#60;SELECT NAME="dy" &#62;
&#60;OPTION VALUE="1990" SELECTED="$(dy)"&#62;1990
&#60;OPTION VALUE="1991" SELECTED="$(dy)"&#62;1991
&#60;OPTION VALUE="1992" SELECTED="$(dy)"&#62;1992
&#60;OPTION VALUE="1993" SELECTED="$(dy)"&#62;1993
&#60;OPTION VALUE="1994" SELECTED="$(dy)"&#62;1994
&#60;OPTION VALUE="1995" SELECTED="$(dy)"&#62;1995
&#60;OPTION VALUE="1996" SELECTED="$(dy)"&#62;1996
&#60;OPTION VALUE="1997" SELECTED="$(dy)"&#62;1997
&#60;OPTION VALUE="1998" SELECTED="$(dy)"&#62;1998
&#60;OPTION VALUE="1999" SELECTED="$(dy)"&#62;1999
&#60;OPTION VALUE="2000" SELECTED="$(dy)"&#62;2000
&#60;OPTION VALUE="2001" SELECTED="$(dy)"&#62;2001
&#60;/SELECT&#62;
&#60;/TD&#62;
&#60;/TR&#62;
&#60;/TR&#62;
&#60;TD VALIGN=center&#62;&#60;INPUT TYPE=radio NAME="dt" VALUE="range"&#62;
&#60;/TD&#62;
&#60;TD&#62;
Between
&#60;INPUT TYPE=text NAME="db" VALUE="$(db)" SIZE=11 MAXLENGTH=11&#62;
and
&#60;INPUT TYPE=text NAME="de" VALUE="$(de)" SIZE=11 MAXLENGTH=11&#62;
&#60;/TD&#62;
&#60;/TR&#62;
&#60;/TABLE&#62;
&#60;/TD&#62;&#60;/TR&#62;
&#60;!-- end of stl options --&#62;
</PRE
>
</P
></LI
></UL
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="bottom-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>BOTTOM</I
></SPAN
> section</A
></H3
><A
NAME="AEN3299"
></A
><P
>&#13;This section is always included last in every page, so you should provide all closing
tags which have their counterparts in the top section. It is not
obligatory to place this section at the end of the template file, but
doing so will help you to view your template as an ordinary html file
in a browser to get the idea how it looks like.</P
><P
>Below is an example of bottom section:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--bottom--&#62;
&#60;P&#62;
&#60;HR&#62;
&#60;DIV ALIGN=right&#62;
&#60;A HREF="http://search.mnogo.ru/"&#62;
&#60;IMG SRC="mnogosearch.gif" BORDER=0 
ALT="[Powered by mnoGoSearch search engine software]"&#62;
&#60;/A&#62;
&#60;/BODY&#62;
&#60;/HTML&#62;
&#60;!--/bottom--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="restop-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>RESTOP</I
></SPAN
> section</A
></H3
><A
NAME="AEN3308"
></A
><P
>&#13;This section is included just before the search results. It's a good idea to provide
some common search results. You can do so by using the next meta
symbols:</P
><P
></P
><UL
><LI
><P
>&#13;<A
NAME="AEN3315"
></A
>
					<TT
CLASS="literal"
>$(first)</TT
> - number of the First document displayed on this page</P
></LI
><LI
><P
>&#13;<A
NAME="AEN3321"
></A
>
					<TT
CLASS="literal"
>$(last)</TT
>  - number of the Last document displayed on this page</P
></LI
><LI
><P
>&#13;<A
NAME="AEN3327"
></A
>
					<TT
CLASS="literal"
>$(total)</TT
> - total number of found documents</P
></LI
><LI
><P
>&#13;<A
NAME="AEN3333"
></A
>
					<TT
CLASS="literal"
>$(WE)</TT
> - search results with full statistics of every word form search</P
></LI
><LI
><P
>&#13;<A
NAME="AEN3339"
></A
>
					<TT
CLASS="literal"
>$(W)</TT
> -
search results with information about the count of exact search word form
found and the number of all search word forms found, delimited with "/" sign
for every search word, e.g. if the search result is <TT
CLASS="literal"
>test:
25/73</TT
>, it means that the number of word form "test" found is
25, and the number of all its forms ("test", "tests", "testing", etc.)
found is 73.

				</P
></LI
><LI
><P
>&#13;<A
NAME="AEN3346"
></A
>
<TT
CLASS="literal"
>$(SearchTime)</TT
> - search query execution time.
</P
></LI
><LI
><P
>&#13;<A
NAME="AEN3352"
></A
>
<TT
CLASS="literal"
>$(CurrentTimestamp)</TT
> - current time, in seconds since 
00:00:00 UTC, January 1, 1970.
</P
></LI
><LI
><P
>&#13;<A
NAME="AEN3358"
></A
>
<TT
CLASS="literal"
>$(ndocs)</TT
> - number of documents in database.
</P
></LI
></UL
><P
>Below is an example of 'restop' section:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--restop--&#62;
&#60;TABLE BORDER=0 WIDTH=100%&#62;
&#60;TR&#62;
&#60;TD&#62;Search&#60;BR&#62;results:&#60;/TD&#62;
&#60;TD&#62;&#60;small&#62;$(WE)&#60;/small&#62;&#60;/TD&#62;
&#60;TD&#62;&#60;small&#62;$(W)&#60;/small&#62;&#60;/TD&#62;
&#60;/TR&#62;
&#60;/TABLE&#62;
&#60;HR&#62;
&#60;CENTER&#62;
Displaying documents $(first)-$(last) of total &#60;B&#62;$(total)&#60;/B&#62; found.
&#60;/CENTER&#62;
&#60;!--/restop--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="res-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>RES</I
></SPAN
> section</A
></H3
><A
NAME="AEN3367"
></A
><P
>&#13;This section is used for displaying various information about every found
document. The following meta symbols are used:</P
><P
></P
><UL
><LI
><A
NAME="AEN3373"
></A
><P
>$(URL)  Document URL</P
></LI
><LI
><A
NAME="AEN3378"
></A
><P
>$(Title)  Document Title</P
></LI
><LI
><A
NAME="AEN3383"
></A
><P
>$(Score)  Document Rating (as calculated by mnoGoSearch)</P
></LI
><LI
><A
NAME="AEN3388"
></A
><P
>$(Body)  Document text, the document
excerpt if CachedCopy feature is used, or the first couple of lines otherwise, to give an idea of what the document is about.</P
></LI
><LI
><A
NAME="AEN3393"
></A
><P
>$(Content-Type)  Document Content-type (for example, text/html)</P
></LI
><LI
><A
NAME="AEN3398"
></A
><P
>$(Last-Modified)  Document Last-Modified date</P
></LI
><LI
><A
NAME="AEN3403"
></A
><P
>$(Last-Modified-Timestamp)  Document Last-Modified date
as a number of seconds since 00:00:00 UTC, January 1, 1970.</P
></LI
><LI
><A
NAME="AEN3408"
></A
><P
>$(Content-Length)  Document Size (in bytes)</P
></LI
><LI
><A
NAME="AEN3413"
></A
><P
>$(Content-Length-K)  Document Size (in kilobytes)</P
></LI
><LI
><A
NAME="AEN3418"
></A
><P
>$(Order)  Document Number (in order of appearance)</P
></LI
><LI
><A
NAME="AEN3423"
></A
><P
>$(DBOrder) Original Database Document Order -
			 the original order of a document in its database result,
			 before multiple DAddr search results were merged into
			 the final result. It is equal to $(Order) when using only
			 a single DBAddr command in search.htm. This
			 variable is mostly for debugging purposes.
			</P
></LI
><LI
><A
NAME="AEN3428"
></A
><P
>$(DBNum) Database Number -
			 the number of the database generated this 
			 document, in order of DBAddr commands appearance 
			 in search.htm. 0 means that the document was
			 found in the database corresponding to the first
			 DBAddr command, 1 - to the second DBAddr command,
			 and so on. $(DBNum) is always 0 when using only
			 a single DBAddr command in search.htm. This
			 variable is mostly for debugging purposes.
			</P
></LI
><LI
><A
NAME="AEN3433"
></A
><P
>$(meta.description)  Document Description (from META DESCRIPTION tag)</P
></LI
><LI
><A
NAME="AEN3438"
></A
><P
>$(meta.keywords)  Document Keywords (from META KEYWORDS tag)</P
></LI
><LI
><A
NAME="AEN3443"
></A
><P
>$(DY)  Document category with links, i.e. <TT
CLASS="filename"
>/home/computers/software/www/</TT
>
				</P
></LI
><LI
><A
NAME="AEN3449"
></A
><P
>$(CL) Clone List (see <A
HREF="msearch-templates.html#clone-section"
>the Section called <I
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>CLONE</I
></SPAN
> section</I
></A
>
				for details). This variable is available in
				mnoGoSearch versions prior to 3.3.0.
				Starting from the version 3.3.0 one should
				use $(CloneN.URL) variables instead.
				</P
></LI
><LI
><A
NAME="AEN3455"
></A
><P
>$(CloneN.URL) URL of the Nth clone, where N is a number starting
				from 0. The CloneN variables appeared in mnoGoSearch 3.3.0.
				</P
></LI
><LI
><A
NAME="AEN3460"
></A
><P
>$(BrowserCharset)  Charset used to display search results</P
></LI
><LI
><A
NAME="AEN3465"
></A
><P
>$(PerSite)  Total number of document from this site, if grouping by site is enabled, =0 otherwise.</P
></LI
></UL
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
    It is possible to specify the maximum number of characters returned by
any of the above variables. E.g. <CODE
CLASS="varname"
>$(URL)</CODE
> may return a
long URL that may break page table structure. To specify maximum
number of characters in the displayed URLs, use
<TT
CLASS="literal"
>$(URL:xx)</TT
>, where <TT
CLASS="literal"
>xx</TT
> - maximum
number of characters:</P
><P
>&#13;				<KBD
CLASS="userinput"
>$(URL:40)</KBD
>
			</P
><P
>will return a URL, and if it is longer
than 40 character, only 40 characters will be displayed including the
ending points:</P
><P
>&#13;				<KBD
CLASS="userinput"
>http://very.long.url/path/veery/long/...</KBD
>
			</P
><P
>&#13;			Since version 3.3.1, it is also possible to display the rightmost characters:
			</P
><P
>&#13;				<KBD
CLASS="userinput"
>$(URL:-40)</KBD
>
			</P
></BLOCKQUOTE
></DIV
><P
>Here is an example of res section:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--res--&#62;
&#60;DL&#62;&#60;DT&#62;
&#60;b&#62;$(Order).&#60;/b&#62;&#60;a href="$(URL)" TARGET="_blank"&#62;
&#60;b&#62;$(Title)&#60;/b&#62;&#60;/a&#62; [&#60;b&#62;$(Score)&#60;/b&#62;]&#60;DD&#62;
$(Body)...&#60;BR&#62;
&#60;b&#62;URL: &#60;/b&#62;
&#60;A HREF="$(URL)" TARGET="_blank"&#62;$(URL)&#60;/A&#62;($(Content-Type))&#60;BR&#62;
$(Last-Modified), $(Content-Length) bytes&#60;BR&#62;
&#60;b&#62;Description: &#60;/b&#62;$(meta.description)&#60;br&#62;
&#60;b&#62;Keywords: &#60;/b&#62;$(meta.keywords)&#60;br&#62;
&#60;/DL&#62;
&#60;UL&#62;
$(CL)
&#60;/UL&#62;
&#60;!--/res--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="clone-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>CLONE</I
></SPAN
> section</A
></H3
><A
NAME="AEN3487"
></A
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
	This section is supported in mnoGoSearch versions prior to 3.3.0.
	Starting from 3.3.0, it was removed. The $(CloneN.URL) variables
	were introduced as a replacement.
	</P
></BLOCKQUOTE
></DIV
><P
>&#13;The contents of this section is included in result just instead of $(CL) meta symbol for
every document clone found. This is used to provide all URLs with the
same contents (like mirrors etc.). You can use the same meta
symbols here as in the 'res' section. Of course, some information about
the clone, like $(Body) or $(Title) will be  the same so it is of little
use to place it here.</P
><P
>Below is an example of 'clone' section.
			<PRE
CLASS="programlisting"
>&#13;&#60;!--clone--&#62;
&#60;li&#62;&#60;A HREF="$(URL)" TARGET="_blank"&#62;$(URL)&#60;/A&#62; $(Last-Modified)
&#60;!--/clone--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="resbot-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>RESBOT</I
></SPAN
> section</A
></H3
><A
NAME="AEN3498"
></A
><P
>&#13;This is included just after the last 'res' section. You usually give a navigation bar here
to allow user go to next/previous results page.</P
><P
>This is an example of 'resbot' section:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--resbot--&#62;
&#60;HR&#62;
&#60;CENTER&#62;
Result pages: $(NL)$(NB)$(NR)
&#60;/CENTER&#62;
&#60;!--/resbot--&#62;
</PRE
>
</P
></DIV
><P
>A navigator is a complex thing and therefore it is
constructed from the following template sections:</P
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="navleft-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>navleft, navleft_nop</I
></SPAN
> section</A
></H3
><P
>These are used to print the link to the
previous page. If that page exists, &#60;!--navleft--&#62; is used, and
on the first page there is no previous page, so
&#60;!--navleft_nop--&#62; is used.
			<PRE
CLASS="programlisting"
>&#13;&#60;!--navleft--&#62;
&#60;TD&#62;&#60;A HREF="$(NH)"&#62;&#60;IMG...&#62;&#60;/A&#62;&#60;BR&#62;
&#60;A HREF="$(NH)"&#62;Prev&#60;/A&#62;&#60;/TD&#62;
&#60;!--/navleft--&#62;

&#60;!--navleft_nop--&#62;
&#60;TD&#62;&#60;IMG...&#62;&#60;BR&#62;
&#60;FONT COLOR=gray&#62;Prev&#60;/FONT&#62;&#60;/TD&#62;
&#60;!--/navleft_nop--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="navbar0-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>navbar0</I
></SPAN
> section</A
></H3
><A
NAME="AEN3513"
></A
><P
>&#13;This is used for printing the current page in the page list.
			<PRE
CLASS="programlisting"
>&#13;&#60;!--navbar0--&#62;
&#60;TD&#62;&#60;IMG...&#62;&#60;BR&#62;$(NN)&#60;/TD&#62;
&#60;!--navbar0--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="navright-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>navright, navright_nop</I
></SPAN
> section</A
></H3
><A
NAME="AEN3521"
></A
><P
>&#13;These are used to print the link to the next page. If that page
exists, &#60;!--navright--&#62; is used, and on the last page
&#60;!--navright_nop--&#62; is used instead.
			<PRE
CLASS="programlisting"
>&#13;&#60;!--navright--&#62;
&#60;TD&#62;
&#60;A HREF="$(NH)"&#62;&#60;IMG...&#62;&#60;/A&#62;
&#60;BR&#62;
&#60;A HREF="$(NH)"&#62;Next&#60;/A&#62;&#60;/TD&#62;
&#60;!--/navright--&#62;

&#60;!--navright_nop--&#62;
&#60;TD&#62;
&#60;IMG...&#62;
&#60;BR&#62;
&#60;FONT COLOR=gray&#62;Next&#60;/FONT&#62;&#60;/TD&#62;
&#60;!--/navright_nop--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="navbar1-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>navbar1</I
></SPAN
> section</A
></H3
><A
NAME="AEN3529"
></A
><P
>&#13;This is used to print the links to the other pages in the page list.
			<PRE
CLASS="programlisting"
>&#13;&#60;!--navbar1--&#62;
&#60;TD&#62;
&#60;A HREF="$(HR)"&#62;
&#60;IMG...&#62;&#60;/A&#62;&#60;BR&#62;
&#60;A HREF="$(NH)"&#62;$(NN)&#60;/A&#62;
&#60;/TD&#62;
&#60;!--/navbar1--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="notfound-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>notfound</I
></SPAN
> section</A
></H3
><A
NAME="AEN3537"
></A
><P
>&#13;As its name
implies, this section is displayed in case no documents are
found. You usually give a little message saying so, and maybe some
hints how to make search less restrictive.</P
><P
>Below is an example of notfound section:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--notfound--&#62;
&#60;CENTER&#62;
Sorry, but search hasn't returned results.&#60;P&#62;
&#60;I&#62;Try to compose less restrictive search query or check spelling.&#60;/I&#62;
&#60;/CENTER&#62;
&#60;HR&#62;
&#60;!--/notfound--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="noquery-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>noquery</I
></SPAN
> section</A
></H3
><A
NAME="AEN3546"
></A
><P
>&#13;This section is displayed in case the user gives an empty query. Below is an example
of noquery section:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--noquery--&#62;
&#60;CENTER&#62;
You haven't typed any word(s) to search for.
&#60;/CENTER&#62;
&#60;HR&#62;
&#60;!--/noquery--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="error-section"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>error</I
></SPAN
> section</A
></H3
><A
NAME="AEN3554"
></A
><P
>&#13;This section is displayed in case some internal error occurred while searching. For
example, database server is not running or so. You may provide the
following meta symbol:<A
NAME="AEN3558"
></A
>
<TT
CLASS="literal"
>$(E)</TT
> - error text.
</P
><P
>Example of error section:
			<PRE
CLASS="programlisting"
>&#13;&#60;!--error--&#62;
&#60;CENTER&#62;
&#60;FONT COLOR="#FF0000"&#62;An error occurred!&#60;/FONT&#62;
&#60;P&#62;
&#60;B&#62;$(E)&#60;/B&#62;
&#60;/CENTER&#62;
&#60;!--/error--&#62;
</PRE
>
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-var"
>Variables section
<A
NAME="AEN3566"
></A
></A
></H3
><P
>There is also a special variables section, in which you
		can set up some values for search. </P
><P
>Variables section usually looks like this:</P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN3571"
></A
><PRE
CLASS="programlisting"
>&#13;&#60;!--variables
DBAddr		mysql://foo:bar@localhost/search/
DBMode		single
VarDir          /usr/local/mnogosearch/var/
LocalCharset	iso-8859-1
BrowserCharset  iso-8859-1
TrackQuery	no
Cache		no
DetectClones	yes
HlBeg		&#60;font color="blue"&#62;&#60;b&#62;&#60;i&#62;
HlEnd		&#60;/i&#62;&#60;/b&#62;
R1		100
R2		256
Synonym		synonym/english.syn
--&#62;
</PRE
><P
></P
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><A
NAME="AEN3574"
></A
><P
><B
>Note: </B
>Database option
<B
CLASS="command"
>DBAddr</B
>. Like in
<TT
CLASS="filename"
>indexer.conf</TT
>, the host part in DBAddr argument takes
effect for natively supported databases only and does not matter for
ODBC databases. In case you are using ODBC, use the database name part of DBAddr to
specify the ODBC DSN.</P
></BLOCKQUOTE
></DIV
><P
>&#13;<A
NAME="AEN3581"
></A
>
			<B
CLASS="command"
>VarDir</B
> command specifies a
custom path to a directory that  the indexer stores data to when used with
cache mode. By default, the 
<TT
CLASS="filename"
>/var</TT
> directory of mnoGoSearch's installation is
used.</P
><P
>&#13;<A
NAME="AEN3587"
></A
>
			<B
CLASS="command"
>LocalCharset</B
> specifies a
database charset. It must be the same than
<TT
CLASS="filename"
>indexer.conf</TT
> LocalCharset. </P
><P
>&#13;<A
NAME="AEN3593"
></A
>
			<B
CLASS="command"
>BrowserCharset</B
> specifies
which charset will be used to display the results. It may differ from
LocalCharset. All template variables which correspond to data from search
result (such as document title, description, text) will be converted
from LocalCharset to BrowserCharset. The contents of the template itself are
not converted, it must be in BrowserCharset.</P
><A
NAME="AEN3597"
></A
><P
>Use "<B
CLASS="command"
>Cache</B
> yes/no" to enable/disable search results cache.</P
><A
NAME="AEN3602"
></A
><P
>Use "<B
CLASS="command"
>Clone</B
> yes/no" to enable/disable clones detection.</P
><P
><A
NAME="AEN3608"
></A
>
Use "<B
CLASS="command"
>GroupBySite</B
> yes/no" to enable/disable grouping results by url.site_id.</P
><P
>&#13;<A
NAME="AEN3613"
></A
>
<A
NAME="AEN3616"
></A
>
			<B
CLASS="command"
>HlBeg</B
> and
<B
CLASS="command"
>HlEnd</B
> commands are used to configure search results
highlighting. Found words will be surrounded in those tags.</P
><A
NAME="AEN3621"
></A
><P
>There is an <B
CLASS="command"
>Alias</B
> command in <TT
CLASS="filename"
>search.htm</TT
>, that is similar to the one in
<TT
CLASS="filename"
>indexer.conf</TT
>, but it affects only search results
while having no effect on indexing. See <A
HREF="msearch-indexer-configuration.html#aliases"
>the Section called <I
>Aliases</I
> in Chapter 3</A
> for details.</P
><P
>&#13;<A
NAME="AEN3630"
></A
>
			<B
CLASS="command"
>R1</B
> and <B
CLASS="command"
>R2</B
> specify ranges for random variables $(R1) and $(R2).</P
><A
NAME="AEN3635"
></A
><P
>The <B
CLASS="command"
>Synonym</B
> command is used to load a specified
synonyms list. Synonyms file name is either absolute or relative to
the <TT
CLASS="filename"
>/etc</TT
> directory of mnoGoSearch's installation.</P
><P
><A
NAME="AEN3642"
></A
>
The <B
CLASS="command"
>DateFormat</B
> command is used to change Last-Modified date format output.
Use <TT
CLASS="literal"
>strftime</TT
> function meta-variables for your own format string.
</P
><P
><A
NAME="AEN3648"
></A
>
The "<B
CLASS="command"
>Log2stderr</B
> yes/no" command is used to enable error logging to <TT
CLASS="literal"
>stderr</TT
>.
</P
><P
>&#13;<A
NAME="AEN3654"
></A
>
The <B
CLASS="command"
>ResultsLimit</B
> command is used to give the maximum number of results shown.
</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-var-another"
>Using variables section with operators
<A
NAME="AEN3660"
></A
></A
></H3
><P
>You can also use a special variables section
                in combination with operators supported by
                <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
>&#13;                Examples:
		<DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN3666"
></A
><PRE
CLASS="programlisting"
>&#13;&#60;!--variables--&#62;
&#60;!SET NAME="ul" CONTENT="/path/"&#62;
&#60;!--/variable--&#62;
</PRE
><P
></P
></DIV
>
                </P
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="templates-oper"
>Template operators</A
></H2
><P
><SPAN
CLASS="application"
>mnoGoSearch</SPAN
> template language
  provides a set of operators making it possible to create templates
  with complicated logic.
  </P
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-if"
>Conditional operators</A
></H3
><P
><SPAN
CLASS="application"
>mnoGoSearch</SPAN
>
    supports several conditional operators in search templates:
    IF, IFCS, IFNOT, IFLIKE, ELSEIF (ELIF), ELSELIKE (ELIKE),
    IFLE, IFLT, IFGE, IFGT.
    Comparison is performed case insensitively for IF, IFNOT, IFLIKE,
    ELSEIF, ELSELIKE, and case sensitively for IFCS. Operators IFLE,
    IFLT, IFGE, IFGT perform numeric comparison: less-or-equal, less,
    greater-or-equal and greater comparison correspondingly.
    </P
><P
>Examples: 

      <PRE
CLASS="programlisting"
>&#13;&#60;!IF   NAME="Content-Type" Content="application/pdf"&#62;
&#60;img src="pdf.png"&#62;
&#60;!ELIF NAME="Content-Type" Content="text/plain"&#62;
&#60;img src="text.png"&#62;
&#60;!ENDIF&#62;

&#60;!IFLIKE NAME="URL" CONTENT="http*"&#62;
This is an HTTP address
&#60;!ELIKE  NAME="URL" CONTENT="ftp*"&#62;
This is an FTP address
&#60;!ELSE&#62;
This is an unknown address type&#62;
&#60;!ENDIF&#62;
</PRE
>

    </P
><P
>It is possible to use nested conditional operators.
    This gives much power for search template construction.
    Please find some examples in the default template
    <TT
CLASS="filename"
>etc/search.htm-dist</TT
>.
    </P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-oper-set"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>SET</I
></SPAN
> operator</A
></H3
><P
>This operator is designed to set a variable value
    from a constant, from another variable, or even from
    a more complex expression.
    </P
><P
>Examples: 

      <PRE
CLASS="programlisting"
>&#13;&#60;!SET NAME="a" Content="Some string"&#62;
&#60;!SET NAME="b" Content="Another string"&#62;
&#60;!SET NAME="c" Content="$(a)"&#62;
&#60;!SET NAME="d" Content="a is '$(a)', b is '$(b)', c is '$(c)'"&#62;
      </PRE
>
    </P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-oper-copy"
><SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>COPY</I
></SPAN
> operator</A
></H3
><P
>The <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>COPY</I
></SPAN
> operator calculates the expression
    given in the attribute <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>CONTENT</I
></SPAN
>,
    then treats this value as a name of another variable,
    whose value is then copied into to the variable
    with the name given in the attribute <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>NAME</I
></SPAN
>.
    </P
><P
>Examples: 
      <PRE
CLASS="programlisting"
>&#13;&#60;!SET NAME="v1" CONTENT="The first value"&#62;
&#60;!SET NAME="v2" CONTENT="The second value"&#62;
&#60;!SET NAME="v3" CONTENT="The third value"&#62;
&#60;!SET NAME="i"  CONTENT="2"&#62;
&#60;!COPY NAME="value" CONTENT="v$(i)"&#62;
Value="$(value)"
      </PRE
>
      The above code will display this text:
      <PRE
CLASS="programlisting"
>Value="The second value"</PRE
>
    </P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-oper-inc"
>Arithmetic operators</A
></H3
><P
>Arithmetic operators INC and DEC respectively increment and decrement
    a variable value, as an integer.
    </P
><P
>Examples: 

      <PRE
CLASS="programlisting"
>&#13;&#60;!SET NAME="a" Content="10"&#62;a is $(a)
&#60;!INC NAME="a"&#62;After increment, a is $(a)
&#60;!DEC NAME="a"&#62;After decrement, a is $(a)
      </PRE
>
    </P
><P
>Arithmetic operators ADD, SUB, MUL perform integer addition,
    substraction and multiplication of two variables specified in the 
    NAME and CONTENT attributes and write the result back into the variable
    specified in the NAME attribute.
    </P
><P
>Examples: 
      <PRE
CLASS="programlisting"
>&#13;&#60;!SET NAME="b" CONTENT="20"&#62;
&#60;!SET NAME="a" CONTENT="10"&#62;
&#60;!MUL NAME="a" CONTENT="$(b)"&#62;a*b=$(a)
&#60;!SET NAME="a" CONTENT="10"&#62;
&#60;!ADD NAME="a" CONTENT="$(b)"&#62;a+b=$(a)
&#60;!SET NAME="a" CONTENT="10"&#62;
&#60;!SUB NAME="a" CONTENT="$(b)"&#62;a-b=$(a)             
      </PRE
>
    </P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-oper-loop"
>Loop operators</A
></H3
><P
>Three loop operators, WHILE, WHILENOT and FOR are available.
    The FOR operator was introduced in mnoGoSearch 3.3.0.
    </P
><P
>Examples: 

      <PRE
CLASS="programlisting"
>&#13;&#60;!SET      NAME="a" Content="10"&#62;
&#60;!WHILENOT NAME="a" Content="0"&#62;
  a is $(a)
&#60;!DEC NAME="a"&#62;
&#60;!ENDWHILE&#62;
      </PRE
>

      <PRE
CLASS="programlisting"
>&#13;&#60;!FOR NAME="a" FROM="10" TO="20"&#62;a=$(a)&#60;!ENDFOR&#62;

&#60;!SET NAME="from" CONTENT="80"&#62;
&#60;!SET NAME="to" CONTENT="90"&#62;
&#60;!FOR NAME="a" FROM="$(from)" TO="$(to)"&#62;a=$(a)&#60;!ENDFOR&#62;
      </PRE
>


    </P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="templates-oper-misc"
>Miscellaneous operators and functions</A
></H3
><P
>URLDECODE - decodes URL-encoded string. Decodes
          any %## encoding in the given string. The decoded
          string is written into the variable specified in
          the NAME attribute.
    </P
><P
>Examples: 

      <PRE
CLASS="programlisting"
>&#13;&#60;!URLDECODE NAME="decoded" Content="$(url)"&#62;URL is $(decoded)
      </PRE
>
    </P
><P
>HTMLENCODE - Converts special characters to HTML entities.
    </P
><P
>The convertion rules are:</P
><P
></P
><UL
><LI
><P
>'&#38;' becomes '&#38;amp;'.</P
></LI
><LI
><P
>'&#60;' becomes '&#38;lt;'.</P
></LI
><LI
><P
>'&#62;' becomes '&#38;gt;'.</P
></LI
><LI
><P
>'"' becomes '&#38;quot;'.</P
></LI
></UL
><P
>Examples: 
      <PRE
CLASS="programlisting"
>&#13;&#60;!HTMLENCODE NAME="encoded" Content="$(url)"&#62;URL is $(encoded)
      </PRE
>
    </P
><P
>EREG - Replaces a regular expression.
      <PRE
CLASS="programlisting"
>&#13;&#60;!EREG NAME="a" CONTENT="string" MATCH="pattern" RESULT="replacement"&#62;
      </PRE
>
    </P
><P
>&#13;    EREG scans the string given in CONTENT attribute for matches to the
string given in MATCH and stores the matched text into variable given in
NAME using RESULT value as a replacement pattern. Replacement string may contain
substrings in the form $N, where N is a digit 0..9, which is replaced by the
text matching the N'th parenthesized substring. $0 produces the entire
contents of matching string. CONTENT string may have references to other
variables.
    </P
><P
>Examples:
      <PRE
CLASS="programlisting"
>&#13;&#60;!SET NAME="str" CONTENT="http://www.host.com/path/file.ext"&#62;
&#60;!EREG NAME="a" CONTENT="$(str)"
MATCH="^([a-z]*)://([^/]*)/(.*)" RESULT="scheme=$1; host=$2
path+file=$3"&#62;$(a)
      </PRE
>
    </P
><P
>Result:
      <PRE
CLASS="programlisting"
>&#13;scheme=http host=www.host.com path=path/file.ext
      </PRE
>
    </P
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="templates-incl"
>Includes in templates</A
></H2
><P
>You may use &#60;!INCLUDE Content="http://hostname/path"&#62; to include external URLs into search results.</P
><P
>&#13;			<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>WARNING: You can use &#60;!INCLUDE&#62; ONLY in the following template sections:</I
></SPAN
>
		</P
><P
CLASS="literallayout"
><br>
&#60;!--top--&#62;<br>
&#60;!--bottom--&#62;<br>
&#60;!--restop--&#62;<br>
&#60;!--resbot--&#62;<br>
&#60;!--notfound--&#62;<br>
&#60;!--error--&#62;<br>
</P
><P
>This is an example of include usage:</P
><DIV
CLASS="informalexample"
><P
></P
><A
NAME="AEN3742"
></A
><PRE
CLASS="programlisting"
>&#13;&#60;!--top--&#62;
....
&#60;!INCLUDE CONTENT="http://hostname/banner?query=$&#38;(q)"&#62;
...
&#60;!--/top--&#62;
</PRE
><P
></P
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="templates-sec"
>Security issues</A
></H2
><P
>&#13;			<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>WARNING</I
></SPAN
>: Since the
template file contains such info as password, it is highly recommended
to give the file proper permissions to protect it from reading by
anyone but you and 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 search.html</TD
></TR
></TABLE
></DIV
><!--#include virtual="body-after.html"--></BODY
></HTML
>