[ POINTEST ]

Pointest FTP Search

\n"; }; // EndIf intUseLimits ?>
Search for 1) { echo "\n"; }; // Print out available Max Hits to select field. if (count($aryMaxHits) > 1) { echo "\n"; } else { $intMaxHits = $aryMaxHits[0]; }; // Make sure MaxHits is larger than returned results. $intMaxHitsOffset = $intPageOffset + $intMaxHits; ?>
Il motore di ricerca utilizza i segneti operatori (AND OR NOT), le parentesi(), ed il meta-carattere * . Esempi: ftp and resume, mail and (eud* or pegasus), not (explorer) and browser
Limit Search: $key\n"; }; // Setup Limit code if ($strLimit != ""){ $strLimitLine = "-t $strLimit"; } else { $strLimitLine = ""; }; print "

Searching for :

Error performing search!\n
\n\t
Administrator\n\t\t
Please check System-Specific variables defined at the beginning of the script.
"); // Jump out to HTML and set the table... /************************************/ $i=0; while(substr($aryResults[$i],0,1) == "#" || substr($aryResults[$i],0,3) == "err" && $i < 50): $strResultsClean = $aryResults[$i]; // Correct for offset caused by SWISH-E Comments. $intPageOffsetCorrect++; //Explodes the Comment into an array $aryComment = Explode(": ", strstr($strResultsClean, " ")); fncDebug($aryComment[0], $aryComment[1], 2); // Print number of results If (trim($aryComment[0]) == "Number of hits") { $intNumHits = trim($aryComment[1]); if ($intNumHits > 0) { if ($intNumHits >= $intMaxHits) { //Print 0 as 1 If($intPageOffset == 0){$intPageOffsetOne = $intPageOffset + 1;} Else{$intPageOffsetOne = $intPageOffset;}; // What is the result number of the last document If ($intNumHits > $intMaxHitsOffset){$intPageHitsThru = $intMaxHitsOffset;} Else {$intPageHitsThru = $intNumHits;}; // At which results am I looking echo "Displaying $intPageOffsetOne through $intPageHitsThru of $intNumHits results.
\n\n"; print "
\n"; } else { // If in the off chance it is a small result, under MaxHits. print "$intNumHits results found.
\n\n"; print "
\n"; }; }; }; // Set the strBaseURL if it isn't in the config already. If (trim($aryComment[0]) == "Pointer" && !isset($strBaseURL)){ $strBaseURL = trim($aryComment[1]); fncDebug("URL Pointer",$strBaseURL, 3); }; fncDebug("strResultsClean", $strResultsClean, 3); // Crappy No Results "err:" handling. Will be fixed someday, maybe... if(substr($strResultsClean,0,3) == "err"){ print "

No match for your search!

\n"; print "

\n\tUser: Please try adjusting the search criteria and/or changing the words.\n

"; }; $i++; endwhile; /******************************************/ $i = $intPageOffset + $intPageOffsetCorrect; while(substr($aryResults[$i],0,1) != "#" && substr($aryResults[$i],0,3) != "err" && $aryResults[$i] != "" && $aryResults[$i] != "." && $i <= $intPageOffset + $intPageOffsetCorrect + $intMaxHits): $strResultsClean = $aryResults[$i]; // if (substr($strResultsClean,0,1) != "#" && substr($strResultsClean,0,3) != "err"){ // if (!ereg("^#.*",$strResultsClean) && !ereg("^e.*",$strResultsClean) && $i >= $intPageOffset){ //$strResultsClean String Format: // "" <SIZE> // Array exploded on Double-Quote ("): // [RANK URL :0][TITLE:1][ SIZE:2] /* Take note of evil whitespace in the array values, ** which must be trimmed later.*/ $aryResultLine = explode("\"", $strResultsClean); $j=0; while($aryResultLine[$j]): // Find the position, from begin, of the first space, then: // Rank is everything from begin to the first space trimming whitespace. $intResultRank = trim(substr($aryResultLine[0], 0, strpos($aryResultLine[0]," "))); /* URL everything following first space trimming whitespace. ** Assuming file is under the DOCUMENT_ROOT directory somewhere. ** If not, the file may not be found via HTTP... However, ** if the indexer is configured correctly this is a ** waste of time. Too easy of a mistake to ignore, though. */ // $strResultURL = trim(strstr($aryResultLine[0]," ")); $strResultURL = ereg_replace($strSiteRootDir, "", trim(strstr($aryResultLine[0]," "))); // The rest is a piece of cake... $strResultTitle = trim($aryResultLine[1]); $intResultBytes = trim($aryResultLine[2]); // Attempt to grab data from each file if (count($aryMetaList) > 0) { unset($aryMetaTags); $strCurrentFile = $strSiteRootDir.$strResultURL ; if (file_exists($strCurrentFile) && $intGetFileData > 0) { // Get the META tags from the file $aryMetaTags = get_meta_tags($strCurrentFile); // Get the modification date stored in the file system $strResultModDate = gmdate("\M\o\d\i\f\i\e\d \a\\t H:i:s, \o\\n M d, Y \G\M\T", filemtime($strCurrentFile)); // $aryMetaTags = get_meta_tags("/www/share/apache/htdocs/test/test.html"); } } /* This is broken until I find a means of juggling FileSystem: ** versus HTTP resource names. Field not necessary, slows things down, ** but impressive and useful nonetheless. */ $j++; endwhile; print "\t<DT><A href=\"$strBaseURL$strResultURL\">$strResultTitle</A>\n"; print "\t<DD>\n"; fncDebug("Current File", $strCurrentFile, 4); reset ($aryMetaList); $p = 0; while($aryMetaList[$p]) { list ($strMetaName, $strLineHeading) = explode("|",$aryMetaList[$p]); if ($aryMetaTags["$strMetaName"]){print "\t\t$strLineHeading".$aryMetaTags["$strMetaName"]."<BR>\n";} $p++; }; print "\t\t<SPAN style=\"Font-Size: 75%; Font-Weight:900;\">Score: $intResultRank, Size: $intResultBytes Bytes, $strResultModDate</SPAN><P>\n"; $i++; endwhile; If ($intNumHits > 0) {print "</DL>\n";} // Print out the Previous and Next buttons If ($intNumHits > $intMaxHits) { print "<TABLE>\n<TR>\n"; If ($intMaxHits < $intMaxHitsOffset){ print "\t<TD>\n"; $intPrevVal = $intMaxHitsOffset - (2 * $intMaxHits); print "\t<FORM action=\"$strSelf\" method=\"POST\" name=\"frmPrev\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"do\" value=\"now\">\n"; /* ** Bug Fix JB: Parenthesis July 13, 1999 ** print "\t\t<INPUT type=\"HIDDEN\" name=\"words\" value=\"". stripslashes($words) ."\">\n"; */ print "\t\t<INPUT type=\"HIDDEN\" name=\"words\" value=\"".stripslashes(str_replace('"','',$words)) ."\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"strSearchSiteKey\" value=\"" . stripslashes($strSearchSiteKey) . "\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"intMaxHits\" value=\"$intMaxHits\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"intPageOffset\" value=\"$intPrevVal\">\n"; // Print out Search delimiters to hidden fields. reset ($arySearchDelimiter); while (list($key,$val) = each($arySearchDelimiter)) { if (strstr($strLimit,$val)){print "\t\t<INPUT type=\"HIDDEN\" name=\"aryLimits[]\" value=\"$val\">\n";}; }; print "\t\t<INPUT type=\"SUBMIT\" name=\"prev$intMaxHits\" value=\"<< Previous $intMaxHits\">\n"; print "\t</FORM>\n"; print "\t</TD>\n"; }; If ($intNumHits > $intMaxHitsOffset){ if ( ( $intNumHits - $intPageHitsThru ) < $intMaxHits ) { $intNextVal = ( $intNumHits - $intPageHitsThru ); } else { $intNextVal = $intMaxHits ; } print "\t<TD>\n"; print "\t<FORM action=\"$strSelf\" method=\"POST\" name=\"frmNext\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"do\" value=\"now\">\n"; /* ** Bug Fix JB: Parenthesis July 13, 1999 ** print "\t\t<INPUT type=\"HIDDEN\" name=\"words\" value=\"". stripslashes($words) ."\">\n"; */ print "\t\t<INPUT type=\"HIDDEN\" name=\"words\" value=\"".stripslashes(str_replace('"','',$words)) ."\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"strSearchSiteKey\" value=\"" . stripslashes($strSearchSiteKey) . "\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"intMaxHits\" value=\"$intMaxHits\">\n"; print "\t\t<INPUT type=\"HIDDEN\" name=\"intPageOffset\" value=\"$intMaxHitsOffset\">\n"; // Print out Search delimiters to hidden fields. reset ($arySearchDelimiter); while (list($key,$val) = each($arySearchDelimiter)) { if (strstr($strLimit,$val)){print "\t\t<INPUT type=\"HIDDEN\" name=\"aryLimits[]\" value=\"$val\">\n";}; }; print "\t\t<INPUT type=\"SUBMIT\" name=\"next$intNextVal\" value=\"Next $intNextVal >>\">\n"; print "\t</FORM>\n"; print "\t</TD>\n"; }; print "\t</TR>\n</TABLE>\n"; }; //Print the footer and exit $intTimeComplete = time() - $intTimeBegan; If ($intTimeComplete < 1){$intTimeComplete = "less than 1 second";} Else {$intTimeComplete = $intTimeComplete." seconds";}; fncPrintFooter("<P>Search completed in $intTimeComplete."); ?> <!-------- fine body------------------>