Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > bebff3570faee357416d2588192a229a > files > 248

mnogosearch-3.2.8-1mdk.ppc.rpm

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

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


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

HTDBList SELECT concat("http://search.mnogo.ru/board/message.php?id=",id) \
FROM udm.messages LIMIT 2


# 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://search.mnogo.ru/board/message.php?id=*

# Add messages URL translation:
# http://search.mnogo.ru/board/message.php?id=XXX -> htdb:/XXX

Alias  http://search.mnogo.ru/board/message.php?id=  htdb:/