/[webpac]/trunk2/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 /trunk2/WebPac.pm

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

revision 121 by dpavlin, Tue Sep 2 21:31:54 2003 UTC revision 126 by dpavlin, Thu Sep 4 13:47:36 2003 UTC
# Line 79  sub show_results_list { Line 79  sub show_results_list {
79          my $full = $q->param('full');          my $full = $q->param('full');
80    
81          my @persist_vars = ( 'rm' );          my @persist_vars = ( 'rm' );
82            my @url_params = ( 'rm=results', 'show_full=1', 'last_PAGER_offset='.$q->param('PAGER_offset') || 0 );
83    
84          for(my $i = 1; $i <=30; $i++) {          for(my $i = 1; $i <=30; $i++) {
85    
# Line 90  sub show_results_list { Line 91  sub show_results_list {
91                  push @persist_vars, "f$i";                  push @persist_vars, "f$i";
92                  push @persist_vars, "v$i";                  push @persist_vars, "v$i";
93    
94                    push @url_params,"f$i=".$q->url_param("f$i");
95                    push @url_params,"v$i=".$q->url_param("v$i");
96    
97                  # re-write query from +/- to and/and not                  # re-write query from +/- to and/and not
98                  my @param_vals = $q->param("v$i");                  my @param_vals = $q->param("v$i");
99                  my @swish_q;                  my @swish_q;
# Line 108  sub show_results_list { Line 112  sub show_results_list {
112                                          $s.= ($s) ? "and " : "";                                          $s.= ($s) ? "and " : "";
113                                          $s.="not " if ($1 eq "-");                                          $s.="not " if ($1 eq "-");
114                                          $s.="$2* ";                                          $s.="$2* ";
115                                  } elsif (m/(and|or|not)/i) {                                  } elsif (m/^\s*(and|or|not)\s*$/i) {
116                                          $s.="$_ ";                                          $s.="$_ ";
117                                  # don't add * to words with less than x chars                                  # don't add * to words with less than x chars
118                                  } elsif (length($_) <= $MIN_WILDCARD) {                                  } elsif (length($_) <= $MIN_WILDCARD) {
# Line 125  sub show_results_list { Line 129  sub show_results_list {
129                  push @s_arr, $q->param("f$i")."_swish=(".join(" or ",@swish_q).")";                  push @s_arr, $q->param("f$i")."_swish=(".join(" or ",@swish_q).")";
130          }          }
131    
132          my $tmpl = $self->load_tmpl('results.html');          my $tmpl = $self->load_tmpl('results.html', global_vars => 1);
133    
134          sub esc_html {          sub esc_html {
135                  my $html = shift;                  my $html = shift;
# Line 174  sub show_results_list { Line 178  sub show_results_list {
178          $tmpl->param('PAGER_offset',$q->param("PAGER_offset") || 0);          $tmpl->param('PAGER_offset',$q->param("PAGER_offset") || 0);
179          $tmpl->param('last_PAGER_offset',$q->param("last_PAGER_offset") || 0);          $tmpl->param('last_PAGER_offset',$q->param("last_PAGER_offset") || 0);
180    
181            $tmpl->param('url_params',"?".join("&",@url_params));
182    
183          # create a Pager object          # create a Pager object
184          my $pager = HTML::Pager->new(          my $pager = HTML::Pager->new(
185                  # required parameters                  # required parameters
# Line 237  sub show_index { Line 243  sub show_index {
243                  return $html;                  return $html;
244          }          }
245    
246          my $tmpl = $self->load_tmpl('index_res.html');          my $tmpl = $self->load_tmpl('index_res.html', global_vars => 1);
247          $tmpl->param('field',$field);          $tmpl->param('field',$field);
248          $tmpl->param('limit',$limit);          $tmpl->param('limit',$limit);
249          $tmpl->param('total',$total);          $tmpl->param('total',$total);

Legend:
Removed from v.121  
changed lines
  Added in v.126

  ViewVC Help
Powered by ViewVC 1.1.26