From 0058d9f7e332b7c0c8572d004de052dd9de314f5 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Fri, 10 May 2002 22:18:48 +0000 Subject: [PATCH] Modified to use Search.pm and KeywordSearch(). Note that I had to modify Search.pm as well to get it to return something other than that bizarre @stuff array. :) --- html-template/cmsdsearchresults.tmpl | 4 ++-- html-template/search.pl | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/html-template/cmsdsearchresults.tmpl b/html-template/cmsdsearchresults.tmpl index f857d0bb08..bf69663ee2 100644 --- a/html-template/cmsdsearchresults.tmpl +++ b/html-template/cmsdsearchresults.tmpl @@ -4,12 +4,12 @@ - + - + diff --git a/html-template/search.pl b/html-template/search.pl index 09e2e19e17..8bdf82eb3a 100755 --- a/html-template/search.pl +++ b/html-template/search.pl @@ -4,6 +4,7 @@ use strict; require Exporter; use C4::Database; use CGI; +use C4::Search; my $query=new CGI; @@ -18,12 +19,19 @@ my $dbh=&C4Connect; my $template = HTML::Template->new(filename => $templatename, die_on_bad_params => 0); -my @results; -my $sth=$dbh->prepare("select * from biblio where author like 's%' order by author limit $startfrom,20"); -$sth->execute; -while (my $data=$sth->fetchrow_hashref){ - push @results, $data; -} +##my @results; +#my $sth=$dbh->prepare("select * from biblio where author like 's%' order by author limit $startfrom,20"); +#$sth->execute; +#while (my $data=$sth->fetchrow_hashref){ +# push @results, $data; +#} + +my $blah; +my %search; +$search{'keyword'}='bear'; + +my ($count, $resultshash, @results) = &KeywordSearch(\$blah, 'intra', \%search, 20, $startfrom); + @@ -31,6 +39,6 @@ $template->param(startfrom => $startfrom); $startfrom+=20; $template->param(nextstartfrom => $startfrom); $template->param(template => $templatename); -$template->param(SEARCH_RESULTS => \@results); +$template->param(SEARCH_RESULTS => $resultshash); print "Content-Type: text/html\n\n", $template->output; -- 2.20.1
TitleAuthorNotes
TitleAuthorDewey
&startfrom=>Next Records