📄 pls_search
字号:
} $formatPrice = sprintf("%.2f", $price); # # Format field widths for display. # eval '&formatFieldWidths'; # NOTE: SKIPPING PRICING FOR REMOTE DOCUMENTS!! if (! $remoteDocUrl) { $numCharTrans += length($hl); $numHitLines++; } # Display the title info for this record. # eval '&printTitleRow($index, $remoteDocUrl, $maxTitleLen)'; $index++; } # foreach results line # Generate billing information. eval '&bill_hl';}################################################################################ Name: billHl# Description: Writes Billing Record For Hitlist# Created: --/--/-- Terry Hardgrave# Changed: 3/9/95 Herman Vandermolen# Add a blank to the call to bill_one to represent# the dbgroup of the account holder.# 3/20/95 Herman Vandermolen# Don't do billing here. NOw done at dt leevl.# Returns: (none)###############################################################################sub bill_hl { local ($acct, $dbid, $docid, $temp, $price, $nc); $dbid = "_HEADLINE"; $docid = $numHitLines; $acct = $account; # format price $temp = $numHitLines * 0.01; $price = sprintf("%8.2f", $temp);# $numCharTrans is set in sub query# do "ibill.pl";# Note: Pass by parameters resulted in null values -- abandoned# $blank = ' ';# &bill_one($billfile,$acct,$blank,$blank,$blank,$dbid,$docid,$numCharTrans,$price);}################################################################################ Name: genPrice # Description: Generates a Price# Created: --/--/-- Terry Hardgrave# Changed: 3/6/95 Herman Vandermolen# Improve calculation of price per KC.# Returns: (none)###############################################################################sub gen_price{ local ($qprice, $mode); if($price eq "") { $qprice = $price{$dbid}; $mode = $mode{$dbid}; if ($mode eq "KC") { # Pay per character $price = int(($size * $qprice) / 10) / 100; } else { # Pay per document $price = $qprice; } } if ( ($price eq "") || ($price < 0) || ($price > 1000.00) ) { $price = -1; }# print "price = $price, qprice = $qprice, size = $size\n";}################################################################################ Name: printColumnHeadings# Description: Print text for headings of search results columns.# Created: ??# Changed: 2/7/95 Bryan Slavin# Created versions without price information display;# commented out original versions.# Changed: 2/11/95 Larry Cynkin# Made into a routine instead of stuck in calling routine.# 2/12/95 Larry Cynkin# Eliminated bad $platmode check, since now checked in# isKnownPlatmode().# 3/15/95 Saad Mufti# Get rid of PRICE heading# 3/29/95 Herman Vandermolen# Make display of price column configurable. # 4/6/95 Bryan Slavin# Change format and calculate the number of tabs to insert# to maintain field columns###############################################################################sub printColumnHeadings{ ($maxTitleLen) = @_; # # Calculate the number of tabs needed to pad output. # $titlePad = ""; $titlePad = " " x ($maxTitleLen - 7); if ($bPriceColumn == 1) { print " VAL " . "DOCUMENT" . "$titlePad" . "PRICE " . "DB " . " SIZE" . "<HR>"; } else { print " VAL " . "DOCUMENT" . "$titlePad" . "DB " . " SIZE" . "<HR>"; }}################################################################################ Name: printTitleRow# Description: Print a line of hitlist info, for one hit record.# Created: ??# Changed: 2/7/95 Bryan Slavin# Created versions without price information display;# commented out original versions.# 2/12/95 Larry Cynkin# Made into a routine instead of stuck in calling routine.# Eliminated bad $platmode check, since now checked in# isKnownPlatmode().# 2/16/95 Bryan Slavin# Made $nodeName variable so user does not have to see the# port number.# 2/21/95 Larry Cynkin# Added platmode to output so document has enough information# to return to search/operations form.# 02/27/95 Naval Deshbandhu# make URL path relative to /plweb # 3/3/95 Herman Vandermolen# Display .. instead of : as node name & port separator.# Mosaic doesn't like the ':' character.# 3/3/95 Herman Vandermolen# Add billing dbgroup to HREF.# 3/4/95 Saad Mufti# Add the URL for remote documents as an argument to the# script pointed to by the HREF.# 3/15/95 Saad Mufti# Take out printing of price.# 3/29/95 Herman Vandermolen# Make display of price column configurable. # 3/29/95 Herman Vandermolen# Change argument order in HREF to make docID more # visible for administrators. # 4/4/95 Herman Vandermolen# Set price to $0.00 if price is negative.# 4/6/95 Bryan Slavin# Change format of output and pad hitlist title###############################################################################sub printTitleRow{ local($index, $remoteDocUrl, $maxTitleLen) = @_; # if non-NULL, contains the URL for the # remote document that corresponds to the # doc id for this document ## encode special characters in remote document URL #$remoteDocUrl =~ # s/([ ~@#&\!\^\*\(\)\>\<\?\+\/=:'])/sprintf("%%%lx",ord($1))/eg; $remoteDocUrl =~ s/([\t])/sprintf("%%%lx",ord($1))/eg; # encode tabs # # Note: idoc is executed from local node so local accounting can be invoked, # i.e., HREF starts with "idoc.pl?...", rather than # "http://$xnode/plweb-cgi/idoc.pl?...". ######################################################### # NOTE: If both the node AND the port are desired to be displayed, # comment out the line below. # ($nodeName, $nodePort) = split(/:/,$xnode); print "PLWeb Result: $remoteDocUrl\t$relevance\t$chCount\n";}################################################################################ Name: prepHitInfo# Description: Do necessary preprocessing of search result information.# Outputs: Possibly changes current $hl. Sets $short_dbalias.# Created: ??# Changed: 2/11/95 Larry Cynkin# Made into a routine instead of stuck in calling routine.###############################################################################sub prepHitInfo{ # # Handle records with no title information # if (!($hl =~ /\S/)) { $hl = "** UNTITLED **"; } # # Eliminate any carriage return. # if ($hl =~ /\n$/) { chop($hl); } # # Converts $dbalias to have only 7 characters when printing out ## if (length($dbalias) > 7) {# $short_dbalias = substr($dbalias, 0, 7);# }# else {# $short_dbalias = $dbalias;# }}################################################################################ Name: formatFieldWidths# Description: Pad fields with spaces to create proper output width.# Outputs: (none)# Created: ??# Changed: 2/12/95 Larry Cynkin# Made into a routine instead of stuck in calling routine.# Changed to use 'x' operator instead of looping for each# added character.###############################################################################sub formatFieldWidths{ # Field widths for display $DATABASE_LEN = 6; $RELEVANCE_LEN = 4; $CH_COUNT_LEN = 6; $PRICE_LEN = 5; local($myLength); if (($myLength = length($dbalias)) < $DATABASE_LEN) { $short_dbalias = $dbalias . (' ' x ($DATABASE_LEN - $myLength)) ; } else { $short_dbalias = substr($dbalias,0,6); } if (($myLength = length($relevance)) < $RELEVANCE_LEN) { $relevance = (' ' x ($RELEVANCE_LEN - $myLength)) . $relevance; } if (($myLength = length($chCount)) < $CH_COUNT_LEN) { $chCount = (' ' x ($CH_COUNT_LEN - $myLength)) . $chCount; } if (($myLength = length($formatPrice)) < $PRICE_LEN) { $formatPrice = (' ' x ($PRICE_LEN - $myLength)) . $formatPrice; }}################################################################################ Name: isKnownPlatmode# Description: Determine if $platmode is recognized.# Parms: platmode# Outputs: Return value is true if recognized, false if not.# Created: 2/12/95 Larry Cynkin# Changed: ###############################################################################sub isKnownPlatmode{ local ($myPlatmode) = @_; $myPlatmode eq "unix" || $myPlatmode eq "mac" || $myPlatmode eq "msw";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -