/[webpac2]/trunk/vhost/webpac2.cgi
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/vhost/webpac2.cgi

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

revision 1242 by dpavlin, Sun Jul 12 18:18:57 2009 UTC revision 1249 by dpavlin, Fri Jul 24 09:29:03 2009 UTC
# Line 11  use Data::Page; Line 11  use Data::Page;
11  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
12  use SWISH::API;  use SWISH::API;
13  use JSON;  use JSON;
14    use Text::Unaccent::PurePerl qw/unac_string/;
15    
16  my $range_around = 5;  my $range_around = 5;
17  my @entries_per_page = ( 30, 50, 100, 500 );  my @entries_per_page = ( 30, 50, 100, 500 );
# Line 191  print Line 192  print
192    
193  if ( my $search = param('search') ) {  if ( my $search = param('search') ) {
194    
195            $search = unac_string( $search );
196    
197          print qq|          print qq|
198                  <a href="#form" class="skip" title="skip to search form">#</a>                  <a href="#form" class="skip" title="skip to search form">#</a>
199                  <div id="results">                  <div id="results">
# Line 282  if ( my $search = param('search') ) { Line 285  if ( my $search = param('search') ) {
285    
286                  while ( my $result = $swish_results->next_result ) {                  while ( my $result = $swish_results->next_result ) {
287    
288                          my $data = from_json( $result->property('data'), {utf8 => 1} );                          my $data = $result->property('data');
   
289                          dump_yaml( 'data', $data );                          dump_yaml( 'data', $data );
290                            # FIXME if we produce valid json we shouldn't need eval here!
291                            eval { $data = from_json( $data, {utf8 => 1} ); };
292                            if ( $@ ) {
293                                    warn "ERROR: $@ from ",dump( $data );
294                                    next;
295                            }
296    
297                          my $li_class = '';                          my $li_class = '';
298                          $li_class = qq| class="z"| if $nr % 2 == 0;                          $li_class = qq| class="z"| if $nr % 2 == 0;

Legend:
Removed from v.1242  
changed lines
  Added in v.1249

  ViewVC Help
Powered by ViewVC 1.1.26