<% Response.Buffer = True %> DUgallery 3.0
CATS KISSING DOGS
<% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' HTTP="false" ' Catalog="" ' Schema="" MM_connDUgallery_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("_private\DUgallery.mdb") %> <% '**************************************************************************************** '** Copyright Notice '** Copyright 2003 DUware All Rights Reserved. '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** You may not pass the whole or any part of this application off as your own work. '** All links to DUware and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** No official support is available for this program but you may post support questions at: - '** http://www.duware.com/support '**************************************************************************************** %> <% set rsCount = Server.CreateObject("ADODB.Recordset") rsCount.ActiveConnection = MM_connDUgallery_STRING rsCount.Source = "SELECT (SELECT COUNT(*) FROM PICTURES WHERE PIC_APPROVED =1) AS PIC_COUNT, COUNT(*) AS TYPE_COUNT FROM TYPES" rsCount.CursorType = 0 rsCount.CursorLocation = 2 rsCount.LockType = 3 rsCount.Open() rsCount_numRows = 0 %>
There are <%=(rsCount.Fields.Item("PIC_COUNT").Value)%> pictures in <%=(rsCount.Fields.Item("TYPE_COUNT").Value)%> categories
<% rsCount.Close() %> <% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' HTTP="false" ' Catalog="" ' Schema="" MM_connDUgallery_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("_private\DUgallery.mdb") %> <% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' HTTP="false" ' Catalog="" ' Schema="" MM_connDUgallery_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("_private\DUgallery.mdb") %> <% '**************************************************************************************** '** Copyright Notice '** Copyright 2003 DUware All Rights Reserved. '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** You may not pass the whole or any part of this application off as your own work. '** All links to DUware and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** No official support is available for this program but you may post support questions at: - '** http://www.duware.com/support '**************************************************************************************** %> <% '*** Pure ASP File Upload 2.1.7 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 = """images""" pau_Extensions = "GIF,JPG,JPEG,BMP,PNG" pau_Form = "form1" pau_Redirect = "" pau_storeType = "file" pau_sizeLimit = "" pau_nameConflict = "uniq" pau_requireUpload = "true" pau_minWidth = "" pau_minHeight = "" pau_maxWidth = "" pau_maxHeight = "" pau_saveWidth = "PIC_WIDTH" pau_saveHeight = "PIC_HEIGHT" pau_timeout = "600" pau_progressBar = "" pau_progressWidth = "300" pau_progressHeight = "100" Dim RequestBin, UploadRequest CheckPureUploadVersion 2.17 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 %> <% ' *** Smart Image Processor 1.1.2 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 = false RUF_AspectImages = true RUF_maxWidth = "500" RUF_maxHeight = "500" RUF_Quality = "80" RUF_MakeThumb = true RUF_AspectThumb = true RUF_Suffix = "_small" RUF_maxWidthThumb = "100" RUF_maxHeightThumb = "100" RUF_QualityThumb = "70" 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 Dim MM_editAction Dim MM_abortEdit Dim MM_editQuery Dim MM_editCmd Dim MM_editConnection Dim MM_editTable Dim MM_editRedirectUrl Dim MM_editColumn Dim MM_recordId Dim MM_fieldsStr Dim MM_columnsStr Dim MM_fields Dim MM_columns Dim MM_typeArray Dim MM_formVal Dim MM_delim Dim MM_altVal Dim MM_emptyVal Dim MM_i MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) If (UploadQueryString <> "") Then MM_editAction = MM_editAction & "?" & UploadQueryString End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Insert Record: (Modified for File Upload) set variables If (CStr(UploadFormRequest("MM_insert")) = "form1") Then MM_editConnection = MM_connDUgallery_STRING MM_editTable = "PICTURES" MM_editRedirectUrl = "default.asp" MM_fieldsStr = "PIC_TYPE|value|PIC_NAME|value|PIC_PICTURE|value|PIC_DATED|value|PIC_DESCRIPTION|value|PIC_HEIGHT|value|PIC_WIDTH|value|PIC_APPROVED|value" MM_columnsStr = "PIC_TYPE|none,none,NULL|PIC_NAME|',none,''|PIC_IMAGE|',none,''|PIC_DATED|',none,NULL|PIC_DESCRIPTION|',none,''|PIC_HEIGHT|',none,''|PIC_WIDTH|',none,''|PIC_APPROVED|none,none,NULL" ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(MM_i+1) = CStr(UploadFormRequest(MM_fields(MM_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 %> <% ' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it Dim MM_tableValues Dim MM_dbValues If (CStr(UploadFormRequest("MM_insert")) <> "") Then ' create the sql insert statement MM_tableValues = "" MM_dbValues = "" For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_formVal = MM_fields(MM_i+1) MM_typeArray = Split(MM_columns(MM_i+1),",") MM_delim = MM_typeArray(0) If (MM_delim = "none") Then MM_delim = "" MM_altVal = MM_typeArray(1) If (MM_altVal = "none") Then MM_altVal = "" MM_emptyVal = MM_typeArray(2) If (MM_emptyVal = "none") Then MM_emptyVal = "" If (MM_formVal = "") Then MM_formVal = MM_emptyVal Else If (MM_altVal <> "") Then MM_formVal = MM_altVal ElseIf (MM_delim = "'") Then ' escape quotes MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'" Else MM_formVal = MM_delim + MM_formVal + MM_delim End If End If If (MM_i <> LBound(MM_fields)) Then MM_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End If MM_tableValues = MM_tableValues & MM_columns(MM_i) MM_dbValues = MM_dbValues & MM_formVal Next MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")" If (Not MM_abortEdit) Then ' execute the insert 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 rsType Dim rsType_numRows Set rsType = Server.CreateObject("ADODB.Recordset") rsType.ActiveConnection = MM_connDUgallery_STRING rsType.Source = "SELECT * FROM TYPES ORDER BY TYPE_NAME ASC" rsType.CursorType = 0 rsType.CursorLocation = 2 rsType.LockType = 1 rsType.Open() rsType_numRows = 0 %> <% rsType.Close() Set rsType = Nothing %>