<% option explicit %> <% photoid = format_image_num(request("photoid")) Dim objRegExpr Set objRegExpr = New regexp objRegExpr.Pattern = "^\d{1,5}$" if photoid = "" or photoid = null then photoid = "0" end if if objRegExpr.Test(photoid) <> true then photoid = "0" end if 'checking to see if it's a photo If (Request("productTypeID") <> 2 and Request("productTypeID") <> 3 and Request("productTypeID") <> 4 and Request("productTypeID") <> 5) Then Dim nullCheck, rsphoto, rsrights, rsrights2, i, photoid, err_msg err_msg = "" set rsphoto = server.createobject("ADODB.recordset") 'checking if the photo has the web-publishing right and is approved rsphoto.open("select * from photo,photorightsLK,photostatusLK where " & _ "photo.photoid=" & photoid & " and photorightsLK.photoID=photo.photoID " & _ "and photostatusLK.photoid=photo.photoID and photorightsLK.photorightID=3 " & _ "and photostatuslk.photostatusid=3"), conn if (rsphoto.eof) then dim original_photoid original_photoid = photoid photoid = -1 ' invalid; show messages else 'updating the viewed column i = rsphoto("viewed") conn.execute("update photo set viewed=" & i+1 & " where photoid=" & photoid) end if End If Set rsphoto = nothing %> here is new york
<% 'if it's a photo then hit the db If (Request("productTypeID") <> 2 and Request("productTypeID") <> 3 and Request("productTypeID") <> 4 and Request("productTypeID") <> 5) Then if photoid = 7673 then 'WE CAN ONLY SELL THE BOOK AS OF 10/16/02 dim sellrights set sellrights = conn.execute("select * from photostatusLK where photostatusID=6 and photoid=" & photoid) If (not sellrights.eof) then ' available for sale set rsrights2 = server.createobject("ADODB.recordset") rsrights2.open("select * from photorightsLK where photorightID=1 and " & _ " photoid=" & photoid), conn If (not rsrights2.eof) then ' available for sale %> <% rsrights2.close End If End If end if Else if photoid = 7673 then 'WE CAN ONLY SELL THE BOOK AS OF 10/16/02 %> <% end if End If %> <% If session("WTCCart") = "" Then Response.Write "" ' "Your shopping bag is empty" message can go here else %> <% end if %> >Email to a friend  
<% if photoid > -1 then dim isViewpoint 'to dis-enable viewpoint set photostatusid back to 100 in the query set isViewpoint = conn.execute("select * from photostatuslk where photostatusid=1 and photoid=" & photoid) %>
<% if not isViewpoint.eof then if request.querystring("advanced") <> "advanced viewing" then response.write "" else response.write "" end if end if %> >
<% if request.querystring("advanced") = "advanced viewing" then %> <% else if not isViewpoint.eof then %> click on image for advanced viewing
<% Else %>
<% end if end if %>
Product number is <%=photoid%> <% If (Request("productTypeID") <> 2 and Request("productTypeID") <> 3 and Request("productTypeID") <> 4 and Request("productTypeID") <> 5) Then %> <% end if %>
The net proceeds of your order are donated to the Children's Aid Society.

<% else %>

We are sorry, either:
  • this picture does not exist
  • has not been approved in our system
  • or we have not been granted the rights to display this image on our web site.
If you are the photographer, an you think this is an error, email info@hereisnewyork.org for your status. Images take several weeks to be reviewed for our archive.

<% 'if it's a photo then hit the db If (Request("productTypeID") <> 2 and Request("productTypeID") <> 3 and Request("productTypeID") <> 4 and Request("productTypeID") <> 5) Then set rsrights = server.createobject("ADODB.recordset") rsrights.open("select * from photostatusLK where photostatusID=6 and " & _ " photoid=" & original_photoid), conn If not (rsrights.eof) then ' available for sale %>
We do not have the right to display this image but you may order it.

<% End If rsrights.close Else %> <% End If %> <% end if %>

No public display, reproduction, printed or electronic, is permitted without the prior written permission of the photographer.