--- search/Search.cgi 2002/06/24 16:39:10 1.7
+++ search/Search.cgi 2002/10/24 18:25:20 1.26
@@ -1,19 +1,21 @@
#!/usr/bin/perl -w
#*****************************************************************************
-# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved *
-# *
-# *
-# This notice is intended as a precaution against inadvertent publication *
-# and does not constitute an admission or acknowledgement that publication *
-# has occurred or constitute a waiver of confidentiality. *
-# *
-# This software is the proprietary and confidential property *
-# of FS Consulting, Inc. *
+# Copyright (C) 1993-2000, FS Consulting Inc. All rights reserved *
+# *
+# *
+# This notice is intended as a precaution against inadvertent publication *
+# and does not constitute an admission or acknowledgement that publication *
+# has occurred or constitute a waiver of confidentiality. *
+# *
+# This software is the proprietary and confidential property *
+# of FS Consulting, Inc. *
#*****************************************************************************
#print "Content-type: text/plain\n\n";
+#use Data::Dumper;
+
#--------------------------------------------------------------------------
#
# Author: Francois Schiettecatte (FS Consulting, Inc.)
@@ -230,25 +232,6 @@
$main::QueryReportMimeType = "application/x-wais-report";
-
-# Hash of icon/images names that we use
-%main::ImageNames = (
- 'banner', 'banner.gif',
- 'collapse', 'collapse.gif',
- 'expand', 'expand.gif',
- 'inactive-search', 'inactive-search.gif',
- 'active-search', 'active-search.gif',
- 'inactive-search-history', 'inactive-search-history.gif',
- 'active-search-history', 'active-search-history.gif',
- 'inactive-saved-searches', 'inactive-saved-searches.gif',
- 'active-saved-searches', 'active-saved-searches.gif',
- 'inactive-document-folders','inactive-document-folders.gif',
- 'active-document-folders', 'active-document-folders.gif',
- 'inactive-settings', 'inactive-settings.gif',
- 'active-settings', 'active-settings.gif',
-);
-
-
# Array of mime type names, we use this to map
# mime types to mime type names (which are more readable)
%main::MimeTypeNames = (
@@ -409,7 +392,8 @@
print("$JavaScript\n");
}
print '';
- print("\n
\n");
+ print '';
+ print("\n\n");
# Send the header snippet file
@@ -519,47 +503,23 @@
}
}
- if ( %MenuBar && defined($MenuBar{'GetSearch'}) ) {
- print("");
-
-
- }
- else {
-
- print("");
-
+ my $DISABLED;
-
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'GetSearch'}) ) ? "DISABLED" : "";
+ print("");
if ( defined($main::RemoteUser) ) {
- if ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) {
- print("");
- }
- else {
- print("");
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'ListSearchHistory'}) ) ? "DISABLED" : "";
+ print"";
- if ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) {
- print("");
- }
- else {
- print("");
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'ListSavedSearch'}) ) ? "DISABLED" : "";
+ print"";
- if ( %MenuBar && defined($MenuBar{'ListFolder'}) ) {
- print("");
- }
- else {
- print("");
- }
-
- if ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) {
- print("");
- }
- else {
- print("");
- }
+ $DISABLED = ( %MenuBar && defined($MenuBar{'ListFolder'}) ) ? "DISABLED" : "";
+ print"";
+
+ $DISABLED = ( %MenuBar && defined($MenuBar{'GetUserSettings'}) ) ? "DISABLED" : "";
+ print"";
}
@@ -1549,9 +1509,17 @@
# Initialize the search string
$SearchString = "";
+ # tip gradje
+ if ( defined($main::FormData{'tip'}) ) {
+ my @t;
+ foreach my $tip ( split(/\0/, $main::FormData{'tip'}) ) {
+ push @t,"tip=$tip";
+ }
+ $SearchString .= "(".join(" or ",@t).") and ";
+ }
# Add the search terms
- $SearchString .= defined($Content{'Any'}) ? ((($SearchString ne "") ? " AND " : "") . $Content{'Any'}) : "";
+ $SearchString .= defined($Content{'Any'}) ? ((($SearchString ne "") ? " AND " : "") . nuke_accents($Content{'Any'}) ) : "";
# Add the generic field names
@@ -1559,20 +1527,22 @@
my ($FieldName) = "FieldName" . $Value;
my ($FieldContent) = "FieldContent" . $Value;
+
+ if ( defined($Content{$FieldName}) && defined($Content{$FieldContent}) ) {
- if ( defined($Content{$FieldName}) ) {
- $SearchString .= defined($Content{$FieldContent}) ?
- (($SearchString ne "") ? " AND " : "") . "$Content{$FieldName}=(" . $Content{$FieldContent} . ")" : "";
+ if ($Content{$FieldName} eq "ISBN") {
+ # fix stupid problem with dashes in data
+ $Content{$FieldContent} .= "*";
+ }
+
+ $SearchString .= ($SearchString ne "") ? " AND " : "";
+ $SearchString .= "$Content{$FieldName}=(" . nuke_accents($Content{$FieldContent}) . ")";
}
}
- # nuke accented chars
- $SearchString =~ tr/ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁčáíóúĄąŽžĘęźČşÁÂĚŞŻżĂăđĐĎËďŇÍÎěŢŮÓÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘¸¨˙Řř/CueaauccleOoiZACELlooLlSsOUTtLcaiouAaZzEezCsAAESZzAadDDEdNIIeTUOoNnnSsRUrUyYt'-".'',"'Rr/;
-
# Add the internal search terms
-
# Add the date restriction on the load time
if ( defined($Content{'LastRunTime'}) && ($Content{'LastRunTime'} > 0) ) {
$SearchString .= (($SearchString ne "") ? " AND " : "") . "time_t>=$Content{'LastRunTime'}";
@@ -1992,10 +1962,12 @@
# Print the title
if ( $HTML ) {
printf("
%s%s:
\n",
- defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");
+# defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");
+ $Title);
}
else {
- printf("%s%s:\n", defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");
+# printf("%s%s:\n", defined($Title) ? $Title : "Document", (scalar(@Documents) > 1) ? "s" : "");
+ print $Title;
}
@@ -2016,6 +1988,8 @@
$Headline =~ s/ //gs;
$Headline =~ s/<.*?>//gs;
$Headline =~ s/\s+/ /gs;
+ # decode some basic html from headline
+ $Headline =~ s/<(\/?[bi])>/<$1>/g;
# Create a generic link for this document
$Value = "";
@@ -2046,7 +2020,8 @@
# Put up the headline and the score, this one links to the document
if ( $HTML ) {
- print("$SelectorText $Headline ( $main::DatabaseDescriptions{$Value{'Database'}} ) \n");
+# print("$SelectorText $Headline ( $main::DatabaseDescriptions{$Value{'Database'}} ) \n");
+ print("$SelectorText $Headline \n");
# if ( defined($URL) && ($URL ne "") ) {
# $Value = (length($URL) > $main::DefaultMaxVisibleUrlLength) ? substr($URL, 0, $main::DefaultMaxVisibleUrlLength) . "..." : $URL;
@@ -2110,18 +2085,15 @@
my (@Words, $Word, @OffsetPairs, $OffsetPair, %Offsets, $Offset, $Start, $End, $OldStart, $OldEnd, $CurrentSummaryLength);
my ($DatabaseSummaryFilterKey, $DatabaseSummaryFilterFunction);
my ($Value, %Value, @Values, $ValueEntry);
-
-
+
+
# Check input parameters
if ( !defined($SearchResults) || !%Content ) {
return (0);
}
-
-
# Split the search results text into a search results list
@SearchResults = split(/\n/, $SearchResults);
-
# First we count up the number of results and scoop up
@@ -2229,7 +2201,7 @@
print("
\n");
# Print the selector
- print("
Odabranima se smatraju svi rezultati ukoliko niste učinili nikakav dodatan odabir.
\n");
+ print("
Odabrani su svi rezultati ukoliko niste učinili nikakav dodatan odabir.
\n");
if ( $ResultCount > 0 ) {
@@ -2244,7 +2216,7 @@
if ( $main::ConfigurationData{'allow-relevance-feedback-searches'} eq "yes" ) {
print("
\n");
@@ -2431,7 +2403,7 @@
}
-
+### FIX:: ADD SORT HERE
if ( $ResultCount > 0 ) {
# Loop over each entry in the hits list
@@ -2689,9 +2661,12 @@
if ( $HTML ) {
print("\n");
#print("