Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > b2392e2bab3459aa4eec68cd0e44713c > files > 371

mnogosearch-3.3.9-4mdv2010.1.x86_64.rpm

#
# Alexander Barkov <bar@mnogosearch.org>
#
# Sample fo HTDB virtual scheme usage
#
# I tested this to search through our web-board 
# at http://www.mnogosearch.org/board/board.php?board=1 
# wich is  stored in MySQL database. Messages
# are available under URLs like this:
# http://www.mnogosearch.org/board/message.php?id=XXX
# where XXX is message PRIMARY KEY value.
#

DBAddr mysql://foo:bar@localhost/udm/

# Add standard HTML sections 
Section body  1 256
Section title 2 128
# Add CachedCopy for smart excerpts
Section CachedCopy 100 128000

# List which will be gererated for "htdb:/" URL

HTDBList "SELECT concat('http://www.mnogosearch.org/board/message.php?id=',id) \
FROM udm.messages"


# Documents which will be generated for each "htdb:/XXX"  documents
# where XXX is 'messages' table PRIMARY KEY value.

HTDBDoc "\
SELECT concat( \
'HTTP/1.0 200 OK\\r\\n',\
'Content-type: text/html\\r\\n',\
'Last-Modified: ',Date_format(posted,'%a, %d %b %Y %T'),' GMT\\r\\n',\
'\\r\\n',\
'<HTML><HEAD>',\
'<TITLE>',subject,'</TITLE>',\
'<META NAME=''Description" Content=''',author,' ',urlname,' ',url,'''>',\
'</HEAD>\\n',\
'<BODY>\\n',msg,'\\n</BODY></HTML>'\
) \
FROM udm.messages \
WHERE id='$1'"



# Add HTDBList to generate a list of messages:
Server htdb:/

# Add messages:
Realm  http://www.mnogosearch.org/board/message.php?id=*

# Add messages URL translation:
# http://www.mnogosearch.org/board/message.php?id=XXX -> htdb:/XXX

Alias  http://www.mnogosearch.org/board/message.php?id=  htdb:/