<%@LANGUAGE="VBSCRIPT"%> <% '*** Pure ASP File Upload 2.1.3 Dim GP_uploadAction,UploadQueryString PureUploadSetup If (CStr(Request.QueryString("GP_upload")) <> "") Then Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout,pau_progressBar,pau_progressWidth,pau_progressHeight pau_thePath = """../cgi-bin/mypics/"" & Session(""Username"") & ""/"" & UploadFormRequest(""CatID"")" pau_Extensions = "GIF,JPG,JPEG,BMP,PNG" pau_Form = "form1" pau_Redirect = "" pau_storeType = "file" pau_sizeLimit = "" pau_nameConflict = "over" pau_requireUpload = "false" pau_minWidth = "" pau_minHeight = "" pau_maxWidth = "" pau_maxHeight = "" pau_saveWidth = "width" pau_saveHeight = "hieght" pau_timeout = "600" pau_progressBar = "showProgress.htm" pau_progressWidth = "300" pau_progressHeight = "100" Dim RequestBin, UploadRequest CheckPureUploadVersion 2.13 ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout end if %> <% Dim rsSettings Dim rsSettings_numRows Set rsSettings = Server.CreateObject("ADODB.Recordset") rsSettings.ActiveConnection = MM_mygallery_STRING rsSettings.Source = "SELECT * FROM Settings" rsSettings.CursorType = 0 rsSettings.CursorLocation = 2 rsSettings.LockType = 1 rsSettings.Open() rsSettings_numRows = 0 %> <% ' *** Smart Image Processor 1.1.1 If (CStr(Request.QueryString("GP_upload")) <> "") Then Dim RUF_Component, RUF_DotNetResize, RUF_ResizeImages, RUF_AspectImages, RUF_maxWidth, RUF_maxHeight, RUF_Quality, RUF_MakeThumb, RUF_AspectThumb, RUF_Suffix, RUF_maxWidthThumb, RUF_maxHeightThumb, RUF_QualityThumb, RUF_RedirectURL RUF_Component = "AUTO" RUF_DotNetResize = "ScriptLibrary/ResizeImage.aspx" RUF_ResizeImages = true RUF_AspectImages = true RUF_maxWidth = rsSettings.Fields.Item("LargeWidth").Value RUF_maxHeight = rsSettings.Fields.Item("LargeHieght").Value RUF_Quality = rsSettings.Fields.Item("Picquality").Value RUF_MakeThumb = true RUF_AspectThumb = true RUF_Suffix = "_small" RUF_maxWidthThumb = rsSettings.Fields.Item("ThumbWidth").Value RUF_maxHeightThumb = rsSettings.Fields.Item("ThumbHieght").Value RUF_QualityThumb = rsSettings.Fields.Item("Thumbquality").Value RUF_RedirectURL = "" if RUF_ResizeImages then ResizeUploadedFiles RUF_Component, RUF_DotNetResize, pau_thePath, "", RUF_maxWidth, RUF_maxHeight, RUF_Quality, true, pau_saveWidth, pau_saveHeight, RUF_AspectImages, pau_nameConflict end if if RUF_MakeThumb then ResizeUploadedFiles RUF_Component, RUF_DotNetResize, pau_thePath, RUF_Suffix, RUF_maxWidthThumb, RUF_maxHeightThumb, RUF_QualityThumb, false, pau_saveWidth, pau_saveHeight, RUF_AspectThumb, pau_nameConflict end if if RUF_RedirectURL <> "" then Response.Redirect RUF_RedirectURL end if end if %> <% ' *** Edit Operations: (Modified for File Upload) declare variables MM_editAction = CStr(Request.ServerVariables("URL")) 'MM_editAction = CStr(Request("URL")) If (UploadQueryString <> "") Then MM_editAction = MM_editAction & "?" & UploadQueryString End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Update Record: (Modified for File Upload) set variables If (CStr(UploadFormRequest("MM_update")) <> "" And CStr(UploadFormRequest("MM_recordId")) <> "") Then MM_editConnection = MM_mygallery_STRING MM_editTable = "Pictures" MM_editColumn = "ID" MM_recordId = "" + UploadFormRequest("MM_recordId") + "" MM_editRedirectUrl = "update.asp" MM_fieldsStr = "file|value|Description|value|CatID|value|width|value|hieght|value" MM_columnsStr = "Image|',none,''|Description|',none,''|CatID|none,none,NULL|Width|none,none,NULL|Hieght|none,none,NULL" ' create the MM_fields and MM_columns arrays MM_columnsStr = FixColumnsForUpload(MM_fieldsStr,MM_columnsStr) MM_fieldsStr = FixFieldsForUpload(MM_fieldsStr,MM_columnsStr) MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(i+1) = CStr(UploadFormRequest(MM_fields(i))) Next ' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And UploadQueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString End If End If End If %> <% ' *** Update Record: (Modified for File Upload) construct a sql update statement and execute it If (CStr(UploadFormRequest("MM_update")) <> "" And CStr(UploadFormRequest("MM_recordId")) <> "") Then ' create the sql update statement MM_editQuery = "update " & MM_editTable & " set " For i = LBound(MM_fields) To UBound(MM_fields) Step 2 FormVal = MM_fields(i+1) MM_typeArray = Split(MM_columns(i+1),",") Delim = MM_typeArray(0) If (Delim = "none") Then Delim = "" AltVal = MM_typeArray(1) If (AltVal = "none") Then AltVal = "" EmptyVal = MM_typeArray(2) If (EmptyVal = "none") Then EmptyVal = "" If (FormVal = "") Then FormVal = EmptyVal Else If (AltVal <> "") Then FormVal = AltVal ElseIf (Delim = "'") Then ' escape quotes FormVal = "'" & Replace(FormVal,"'","''") & "'" Else FormVal = Delim + FormVal + Delim End If End If If (i <> LBound(MM_fields)) Then MM_editQuery = MM_editQuery & "," End If MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal Next MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then ' execute the update Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% Dim rsPictures__MM_ColParam rsPictures__MM_ColParam = "1" if (Request.QueryString("ID") <> "") then rsPictures__MM_ColParam = Request.QueryString("ID") %> <% set rsPictures = Server.CreateObject("ADODB.Recordset") rsPictures.ActiveConnection = MM_mygallery_STRING rsPictures.Source = "SELECT * FROM PictureQuery WHERE ID = " + Replace(rsPictures__MM_ColParam, "'", "''") + " ORDER BY CatID DESC" rsPictures.CursorType = 0 rsPictures.CursorLocation = 2 rsPictures.LockType = 3 rsPictures.Open() rsPictures_numRows = 0 IF rsPictures.fields.Item("UserID").Value <> Session("UserID") THEN IF Session("UserID") <> "1" THEN Response.Write("Sorry you cannot performce this action.") Response.End() rsPictures.Close() END IF END IF %> <% Dim rsCat__MMColParam rsCat__MMColParam = "1" If (Session("UserID") <> "") Then rsCat__MMColParam = Session("UserID") End If %> <% set rsCat = Server.CreateObject("ADODB.Recordset") rsCat.ActiveConnection = MM_mygallery_STRING rsCat.Source = "SELECT * FROM Category WHERE UserID =" + Replace(rsCat__MMColParam, "'", "''") + " ORDER BY CatID DESC" rsCat.CursorType = 0 rsCat.CursorLocation = 2 rsCat.LockType = 3 rsCat.Open() rsCat_numRows = 0 %> Update Image
<% If Session("UserID") = "1" Then %> <% End If%>
/<%=(rsPictures.Fields.Item("CatID").Value)%>/<%=(rsPictures.Fields.Item("Image").Value)%>','LargeVIew','scrollbars=yes,resizable=yes','800','600','true')">/<%=(rsPictures.Fields.Item("CatID").Value)%>/<%= Thumbnail("_small",(rsPictures.Fields.Item("Image").Value)) %>" border="0">

Current image:

 

" size="32" disabled="yes">

*

Description:
Category: <% IF Csng(Session("UserID")) = Csng(rsPictures.Fields.Item("UserID").Value) THEN %> <% ELSE %> You may not chaage the category. "> <%END IF%>
">

* You must select an image to upload when updating.

 

Back to list - Manage categories - View Gallery

 

 

v5.0

'My ASP Thumbnail Gallery' is a product of Kattouf Internet Services Email: johnny@kattouf.com

<% rsPictures.Close() %> <% rsCat.Close() %> <% rsSettings.Close() Set rsSettings = Nothing %>