Alexander Library Historical Photography Database

The Alexander Library at Rutgers University has an extensive historical photography collection, but intellectual property policies at the University level are preventing library archivists from adding these to the RUCore System that makes resources available to the public.

In order to make accessing the images simpler for University departments/clients who have received clearance  to use the images, the University Archives needed an in-house database that uses a simple browser interface.  The link below is a proof of concept that provides both simple and advanced facet searches.

http://studentweb.comminfo.rutgers.edu/class-2014-1-17-610-557-01/rb832/archiveprototypehome.php

The project has been moved to a different platform after several iterations and possibilities were demonstrated.  No further development of this portal is planned as of right now.

If you are interested in the code used, you can download the files here:  ArchiveProtoypeFiles.zip

Especially useful (I imagine) would be the implode function used in the advancedsearch.php.  Using implode allows the query to ignore null values when users don’t input into all the search facets that would otherwise return rows.

$anf = $_POST[“artistnameform”];
$df = $_POST[“decadeform”];
$stf = $_POST[“subjecttermform”];
$ptf = $_POST[“phototitleform”];
$wheres = array();
if(!empty($ptf)){
$wheres[] = ” P.PhotoTitle=’$ptf ‘”;
}
if(!empty($anf)){
$wheres[] = ” PE.idPeople = ‘$anf ‘”;
}
if(!empty($stf)){
$wheres[] = ” S.idSubjectTerm = ‘$stf ‘”;
}
if(!empty($df)){
$wheres[] = ” P.PhotoCreatedDate LIKE CONCAT (‘%’, ‘$df’, ‘%’)”;
}
$where = implode(‘ AND ‘, $wheres);

There is also another piece in advancedsearchresults.php that pulls the image links from the database and displays them at a specified size.   Retrieving info from the database as an array lets us display it in a table using the echo command and the last row in the table displays the image at a specified size.   If you use the search function on the demo site you can see that the images load relatively slowly.  It is currently resizing relatively large tiff files that are stored on the server.  The Rutgers server I’m working on doesn’t currently support the GD graphics library, but once it is on a library server the thumbnail generation can be streamlined to improve performance.

while($row = mysql_fetch_array($result)){
echo ‘<tr>
<td>
Photo Title: ‘.$row[PhotoTitle].’
</td>
</tr>
<tr>
<td>
Description: ‘.$row[PhotoCaption].’
</td>
</tr>
<tr>
<td>
Image Author: ‘.$row[LastName].’, ‘.$row[FirstName].’
</td>
</tr>
<tr>
<td>
<a href=”‘.$row[PhotoURL].'”> <img name=”myimage” src=”‘.$row[PhotoURL].'” width=”200″ alt=”word” align=”left” style=”margin: 0px 0px 30px 0px”/></a>
</td>
</tr>’
;

 A final example is something I don’t recommend, but many people ask about, javacsript for removing the “right click>save image” as function in the browser.  This is not a way of protecting images you put online.  If you are really worried about image piracy, watermarking or constantly consulting tineye.com are better options.

<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js”></script>
<script>
$(document).ready(function(){
$(“img”).bind(“contextmenu”, function(e){
return false;
});
});
</script>