{"id":20,"date":"2015-01-03T02:30:47","date_gmt":"2015-01-03T02:30:47","guid":{"rendered":"http:\/\/rdavidbeales.com\/portfolio\/?p=20"},"modified":"2015-03-31T22:18:09","modified_gmt":"2015-03-31T22:18:09","slug":"alexander-library-historical-photography-database","status":"publish","type":"post","link":"http:\/\/rdavidbeales.com\/portfolio\/2015\/01\/03\/alexander-library-historical-photography-database\/","title":{"rendered":"Alexander Library Historical Photography Database"},"content":{"rendered":"<body><p>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.<\/p>\n<p>In order to make accessing the images simpler for University departments\/clients who have received clearance\u00a0 to use the images, the University Archives needed an in-house database that uses a simple browser interface.\u00a0 The link below is a proof of concept that provides both simple and advanced facet searches.<\/p>\n<p><!--more--><a class=\"wp-more-tag mce-wp-more\" title=\"Read more...\" href=\"http:\/\/studentweb.comminfo.rutgers.edu\/class-2014-1-17-610-557-01\/rb832\/archiveprototypehome.php\" data-wp-more=\"more\" data-wp-more-text=\"\" data-mce-placeholder=\"1\">http:\/\/studentweb.comminfo.rutgers.edu\/class-2014-1-17-610-557-01\/rb832\/archiveprototypehome.php<\/a><\/p>\n<p><!--more--><\/p>\n<p>The project has been moved to a different platform after several iterations and possibilities were demonstrated.\u00a0 No further development of this portal is planned as of right now.<\/p>\n<p>If you are interested in the code used, you can download the files here:\u00a0 <a href=\"http:\/\/rdavidbeales.com\/portfolio\/wp-content\/uploads\/2014\/12\/ArchiveProtoypeFiles.zip\">ArchiveProtoypeFiles.zip<\/a><\/p>\n<p>Especially useful (I imagine) would be the implode function used in the advancedsearch.php.\u00a0 Using implode allows the query to ignore null values when users don\u2019t input into all the search facets that would otherwise return rows.<\/p>\n<p style=\"font-size: xx-small;\">$anf = $_POST[\u201cartistnameform\u201d];<br>\n$df = $_POST[\u201cdecadeform\u201d];<br>\n$stf = $_POST[\u201csubjecttermform\u201d];<br>\n$ptf = $_POST[\u201cphototitleform\u201d];<br>\n$wheres = array();<br>\nif(!empty($ptf)){<br>\n$wheres[] = \u201d P.PhotoTitle=\u2019$ptf \u2018\u201d;<br>\n}<br>\nif(!empty($anf)){<br>\n$wheres[] = \u201d PE.idPeople = \u2018$anf \u2018\u201d;<br>\n}<br>\nif(!empty($stf)){<br>\n$wheres[] = \u201d S.idSubjectTerm = \u2018$stf \u2018\u201d;<br>\n}<br>\nif(!empty($df)){<br>\n$wheres[] = \u201d P.PhotoCreatedDate LIKE CONCAT (\u2018%\u2019, \u2018$df\u2019, \u2018%\u2019)\u201d;<br>\n}<br>\n$where = implode(\u2018 AND \u2018, $wheres);<\/p>\n<p>There is also another piece in advancedsearchresults.php that pulls the image links from the database and displays them at a specified size.\u00a0\u00a0 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.\u00a0\u00a0 If you use the search function on the demo site you can see that the images load relatively slowly.\u00a0 It is currently resizing relatively large tiff files that are stored on the server.\u00a0 The Rutgers server I\u2019m working on doesn\u2019t currently support the GD graphics library, but once it is on a library server the thumbnail generation can be streamlined to improve performance.<\/p>\n<p style=\"font-size: xx-small;\">while($row = mysql_fetch_array($result)){<br>\necho \u2018&lt;tr&gt;<br>\n&lt;td&gt;<br>\nPhoto Title: \u2018.$row[PhotoTitle].\u2019<br>\n&lt;\/td&gt;<br>\n&lt;\/tr&gt;<br>\n&lt;tr&gt;<br>\n&lt;td&gt;<br>\nDescription: \u2018.$row[PhotoCaption].\u2019<br>\n&lt;\/td&gt;<br>\n&lt;\/tr&gt;<br>\n&lt;tr&gt;<br>\n&lt;td&gt;<br>\nImage Author: \u2018.$row[LastName].\u2019, \u2018.$row[FirstName].\u2019<br>\n&lt;\/td&gt;<br>\n&lt;\/tr&gt;<br>\n&lt;tr&gt;<br>\n&lt;td&gt;<br>\n&lt;a href=\u201d\u2018.$row[PhotoURL].'\u201d&gt; &lt;img name=\u201dmyimage\u201d src=\u201d\u2018.$row[PhotoURL].'\u201d width=\u201d200\u2033 alt=\u201dword\u201d align=\u201dleft\u201d style=\u201dmargin: 0px 0px 30px 0px\u201d\/&gt;&lt;\/a&gt;<br>\n&lt;\/td&gt;<br>\n&lt;\/tr&gt;\u2019<br>\n;<\/p>\n<p>\u00a0A final example is something I don\u2019t recommend, but many people ask about, javacsript for removing the \u201cright click&gt;save image\u201d as function in the browser.\u00a0 This is not a way of protecting images you put online.\u00a0 If you are really worried about image piracy, watermarking or constantly consulting <a href=\"http:\/\/tineye.com\">tineye.com<\/a> are better options.<\/p>\n<p style=\"font-size: xx-small;\">&lt;script src=\u201dhttps:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.4.4\/jquery.min.js\u201d&gt;&lt;\/script&gt;<br>\n&lt;script&gt;<br>\n$(document).ready(function(){<br>\n$(\u201cimg\u201d).bind(\u201ccontextmenu\u201d, function(e){<br>\nreturn false;<br>\n});<br>\n});<br>\n&lt;\/script&gt;<\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>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\u00a0 to use [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7,3,6,10,5],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-libraries","category-photography","category-programming","category-rutgers","category-web-design"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":2,"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":128,"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/posts\/20\/revisions\/128"}],"wp:attachment":[{"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rdavidbeales.com\/portfolio\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}