<%@LANGUAGE="VBSCRIPT"%> <% '---------- Computer Postcards -------------------------------- 'Copyright (c) 2002-2003 Jackie Johnston, ComputerPostcards.com 'All Rights Reserved. 'Version: 2.0.4 '-------------------------------------------------------------- %> <% ' *** Logout the current user. MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1" If (CStr(Request("MM_Logoutnow")) = "1") Then Session.Abandon MM_logoutRedirectPage = "subscriberlogin.asp" ' redirect with URL parameters (remove the "MM_Logoutnow" query param). if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL")) If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then MM_newQS = "?" For Each Item In Request.QueryString If (Item <> "MM_Logoutnow") Then If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&" MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item)) End If Next if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS End If Response.Redirect(MM_logoutRedirectPage) End If %> <% '---------- Computer Postcards -------------------------------- 'Copyright (c) 2002-2003 Jackie Johnston, ComputerPostcards.com 'All Rights Reserved. 'Version: 2.0.4 '-------------------------------------------------------------- %> <% '*** Pure ASP File Upload ----------------------------------------------------- ' Copyright (c) 2001-2002 George Petrov, www.UDzone.com ' Process the upload ' Version: 2.0.9 '------------------------------------------------------------------------------ '*** File Upload to: """images""", Extensions: "GIF,JPG,JPEG,BMP,PNG", Form: form1, Redirect: "", "file", "500", "uniq", "true", "", "" , "", "", "photowidth", "photoheight", "600", "", "300", "100" Dim GP_redirectPage, RequestBin, UploadQueryString, GP_uploadAction, UploadRequest PureUploadSetup If (CStr(Request.QueryString("GP_upload")) <> "") Then on error resume next Dim reqPureUploadVersion, foundPureUploadVersion reqPureUploadVersion = 2.09 foundPureUploadVersion = getPureUploadVersion() if err or reqPureUploadVersion > foundPureUploadVersion then Response.Write "You don't have latest version of ScriptLibrary/incPureUpload.asp uploaded on the server.
" Response.Write "This library is required for the current page. It is fully backwards compatible so old pages will work as well.
" Response.End end if on error goto 0 GP_redirectPage = "" Server.ScriptTimeout = 600 RequestBin = Request.BinaryRead(Request.TotalBytes) Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin, """images""", "file", "500", "uniq" If (GP_redirectPage <> "" and not (CStr(UploadFormRequest("MM_insert")) <> "" or CStr(UploadFormRequest("MM_update")) <> "")) Then If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then GP_redirectPage = GP_redirectPage & "?" & UploadQueryString End If Response.Redirect(GP_redirectPage) end if else if UploadQueryString <> "" then UploadQueryString = UploadQueryString & "&GP_upload=true" else UploadQueryString = "GP_upload=true" end if end if ' End Pure Upload '------------------------------------------------------------------------------ %> <% ' *** 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 = "" %> <% ' *** Insert Record: (Modified for File Upload) set variables If (CStr(UploadFormRequest("MM_insert")) <> "") Then MM_editConnection = MM_connCards_STRING MM_editTable = "photos" MM_editRedirectUrl = "greeting3.asp" MM_fieldsStr = "PHOTOURL|value|photoheight|value|photowidth|value" MM_columnsStr = "photourl|',none,''|photoheight|none,none,NULL|photowidth|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 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 %> <% ' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it If (CStr(UploadFormRequest("MM_insert")) <> "") Then ' create the sql insert statement MM_tableValues = "" MM_dbValues = "" 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_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End if MM_tableValues = MM_tableValues & MM_columns(i) MM_dbValues = MM_dbValues & 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 %> <% If (Request.Cookies("cardsenderemail") = "") Then Response.Cookies("cardsenderemail") = Request.Form("cardsenderemail") Response.Cookies("cardsenderemail").Expires = Date + 365 End If %> <% If (Request.Cookies("cardsendername") = "") Then Response.Cookies("cardsendername") = Request.Form("cardsendername") Response.Cookies("cardsendername").Expires = Date + 365 End If %> <% set rsPreferences = Server.CreateObject("ADODB.Recordset") rsPreferences.ActiveConnection = MM_connCards_STRING rsPreferences.Source = "SELECT * FROM preferences" rsPreferences.CursorType = 0 rsPreferences.CursorLocation = 2 rsPreferences.LockType = 3 rsPreferences.Open() rsPreferences_numRows = 0 %> <% set rsPostcardsText = Server.CreateObject("ADODB.Recordset") rsPostcardsText.ActiveConnection = MM_connCards_STRING rsPostcardsText.Source = "SELECT * FROM postcardstext" rsPostcardsText.CursorType = 0 rsPostcardsText.CursorLocation = 2 rsPostcardsText.LockType = 3 rsPostcardsText.Open() rsPostcardsText_numRows = 0 %> <% Dim rsSubscriber__MMColParam rsSubscriber__MMColParam = "1" if (Session("MM_Username") <> "") then rsSubscriber__MMColParam = Session("MM_Username") %> <% set rsSubscriber = Server.CreateObject("ADODB.Recordset") rsSubscriber.ActiveConnection = MM_connCards_STRING rsSubscriber.Source = "SELECT * FROM subscribers WHERE subscribe_username = '" + Replace(rsSubscriber__MMColParam, "'", "''") + "'" rsSubscriber.CursorType = 0 rsSubscriber.CursorLocation = 2 rsSubscriber.LockType = 3 rsSubscriber.Open() rsSubscriber_numRows = 0 %> <% Dim Recordset1__MMColParam Recordset1__MMColParam = "1" If (Request("MM_EmptyValue") <> "") Then Recordset1__MMColParam = Request("MM_EmptyValue") End If %> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_connCards_STRING Recordset1.Source = "SELECT * FROM optin WHERE optin_active = " + Replace(Recordset1__MMColParam, "'", "''") + "" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each Item In Request.QueryString NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item)) End If Next ' add the Form variables to the MM_keepForm string For Each Item In Request.Form NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <%=(rsPreferences.Fields.Item("headhtml").Value)%> <%=(rsPostcardsText.Fields.Item("cus_useyourown").Value)%> " bgcolor="<%=(rsPreferences.Fields.Item("bkgcolor").Value)%>" text="<%=(rsPreferences.Fields.Item("textcolor").Value)%>" link="<%=(rsPreferences.Fields.Item("linkcolor").Value)%>" vlink="<%=(rsPreferences.Fields.Item("vlinkcolor").Value)%>" alink="<%=(rsPreferences.Fields.Item("alinkcolor").Value)%>" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" <%=(rsPreferences.Fields.Item("bodyhtml").Value)%>> <%=(rsPreferences.Fields.Item("tophtml").Value)%> <% If (rsPreferences.Fields.Item("subscriptions").Value) = (1) Then 'script %>

<% If rsSubscriber.EOF And rsSubscriber.BOF Then %> <% End If ' end rsSubscriber.EOF And rsSubscriber.BOF %> <% If Not rsSubscriber.EOF Or Not rsSubscriber.BOF Then %> <% End If ' end Not rsSubscriber.EOF Or NOT rsSubscriber.BOF %> <% If Not rsSubscriber.EOF Or Not rsSubscriber.BOF Then %> <% End If ' end Not rsSubscriber.EOF Or NOT rsSubscriber.BOF %>
" size="-2"><%=(rsPostcardsText.Fields.Item("sub_signin").Value)%> | " size="-2"><%=(rsPostcardsText.Fields.Item("sub_joinnow").Value)%>" size="-2">  <%=(rsSubscriber.Fields.Item("subscribe_name").Value)%>
(<%=(rsPostcardsText.Fields.Item("sub_ifnotu").Value)%> <%=(rsPostcardsText.Fields.Item("sub_click").Value)%>.)
" size="-2">"><%=(rsPostcardsText.Fields.Item("sub_profile").Value)%>
<% End If ' end If (rsPreferences.Fields.Item("subscriptions").Value) = (1) script %>

" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_choose").Value)%>


  <% If (((rsPreferences.Fields.Item("subscriptions").Value) = (1)) AND (Not rsSubscriber.EOF Or Not rsSubscriber.BOF)) OR (rsPreferences.Fields.Item("subscriptions").Value) = (0)Then %> <% End If %>

" color="<%=(rsPreferences.Fields.Item("cardtextcolor").Value)%>"><%=(rsPostcardsText.Fields.Item("cus_useyourown").Value)%>

" color="<%=(rsPreferences.Fields.Item("cardtextcolor").Value)%>" size="-1"><%=(rsPostcardsText.Fields.Item("cus_yourimage").Value)%>


">


" color="<%=(rsPreferences.Fields.Item("cardtextcolor").Value)%>" size="-1"><%=(rsPostcardsText.Fields.Item("cus_onlineimage").Value)%>


">
" color="<%=(rsPreferences.Fields.Item("cardtextcolor").Value)%>" size="-1">
 
<%=(rsPreferences.Fields.Item("bottomhtml").Value)%> <% rsPreferences.Close() %> <% rsPostcardsText.Close() %> <% rsSubscriber.Close() %> <% Recordset1.Close() Set Recordset1 = Nothing %>