aboutsummaryrefslogtreecommitdiffhomepage
path: root/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi')
-rw-r--r--data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi32
1 files changed, 16 insertions, 16 deletions
diff --git a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
index 2bd9c09a..526ac974 100644
--- a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
+++ b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi
@@ -60,9 +60,9 @@
begin
require 'cgi'
require 'fcgi'
- require 'dbi'
+ require 'sqlite3'
rescue LoadError
- puts 'cgi, fcgi or dbi NOT FOUND (LoadError)'
+ puts 'cgi, fcgi or sqlite3 NOT FOUND (LoadError)'
end
@stub_default='sisu_sqlite'
@image_src="http://#{ENV['HTTP_HOST']}/_sisu/image_sys"
@@ -70,7 +70,7 @@
@hosturl_files="http://#{ENV['HTTP_HOST']}"
@output_dir_structure_by='language'
@lingual='multi'
- @db_name_prefix='SiSUv6a_'
+ @db_name_prefix='SiSUv6b_'
@base="http://#{ENV['HTTP_HOST']}#{ENV['PATH_INFO']}#{ENV['SCRIPT_NAME']}"
#Common TOP
@@offset=0
@@ -118,7 +118,7 @@
</table>
</td>
<td>
- <label for="find"><b>sample search form (content organised by language)</b></label>
+ <label for="find"><b>SiSU search form (sample) (content organised by language)</b></label>
</td></tr>
</table>
<form action="#{@base}" id="Test Form" method="post">
@@ -139,8 +139,8 @@
<br />
<select name="db" size="1">
#{@selected_db}
- <option value="SiSUv6a_manual">manual</option>
- <option value="SiSUv6a_sisu">sisu</option>
+ <option value="SiSUv6b_manual">manual</option>
+ <option value="SiSUv6b_sisu">sisu</option>
</select>
<input type="submit" value="SiSU search" />
<input type="radio" name="view" value="index" #{@result_type[:index]}> index
@@ -511,10 +511,10 @@
%{<font color="#666666" size="2">#{sql_select_endnotes}</font>}
end
def contents
- @conn.select_all(sql_select_body)
+ @conn.execute(sql_select_body)
end
def endnotes
- @conn.select_all(sql_select_endnotes)
+ @conn.execute(sql_select_endnotes)
end
end
def tail
@@ -538,7 +538,7 @@
<!-- SiSU Rights -->
<p class="tiny_left"><font color="#666666" size="2">
Generated by
- SiSU 6.0.3 2014-02-06 (2014w05/4)
+ SiSU 6.0.6 2014-05-18 (2014w19/7)
<br />
<a href="http://www.sisudoc.org" >
<b>SiSU</b></a> <sup>&copy;</sup> Ralph Amissah
@@ -670,17 +670,17 @@
checked_searched=checked_tip=checked_case=checked_sql=''
end
selected_db=case cgi['db']
- when /SiSUv6a_manual/ then '<option value="SiSUv6a_manual">manual</option>'
- when /SiSUv6a_sisu/ then '<option value="SiSUv6a_sisu">sisu</option>'
+ when /SiSUv6b_manual/ then '<option value="SiSUv6b_manual">manual</option>'
+ when /SiSUv6b_sisu/ then '<option value="SiSUv6b_sisu">sisu</option>'
end
db_name='sisu_sqlite.db'
db_sqlite=case cgi['db']
- when /SiSUv6a_manual/ then "/srv/www/manual/#{db_name}"
- when /SiSUv6a_sisu/ then "/srv/www/sisu/#{db_name}"
- else '/srv/www/manual/#{db_name}'
+ when /SiSUv6b_manual/ then "/srv/www/manual/#{db_name}"
+ when /SiSUv6b_sisu/ then "/srv/www/sisu/#{db_name}"
+ else '/srv/www/sisu/#{db_name}'
end
- @dbi="DBI:SQLite3:#{db_sqlite}" #sqlite3 ?
- @conn=DBI.connect(@dbi)
+ @conn=SQLite3::Database.new(db_sqlite)
+ @conn.results_as_hash=true
search_field=cgi['find'] if cgi['find'] # =~/\S+/
@search_for=SearchRequest.new(search_field,q) #.analyze #% search_for
#% searches