/[webpac]/trunk/WebPac.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/WebPac.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 13 by dpavlin, Sun Feb 16 22:41:37 2003 UTC revision 16 by dpavlin, Sat Feb 22 21:21:35 2003 UTC
# Line 6  use strict; Line 6  use strict;
6  use HTML::Pager;  use HTML::Pager;
7  use HTML::FillInForm;  use HTML::FillInForm;
8  use SWISH;  use SWISH;
9  use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);  use Text::Iconv;
10  use DBI;  use DBI;
11    
12  use lib '..';  use lib '..';
# Line 22  my $INDEX = '/data/webpac/index/isis.ind Line 22  my $INDEX = '/data/webpac/index/isis.ind
22  my $MAX_HITS = 500;  my $MAX_HITS = 500;
23  my $ON_PAGE = 10;  my $ON_PAGE = 10;
24    
25    Text::Iconv->raise_error(1);     # Conversion errors raise exceptions
26    
27    my $from_utf8 = Text::Iconv->new('UTF8', $CHARSET);
28    
29  sub setup {  sub setup {
30          my $self = shift;          my $self = shift;
# Line 88  sub show_results_list { Line 91  sub show_results_list {
91                                  $s.="$_* ";                                  $s.="$_* ";
92                          }                          }
93                  }                  }
94                    $s =~ s/\*+/*/g;
95    
96                  push @s_arr,$q->param("f$i")."_swish=($s)";                  push @s_arr,$q->param("f$i")."_swish=($s)";
97          }          }
# Line 105  sub show_results_list { Line 109  sub show_results_list {
109                          push @swish_results, {                          push @swish_results, {
110                                  nr => ($#swish_results + 2),                                  nr => ($#swish_results + 2),
111                                  path => $hit->swishdocpath,                                  path => $hit->swishdocpath,
112                                  headline => from_utf8({ -string => $hit->headline, -charset => $CHARSET }),                                  headline => $from_utf8->convert($hit->headline),
113                                  html => back2html(from_utf8({ -string => $hit->html, -charset => $CHARSET })),                                  html => back2html($from_utf8->convert($hit->html)),
114                                  rank => $hit->swishrank };                                  rank => $hit->swishrank };
115    
116                  },                  },
# Line 188  sub show_index { Line 192  sub show_index {
192          $tmpl->param('limit',$limit);          $tmpl->param('limit',$limit);
193          $tmpl->param('total',$total);          $tmpl->param('total',$total);
194    
195    # FIX: I should set offset and leave out limit from fetch!!
196    #       if (! $q->param("PAGER_offset") {
197    #               $q->param("Pager_offet)
198    #       }
199    
200          my $pager = HTML::Pager->new(          my $pager = HTML::Pager->new(
201                  query => $q,                  query => $q,
202                  get_data_callback => sub {                  get_data_callback => sub {

Legend:
Removed from v.13  
changed lines
  Added in v.16

  ViewVC Help
Powered by ViewVC 1.1.26