--- no_pager/index.cgi 2006/08/17 01:08:23 21 +++ no_pager/index.cgi 2006/08/17 19:18:26 23 @@ -136,21 +136,26 @@ return $text; } + my @template; + open(my $t, 'result.html') || die "result.html: $!"; + while(<$t>) { + push @template, $_; + } + close($t); + # for each document in results for my $i ( 0 ... $nres->doc_num - 1 ) { my $rdoc = $nres->get_doc($i); - - $out .= '
' . - '

' . attr_regex( $rdoc, '@title' ) . '

' . - '

' . html_snippet( $rdoc->snippet ) . '

' . - '' . attr_regex( $rdoc, 'source' ) . '' . - ' [' . attr_regex( $rdoc, '@size' ) . ' bytes]
'; my $uri = attr_regex( $rdoc, '@uri' ); - $out .= - qq{$uri } . - attr_regex( $rdoc, '@mdate' ) . - ' [' . ( $skip + $i + 1 ) . ']'; + my $nr = $skip + $i + 1; + + map { + my $l = $_; + $l =~ s/<%(.+?)%>/eval "$1"/ge; + $out .= $l; + } @template; + } } else { @@ -158,10 +163,10 @@ } if ($v->{page} == $v->{max_page}) { - $out .= next_page('All results shown'); + $out .= next_page('
All results shown'); } else { $out .= next_page( - 'Loading results...
', + '
Loading results...
', 'If you are using the scroll bar, release the mouse to see more results.' ); } @@ -196,6 +201,6 @@ s/<%(.+?)%>/eval "$1"/ge; print; } - close($f); + close($s); }