|


|
|
Advanced
Features
Multie-Templates
Database
(DB) Indexing
- DB indexing is necessary when a target page
does not have a fixed form but instead has frequently added,
modified, and/or deleted fields such as bulletin boards.
- Although
similar to indexing items that are fixed, template
adjustments and a CGI program that controls both template and
output form must
be included in the output section.
- CGI Program that controls
the output form
Since search result page items are not fixed, template adjustments
are necessary and a CGI program that controls the output
form must be summoned to bring necessary items from the DB
records
inside
the template.

**Input: What users type in the search box
- Search words, terms, phrases, etc.
**Output: What DeepSearch finds or not find – Search results,
no result, etc.
Search & Result Page
Compose a page with search conditions you will inquire. Select
search conditions and deliver them to mclient.cgi as
arguments. If you are to use multi- templates or In URL, Category,
and User
Tag features, be careful about argument choices.
- p: Search Term
- t: Target (h: documents, I: images, s: audio
- za: Operators (I
: AI-AND, a : AND ,o : OR)
- ct: Category
- n: Results per page (10: 10results per page, 10, 20, 30, 40,
50)
- o: Sort by (s: site, d: date, c: category)
- ht: In URL
- s: String (e: as entered, s: substring)
- Fd: from Date (i.e.-01/01/2000)
- td: to Date (i.e.-10/10/2000)
- tfn: Template name, only when using multi-templates
- h: Meta search ( o: International, n: news)
- tl: To search title tags (on: search)
- to: Meta search time
out (0: optimal, 10, 20, 30)
Following is an example of a simple search form (search box)
using p argument.
If you want a more detailed search form, use the above arguments
and insert them:
i.e.- search.htm
<
html><head>
<
meta http-equiv="content-type" content="text/html;
charset=euc-kr">
<
title>Search Form</title>
<
meta name="generator" content="Namo WebEditor
v5.0">
<
/head>
<
body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<
table border="0" cellpadding="0" cellspacing="0" height="69">
<
tr>
<form name="query_box" method="get" action="http://xo.namo.co.kr/~essence/cgi-bin/mclient.cgi">
<td width="230" align="left" valign="top"><input
type="hidden" size="8" name="tfn" value=”tpl_cgi_eng”>
<FONT size=1><input type="text" size="8" name="p"></FONT>
<input type="image" src="http://www.namo.co.kr/images/go.gif" width="32" height="21" border="0" align="top" name="image">
</td>
</form>
<
/tr>
<
/table>
<
/body></html>
How
to use Multi-Templates
Some administrators might want different output
pages for different menus or categories and not just one simple
search result page for all purposes. For example, administrators
might want to differentiate a normal search result page and a bulletin
board search result page:
- First, create all the necessary templates for
the result page. For example, create a template file called main.dst for
a normal search result page and another called bb.dst for
a bulletin board search result page.
- Use tfn argument
when inquiring the result page from the search page.
For example, if you have created main.dst (a normal
result page template) and bb.dst (a bulletin board
result page template), using the value main for the
tfn argument
during an inquiry will call for a normal result page template.
On the other hand, using the value bb for the tfn argument
during an inquiry will call for a bulletin board result page
template.
-i.e.- tfn=main
-i.e.- tfn=bb
- Careful not to include
file extensions (.dst) in the tfn argument.
- If you have modified a template file, erase the old one
with .dct extension
(use rm command in Unix) in the /template directory and
then copy the modified template file with the .dst extension in
the same directory. Then assign that file as the tfn argument value.
(i.e.- tfn=bb)
**DeepSearch will compile .dst template files into .dct first
before using it as a template file. When you assign a template
file to the tfn argument, DeepSearch will automatically
compile that .dst file into a .dct file
in /template.
CGI
Connecting Template Template
is useful for result page output forms and designs. Output
items in the result page are items that were saved in the
database during the time of indexing job. The following
example is a template file code for the CGI connecting
template and bold parts are template scripts for DeepSearch.
Descriptions of these scripts are in the PlaceHolder List
manual. An important template script in the following example
is: [ds$ItemDBExtCGI <!-- cgi="http://xo.namo.co.kr/~essence/cgi_handler/viewext.php" count=10
-->]. This script is used for changing
forms through CGI that assigns output data items. Count is
the number of items to send to the CGI program.
i.e.- CGI Connecting Template Example
(tpl_cgi_eng.dst)
<
html><head><title>DeepSearch : Result Page</title>
<!--ds$JScripts -->
<
/head>
<!--ds$DeepSearchTemplate_ResultPage Kor -->
<
body bgcolor="white" link="#0033CC" [ds$BodyAddTag]>
< !--ds$SearchTip -->
< !--ds$Result_Begin -->
<
font face="arial,helvetica">
<table width="640" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td background="[ds$URL_ResourceDIR]search_tit01.gif" height="65" width="570" valign="bottom" colspan=2>
<table width="640" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30" valign="top"><img src="[ds$URL_ResourceDIR]search_b04.gif" width="9" height="9" hspace="15" align="middle"></td>
<td class="a3" width="610" valign="bottom"><b>[ds$QrWord]</b>[ds$UserString
n=1]</td>
</tr>
</table>
</td>
</tr>
[ds$QueryBox <!-- head="<tr><td > </td><td
class='a3' >" tail="</td></tr>" fontsize=2 tag="width=640
border=0 cellspacing=0 bgcolor=#E9E9E9" help="javascript:windowHelpOpen()" add="<input
type=hidden name=tfn value='tpl_cgi_eng'>" cs="4P=1 Q=1 L=1 R=1
.. V=1 .. H=1" -->]
[ds$MetaQueryBox <!-- head="<tr><td bgcolor=#E9E9E9> </td><td
bgcolor=#E9E9E9>" tail="</td></tr>" fontsize=2
linkcolor="black" tag="width=640 border=0 cellspacing=0 bgcolor=#E9E9E9" -->]
<
tr>
<td background="[ds$URL_ResourceDIR]search_line.gif" colspan=4> <img
src="[ds$URL_ResourceDIR]spacer.gif" width="1" height="1"></td>
<
/tr>
<
/table>
</font>
[ds$Message <!-- head = "<h3>" tail
="</h3>" -->]
<
br>
<!--ds$List_Begin -->
<
table width=640 align=center>
<
tr>
<
td height="35" width=630 align="right"> <span
style='font-size:12pt;'><font face='arial'>Total
: [ds$SitesNum_Total] </font></span></td>
<
/tr>
<
/table>
<TABLE border=0 cellpadding=2 cellspacing=1 width=640
align=center>
<
tr>
<td bgcolor="#B4D1E9" width=10% align=center><font face="arial">NO</font></td>
<td bgcolor="#B4D1E9" align=center><font face="arial">Title</font></td>
<td bgcolor="#B4D1E9" width=10% align=center><font face="arial">Writer</font></td>
<td bgcolor="#B4D1E9" width=10% align=center><font face="arial">Date</font></td>
<
/tr>
<!--ds$Item_Begin -->
[ds$ItemDBExtCGI <!-- cgi="http://172.16.100.213/~essence/cgi_handler/viewext.php" count=10
-->]
< !--ds$Item_End -->
</table>
<!--ds$List_End -->
[ds$PageMap <!-- head="<table width=600 align=center><tr><td
align=center><font size=2 face=arial,helvetica><b>" tail="</b></font></td></tr></table>" -->]
< !--ds$Result_End -->
</BODY></HTML>
Example of Connecting Program (with Templates)
To retrieve and display data items
in a remote DB, DeepSearch must use CGI to search that
DB, retrieve, and then display items on the result page.
In order to search this DB, you must send the argument
value of CGI of an item on the result page in place of
URL argument value.
Argument data form that accepts CGI Connecting Program
- Argument name: zp
- Item delimiter inside zp argument value: (ASCII
Code 1)
- Argument values behind ? of found URL come
in as zp data.
- zo and zw are order and weight (relevance)
values respectively.
|
viewext.php
|
|
<?php
include ("$DOCUMENT_ROOT/connect.inc");
$string = $zp;
for($n=0; $n < strlen($string); $n++){
if( $string[$n] == chr(1)){
$str_item = substr($string, 0, $n+1);
$string = substr($string, $n+1, strlen($string) - $n );
$n = 0;
$startpos = 0;
$stat = 0;
$no = -1 ;
for($i=0; $i < strlen($str_item); $i++){
if(!strcmp("zo=" , $str_item[$i] . $str_item[$i+1]. $str_item[$i+2])){
$startpos = $i +3;
$stat = 1;
}
if(!strcmp("zw=" , $str_item[$i] . $str_item[$i+1]. $str_item[$i+2])){
$startpos = $i +3;
$stat = 2;
}
if(!strcmp("no=" , $str_item[$i] . $str_item[$i+1]. $str_item[$i+2])){
$startpos = $i +3;
$stat = 3;
}
if( ('&' == $str_item[$i] || chr(1) == $str_item[$i]) && $startpos > 0){
if ($stat == 1) $zo = substr($str_item, $startpos, $i - $startpos);
if ($stat == 2) $zw = substr($str_item, $startpos, $i - $startpos);
if ($stat == 3) $no = substr($str_item, $startpos, $i - $startpos);
$startpos =0;
$stat = 0;
}
}
if( $no != -1 ){
$que1 = " select * from board where no = '$no' ";
$result1 = mysql_query($que1,$connect);
$row = mysql_fetch_array($result1);
$title = "<a href='http://xo.namo.co.kr/~essence/cgi_handler/view.php?gbn=" .
$row[gubun] . "&no=" . $no . "'>" . $row[subject]
. "</a>";
$writer = stripslashes($row[writer]);
$tdate = substr($row[tdate],0,4) . '/' . substr($row[tdate],4,2) . '/' . substr($row[tdate],6,2);
}
echo("
<tr>
<td bgcolor=#EFEFEF width=10% align=center><font face='Arial'>$zo</font></td>
<td bgcolor=#EFEFEF align=left><font face='Arial'>$title</font></td>
<td bgcolor=#EFEFEF width=10% align=center><font face='Arial'>$writer</font></td>
<td bgcolor=#EFEFEF width=10% align=center><font face='Arial'>$tdate</font></td>
</tr>");
}
}
?>
|

|