Signature Ice - Gallery Editor preview

Back to main editor


Choose a category below OR add a categoryAdd a new category

<% 'categories set rscat=objConn.execute("select * from cats order by catid") if not rscat.eof then category=rscat("category") response.write "" do while not rscat.eof response.write "" rscat.movenext loop response.write "
 [ " & rscat("category") & " ] 

" end if if request.querystring("add")="cat" then response.write "

Add a new category

There are two boxes below, one for the name you want displayed on the gallery category page.
The other is a one word filename for the new folder to keep things simple on the server.

" response.write "
Category Display Name
One word folder name
(No punctuation please.)
" end if 'Photos if request.querystring("edit") >"" and request.querystring("pic")="" then set heading=objConn.execute("select * from cats where catid=" & request.querystring("edit")) if not heading.eof then heading=heading("category") end if%>

Photo Uploader for <%=heading%>

" ENCTYPE="MULTIPART/FORM-DATA" METHOD="POST">
Image Name
Image Description
  

<% set cat=objConn.execute("select * from cats where catid=" & request.querystring("edit")) set rsEdit=objConn.execute("select * from qyphotos WHERE catid=" & request.querystring("edit")) response.write "

" & cat("category") & " Photo Gallery Editor (Edit description directly in the box and/or choose a new thumbnail and click update at the bottom)

" response.write "

Delete this category and all associated files

" if not rsEdit.eof then response.write "
" response.write "" if not rsEdit.eof then response.write "" end if end if 'upload response.write "
" response.write "
" do while not rsEdit.eof if rsEdit("catImage").value=rsEdit("photoImage").value then stat=" checked" else stat="" end if %> <%response.write "" %> <%response.write "" rsEdit.movenext loop response.write "" response.write "
Category
Thumb
ImageAction
" <%if rsEdit("catImage") = rsEdit("photoImage") then response.write " Checked" %>> /<%=rsedit("photoImage")%>" target="_blank">/<%=rsedit("photoImage")%>" <%=ImageResize(Server.MapPath("/" & rsedit("catDir") & "/" & rsedit("photoImage")), 150, 150)%> style="border-width:thin; border-color:#000099; border-style:solid">&photoid=<%=rsedit("photoid")%>">ReplaceDelete
" response.write "
" end if %> <% if request.form("btUpdatePhotos")>"" then 'update the photo thumbnails and description set a_order=objConn.execute("select * from photos") do while not a_order.eof For Each sItem In Request.Form if sItem="thmb" then cID=request.form("thmb") set getPic=objConn.execute("select * from photos where photoid=" & cID) if not getPic.eof then photoImage=getPic("photoImage") end if objConn.execute("update cats set catimage='" & photoImage & "' WHERE catid=" & request.form("cid")) end if if sItem="desc" & a_order("photoid") then dID=replace(sItem,"desc","") objConn.execute("update photos set photoDesc='" & replace(request(sItem),"'","'") & "' WHERE photoid=" & dID) end if Next a_order.movenext loop response.redirect "gallery.asp?edit=" & request.form("cid") end if 'delete file fso if request.querystring("delete")>"" then set rsd=objConn.execute("select * from qyphotos where photoid=" & request.querystring("delete")) if not rsd.eof then filespec=server.mappath("/" & rsd("catdir") & "/" & rsd("photoimage")) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFile(filespec) objConn.execute("delete from photos where photoid=" & request.querystring("delete")) response.redirect "gallery.asp?edit=" & request.querystring("edit") end if end if 'delete folder if request.querystring("deletefolder")>"" then set df=objConn.execute("select * from cats where catid=" & request.querystring("deletefolder")) if not df.eof then dim filesys2 Set filesys2 = CreateObject("Scripting.FileSystemObject") If filesys2.FolderExists(server.mappath("\" & df("catdir"))) Then filesys2.DeleteFolder (server.mappath("\" & df("catdir"))),true Response.Write("Folder deleted") End If objConn.execute("delete from cats where catid=" & request.querystring("deletefolder")) response.redirect "gallery.asp" else response.write "

This folder doesn't exist

" end if end if 'create folder if request.form("btadd")>"" then Dim fldr 'foldername is the name of the folder you wish to 'create passed by value into this create procedure dim filesys, newfolder, newfolderpath newfolderpath = server.mappath("/gallery/" & request.form("adddir")) set filesys=CreateObject("Scripting.FileSystemObject") If Not filesys.FolderExists(newfolderpath) Then Set newfolder = filesys.CreateFolder(newfolderpath) Response.Write("A new folder has been created at: " & newfolderpath) else response.write "this folder already exists." End If objConn.execute("insert into cats (catdir,category) values ('gallery/" & request.form("adddir") & "','" & request.form("addcat") & "')") response.redirect "gallery.asp" end if %>