/[local]/search/Search.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 /search/Search.cgi

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

revision 1.1 by dpavlin, Thu Jun 13 17:01:56 2002 UTC revision 1.5 by dpavlin, Mon Jun 24 13:47:06 2002 UTC
# Line 12  Line 12 
12  #  of FS Consulting, Inc.                                                                                                        *  #  of FS Consulting, Inc.                                                                                                        *
13  #*****************************************************************************  #*****************************************************************************
14    
15    #print "Content-type: text/plain\n\n";
16    
17  #--------------------------------------------------------------------------  #--------------------------------------------------------------------------
18  #  #
19  # Author: Francois Schiettecatte (FS Consulting, Inc.)  # Author: Francois Schiettecatte (FS Consulting, Inc.)
# Line 179  $main::MPSSession = 0; Line 181  $main::MPSSession = 0;
181  #  #
182    
183    
184  # List of default configuration settings  # read configuration fields
185  %main::DefaultSettings = (  require "config.pm";
         'lowest-year',  '1990',  
         'max-score',    '1000',  
         'allow-summary-displays','no',  
         'allow-similiar-search','no',  
         'allow-regular-searches','no',  
         'deliver-empty-results-from-regular-search','no',  
 #       'allow-relevance-feedback-searches','no',  
         'mailer-application','/usr/lib/sendmail',  
         'server-log','mps.log',  
         'output-colums','yes',  
 #       'show-past-date-list','yes',  
         'database-for-SearchFieldDescriptions','ps',  
 );  
   
 # DbP: Define which fields you have in normal and advanced search  
 # first define all available fields and then how many fields of that  
 # are visible.  
 @main::NormalSearchFieldNames = (  
         '700+',  
         '200+',  
         '610',  
         '210',  
         '10',  
   
 );  
 $main::NormalSearchDropdowns = 3 ;  
   
 @main::AdvancedSearchFieldNames = (  
         '700+',  
         '200+',  
         '610',  
         '210',  
         '225',  
         '300+',  
         '330',  
         '464',  
         '675',  
         '686',  
         '990',  
         '991',  
         '10',  
         '001',  
 );  
 $main::AdvancedSearchDropdowns = 4 ;  
   
186    
187  # List of required configuration settings  # List of required configuration settings
188  @main::RequiredSettings = (  @main::RequiredSettings = (
# Line 436  sub vSendHTMLHeader { Line 393  sub vSendHTMLHeader {
393          if ( ! $ENV{'GATEWAY_INTERFACE'} ) {          if ( ! $ENV{'GATEWAY_INTERFACE'} ) {
394                  return;                  return;
395          }          }
396            
397          # Bail if we have already sent the header          # Bail if we have already sent the header
398          if ( $main::HeaderSent ) {          if ( $main::HeaderSent ) {
399                  return;                  return;
# Line 461  sub vSendHTMLHeader { Line 418  sub vSendHTMLHeader {
418    
419          # Send the banner          # Send the banner
420          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");          print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");
421          print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'banner'}\" ALT=\"Return Home\" BORDER=0></A> </TD></TR>\n");  #       print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'banner'}\" ALT=\"Return Home\" BORDER=0></A> </TD></TR>\n");
422          print("</TABLE>\n");  
423            print("<TR><TD VALIGN=TOP ALIGN=RIGHT> <A HREF=\"/\" OnMouseOver=\"self.status='Return Home'; return true\"><H3>Katalozi knjižnica Filozofskog fakulteta</H3> </A> </TD></TR>\n");
424    
425            print("</TABLE>\n");
426                                    
427    
428          # Set the flag saying that the header has been sent          # Set the flag saying that the header has been sent
# Line 561  sub vSendMenuBar { Line 521  sub vSendMenuBar {
521    
522          if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) {          if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) {
523                  print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search'}\" ALT=\"Search\" BORDER=0>");                  print("<IMG SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'inactive-search'}\" ALT=\"Search\" BORDER=0>");
524    
525    
526          }          }
527          else {          else {
528    
529                  print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>");                  print("<INPUT NAME=\"GetSearch\" TYPE=IMAGE SRC=\"$main::ConfigurationData{'image-base-path'}/$main::ImageNames{'active-search'}\" ALT=\"Search\" BORDER=0>");
530    
531            
532    
533          }          }
534    
535          if ( defined($main::RemoteUser) ) {          if ( defined($main::RemoteUser) ) {
# Line 2724  sub bsDisplaySearchResults { Line 2688  sub bsDisplaySearchResults {
2688                          # Put up the headline and the score, this one links to the document                          # Put up the headline and the score, this one links to the document
2689                          if ( $HTML ) {                          if ( $HTML ) {
2690                                  print("<!-- resultItem -->\n");                                  print("<!-- resultItem -->\n");
2691                                  print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD> <TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> <!-- relevance --> <B> $Score </B> <!-- /relevance --> </TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline <I> ( $main::DatabaseDescriptions{$Database} ) </I> </A> <BR> <FONT SIZE=-2>");                                  #print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD> <TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> <!-- relevance --> <B> $Score </B> <!-- /relevance --> </TD> <TD ALIGN=LEFT VALIGN=TOP> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline <I> ( $main::DatabaseDescriptions{$Database} ) </I> </A> <BR> <FONT SIZE=-2>");
2692                          }                                  print("<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=1%> $SelectorText </TD><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> <A HREF=\"$LinkText\" OnMouseOver=\"self.status='Retrieve this document'; return true\"> $Headline </A> <BR> <FONT SIZE=-2>&nbsp;");
2693                          else {                          } else {
2694                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);                                  printf("%3d $Headline ($main::DatabaseDescriptions{$Database})\n", $Score);
2695                          }                          }
2696    
2697    if (0) { ## don't display description
2698    
2699                          # Put up the summary                          # Put up the summary
2700                          if ( defined($SummaryText) && ($SummaryText ne "") ) {                          if ( defined($SummaryText) && ($SummaryText ne "") ) {
# Line 2746  sub bsDisplaySearchResults { Line 2711  sub bsDisplaySearchResults {
2711                          if ( ! defined($Remainder) ) {                          if ( ! defined($Remainder) ) {
2712                                  if ( $HTML ) {                                  if ( $HTML ) {
2713                                          print("Formatttt: $MimeTypeName, ");                                          print("Formatttt: $MimeTypeName, ");
2714                            
2715                                  }                                  }
2716                                  else {                                  else {
2717                                          print("    Format: $MimeTypeName, ");                                          print("    Format: $MimeTypeName, ");
# Line 2754  sub bsDisplaySearchResults { Line 2720  sub bsDisplaySearchResults {
2720    
2721    
2722                          # Put up the date if we got it                          # Put up the date if we got it
2723                          if ( defined($Date) && ($Date ne "") ) {                           if ( defined($Date) && ($Date ne "") ) {
2724                                  print("Date: $Date");                                  print("Date: $Date");
2725                                                                    
2726                                  # Put up the time if we got it                                  # Put up the time if we got it
2727                                  if ( defined($Time) && ($Time ne "") ) {                                   if ( defined($Time) && ($Time ne "") ) {
2728                                          print(" $Time");                                          print(" $Time");
2729                                  }                                  }
2730                                                                    
# Line 2889  sub bsDisplaySearchResults { Line 2855  sub bsDisplaySearchResults {
2855                                  }                                  }
2856                                  print("\n");                                  print("\n");
2857    
2858    } #if
2859                                  # Finish off the entry                                  # Finish off the entry
2860                                  if ( $HTML ) {                                  if ( $HTML ) {
2861                                          print("</FONT></TD></TR>\n");                                          print("</FONT></TD></TR>\n");
# Line 3084  sub vGetSearch { Line 3051  sub vGetSearch {
3051                  print ("<SELECT NAME=\"FieldName${field}\">");                  print ("<SELECT NAME=\"FieldName${field}\">");
3052                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {                  for (my $i=0; $i<=$#SearchFieldNames; $i++) {
3053                          my $ItemEntry = $SearchFieldNames[$i];                          my $ItemEntry = $SearchFieldNames[$i];
3054                          my $Selected = ($main::FormData{"FieldName${field}"} == $ItemEntry || $i == ($field-1)) ? "SELECTED" : "";                          my $Selected = "";
3055                            if ($main::FormData{"FieldName${field}"} && $main::FormData{"FieldName${field}"} eq $ItemEntry) {
3056                                    $Selected = "SELECTED";
3057                            } elsif ($i == ($field - 1)) {
3058                                    $Selected = "SELECTED";
3059                            }
3060                                    
3061                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");                          print("<OPTION VALUE=\"$ItemEntry\" $Selected> $main::SearchFieldDescriptions{$ItemEntry}\n");
3062                  }                  }
3063                  my $Value = defined($main::FormData{"FieldContent${field}"}) ? "VALUE='".$main::FormData{"FieldContent${field}"}."'" : "";                  my $Value = "";
3064                    if (defined($main::FormData{"FieldContent${field}"})) {
3065                            $Value = "VALUE='".$main::FormData{"FieldContent${field}"}."'";
3066                    }
3067                  print("</SELECT></TD><TD ALIGN=LEFT><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n");                  print("</SELECT></TD><TD ALIGN=LEFT><INPUT NAME=\"FieldContent${field}\" TYPE=TEXT $Value SIZE=45> </TD></TR>\n");
3068          }          }
3069    
# Line 3110  sub vGetSearch { Line 3086  sub vGetSearch {
3086          # Database selection          # Database selection
3087          if ( %main::DatabaseDescriptions ) {          if ( %main::DatabaseDescriptions ) {
3088    
3089                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=2> Odaberite bazu koju želite pretraživati: </TD> <TD ALIGN=LEFT VALIGN=TOP>\n");                  print("<TR><TD ALIGN=LEFT VALIGN=TOP COLSPAN=3> Odaberite bazu koju želite pretraživati: </TD></TR><TD ALIGN=CENTER VALIGN=TOP COLSPAN=4>
3090                    ");
3091                                    
3092                  # Parse out the database names and put them into a                  # Parse out the database names and put them into a
3093                  # hash table, they should be separated with a '\0'                  # hash table, they should be separated with a '\0'
# Line 3131  sub vGetSearch { Line 3108  sub vGetSearch {
3108    
3109    
3110                  $Flag = 0;                  $Flag = 0;
3111                  print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>\n");                  print("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>\n");
3112    
3113                  my @html_database;                  my @html_database;
3114    
# Line 3150  sub vGetSearch { Line 3127  sub vGetSearch {
3127                  if ($main::ConfigurationData{'output-colums'}) {                  if ($main::ConfigurationData{'output-colums'}) {
3128                          # create database names in columns                          # create database names in columns
3129    
3130                          my $max = $#html_database+1 ;                          my $cols = $main::ConfigurationData{'show-nr-colums'};
3131                            my $next = int($#html_database/$cols) ;
3132    
3133                          my $j=0;                          for(my $i=0; $i <= $next ; $i++) {
3134                          for(my $i=0; $i < $max ; $i=$i+2) {                                  print("<tr>");
3135                                  print("<tr>",$html_database[$j],$html_database[$j+int($max/2)],"</tr>");                                  for(my $j=0; $j <= $cols; $j++) {
3136                                  $j++;                                          print($html_database[$i+$next*$j+$j] || '');
3137                                    }
3138                                    print("</tr>");
3139                          }                          }
3140    
3141                  } else {                  } else {

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

  ViewVC Help
Powered by ViewVC 1.1.26