Image Search Result

www.pjv101.net

'; echo '

Oops! No descriptions provided

'; echo '

Backup and try again! Or goto the search input page

'; echo '

Peter J. Vincent, '.date("d-M-Y").", database table '".$table."'

"; exit; } //connect to your database ** EDIT REQUIRED HERE ** //if ($_SERVER[ "SERVER_NAME" ] == "locahost" ) // { mysql_connect("localhost","pjv101",""); } //else // { mysql_connect("mysql04.powweb.com","pjv101","pjv101"); } if ($live) { mysql_connect("pjv101.powwebmysql.com","pjv101","pjv101"); } else { mysql_connect("localhost","pjv101",""); } //specify database ** EDIT REQUIRED HERE ** mysql_select_db("fts") or die("Unable to open database"); //select which database we're using echo 'Your search was for '.$odesc.':
';

if ($trimgroup != "")
   { echo "           Group: ".$trimgroup."
"; } if ($trimtopic != "") { echo " Topic: ".$trimtopic."
"; } if ($code != "") { echo " Class: ".strtoupper($code)."
"; } if ($number != "" ) { echo " Number: ".$number."
"; } if ($trimdesc != "" ) { echo " Description: ".$trimdesc."
"; } if ($trimdat != "" ) { echo " Date: ".$trimdat."
"; } if ($trimloc != "" ) { echo " Location: ".$trimloc."
"; } if ($trimfile_id != "" ) { echo " FileId: ".$file_id."
"; } if ($trimorg != "" ) { echo " Origin: ".strtoupper($trimorg)."
"; } if ($trimsrc != "" ) { echo " Source: ".strtoupper($trimsrc)."
"; } echo "
"; //echo '

'; $query = $query.$arg." ORDER by FILE_DESC"; $numresults = mysql_query($query) or die( $query."\n\n".mysql_error()); $numrows = mysql_num_rows($numresults); if ($numrows == 0) { echo "

Sorry, your search never found anything

"; exit; } echo "
"; echo " FileID Description................................................

"; $ta = "tg"; $text = 0; $image = 0; // now you can display the results returned // $p(rint)line determines whether a line has been output to change the background or not while ($row = mysql_fetch_array($numresults)) { $pline = FALSE; $loc = trim($row["C_LOC"]); if ($loc != "" ) { $loc = ", ".$loc; } $date = trim($row["C_DATE"]); if ($date != "" ) { $date = ", ".$date; } $ref = trim($row["REFERENCE"]); $src = trim($row["SOURCE"]); $org = trim($row["ORIGIN"]); if (trim($ref) != "" ) { $ref = " ".$ref; } //$ref1 = $ref; don't show reference yet $ref1 = ""; if (trim($org) != "" ) { $org = ", [o".$org.$ref1."]"; } elseif (trim($src) != "" ) { $org = ", [s".$src.$ref1."]"; } else { $org = ", [sPJV".$ref1."]"; } $file_id = $row["FILE_ID"]; $file_ext = strtolower($row["FILE_EXT"]); $rep = array( "'", '"' ); $filename = strtolower($row["DISK"])."/".strtolower($file_id).".".$file_ext; $desc = trim($row["FILE_DESC"]); $desc = str_replace( $rep, " ", $desc ); //if ( trim($file_ext) <> "" ) { if (file_exists($filename)) { //echo "The file $filename exists
"; $loc = str_replace( $rep, "", $loc ); $dat = str_replace( $rep, "", $dat ); $java = $filename; $href = ''.$desc.""; echo "
   ".$file_id." ".$href.$loc.$date.$org."
"; $image++; $pline = TRUE; } else { $href = $desc; $text++; if ($output == 'All' ) { echo "
   ".$file_id." ".$href.$loc.$date.$org."
"; $pline = TRUE; } } if ($pline == TRUE ) { if ($ta == "tg") { $ta = "th"; } else { $ta = "tg"; } } if ($image+$text > $limit ) { echo "

Warning!! Please refine your search, there is a $limit record limit. Large searches may choke your browser


"; break; } } echo "
"; mysql_free_result( $numresults ); mysql_close(); //echo "

"; if ($output == 'All' ) { $count = $image + $text; } else { $count = $image; } if ($count == 0 ) { echo "
"; echo "
Only ".$text." text entries found. Retry the search and include the text records.
"; echo "

"; } else { $line1 = "This search returned ".$image." images and ".$text." text records."; echo "
".$line1."
"; echo "
Database '".$table."' with ".$reccount." records and about ".$images." images"; } $line = "Peter J. Vincent indexed collection, ".date("d-M-Y"); $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $finish = $time; $totaltime = ($finish - $start); echo "
".$line."

"; echo "
[ This page took ".round($totaltime,3)." seconds to load ]
"; // @mail( "pjv@pjv101.net", "FTS search - ".date("d-M-Y H:i:s"), $query.", found $count records" ); ob_end_flush(); ?>