/[webpac-proto]/search/filters/default.pl
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 /search/filters/default.pl

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

revision 1.4 by dpavlin, Sun Jun 16 19:39:45 2002 UTC revision 1.5 by dpavlin, Thu Oct 24 18:25:22 2002 UTC
# Line 150  sub DocumentFilter { Line 150  sub DocumentFilter {
150                          return $tmp;                          return $tmp;
151                  }                  }
152    
153                  $Document{$FieldTag} = html_enc($Document{$FieldTag});                  # format URI
154                    if ( $FieldTag eq "856" ) {
155                  # Print the field data, marking up if needed                          my $alt = $Document{$FieldTag};
156                  if ( $FieldTag eq "A" || $FieldTag eq "E" ) {                          if (length $alt > $default::max_display_url_len ) {
157                          $CommaFlag = 0;                                  $alt = substr($alt,0,$default::max_display_url_len)."...";
                         @Authors = split(/;/, $Document{$FieldTag});  
                         foreach $Author ( @Authors ) {  
                                 if ( $CommaFlag ) {  
                                         $DocumentFinal .= ", ";  
                                 }  
                                 $CommaFlag = 1;  
                                 $SearchTerm = $Author;  
                                 $SearchTerm =~ s/,//g;  
                                 @AuthorNames = split(/ /, $SearchTerm);  
                                 $SearchTerm = "";  
                                 foreach $AuthorName ( @AuthorNames ) {  
                                         if ( ! ($AuthorName =~ /^\w+\.$/) ) {  
                                                 if ( $AuthorName ne "" ) {  
                                                         $AuthorName .= " ";  
                                                 }  
                                                 $SearchTerm .= $AuthorName;  
                                         }  
                                 }  
                                 $SearchTerm =~ s/ /+/g;  
                                 $DocumentFinal .= "<A HREF=\"$ENV{'SCRIPT_NAME'}/GetSearchResults?Database=$Database&FieldName1=author&FieldContent1=%22$SearchTerm%22\"> $Author </A>";  
                         }  
                 }  
                 elsif ( $FieldTag eq "K" ) {  
                         $CommaFlag = 0;  
                         @Keywords = split(/,/, $Document{$FieldTag});  
                         foreach $Keyword ( @Keywords ) {  
                                 if ( $CommaFlag ) {  
                                         $DocumentFinal .= ", ";  
                                 }  
                                 $CommaFlag = 1;  
                                 $SearchTerm = $Keyword;  
                                 $SearchTerm =~ s/ /+/g;  
                                 $DocumentFinal .= "<A HREF=\"$ENV{'SCRIPT_NAME'}/GetSearchResults?Database=$Database&FieldName1=keyword&FieldContent1=%22$SearchTerm%22\"> $Keyword </A>";  
158                          }                          }
159                  }                          $DocumentFinal .= "<A HREF=\"$Document{$FieldTag}\" TARGET=\"BlankWindow\">$alt</A>";
160                  elsif ( $FieldTag eq "W" ) {  
161                          $DocumentFinal .= "<A HREF=\"$Document{$FieldTag}\" TARGET=\"BlankWindow\"> $Document{$FieldTag} </A>";                  } else {
162                  }                          $DocumentFinal .= html_enc($Document{$FieldTag});
                 elsif ( $FieldTag eq "Y" ) {  
                         $DocumentFinal .= "<PRE>$Document{$FieldTag}</PRE>";  
                 }  
                 else {  
                         $DocumentFinal .= "$Document{$FieldTag}";  
163                  }                  }
164    
165                  $DocumentFinal .= "</TD></TR> \n";                  $DocumentFinal .= "</TD></TR> \n";

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.26