12 my $language='french';
16 open (KC, "/etc/koha.conf");
20 if (/(.*)\s*=\s*(.*)/) {
23 # Clean up white space at beginning and end
28 $configfile{$variable}=$value;
31 my $includes=$configfile{'includes'};
32 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
33 my $templatebase="$includes/templates/catalogue/searchresults/";
34 my $templatename=$query->param('template');
35 my $startfrom=$query->param('startfrom');
36 ($startfrom) || ($startfrom=0);
37 ($templatename) || ($templatename='default.tmpl');
38 $templatename=picktemplate($templatebase);
43 my $template = HTML::Template->new(filename => "$templatebase$templatename", die_on_bad_params => 0);
46 #my $sth=$dbh->prepare("select * from biblio where author like 's%' order by author limit $startfrom,20");
48 #while (my $data=$sth->fetchrow_hashref){
49 # push @results, $data;
56 $search{'keyword'}=$keyword;
58 my ($count, @results) = &KeywordSearch($env, 'intra', \%search, 20, $startfrom);
61 my $resultsarray=\@results;
63 $template->param(startfrom => $startfrom+1);
64 $template->param(endat => $startfrom+20);
65 $template->param(numrecords => $count);
66 my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20);
67 my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0);
68 $template->param(nextstartfrom => $nextstartfrom);
69 $template->param(prevstartfrom => $prevstartfrom);
70 $template->param(template => $templatename);
71 $template->param(SEARCH_RESULTS => $resultsarray);
73 print "Content-Type: text/html\n\n", $template->output;
80 my @dirlist=readdir D;
82 (next) unless (/\.tmpl$/);
85 my $sth=$dbh->prepare("select value from systempreferences where variable='template'");
87 my ($preftemplate) = $sth->fetchrow;
88 $preftemplate.='.tmpl';
89 if ($templates->{$preftemplate}) {
92 return 'default.tmpl';