<%@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 %> <% 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 %> <% Dim rsPhoto__MMColParam rsPhoto__MMColParam = "1" if (Request.QueryString("id") <> "") then rsPhoto__MMColParam = Request.QueryString("id") %> <% set rsPhoto = Server.CreateObject("ADODB.Recordset") rsPhoto.ActiveConnection = MM_connCards_STRING rsPhoto.Source = "SELECT * FROM photos WHERE photoid = " + Replace(rsPhoto__MMColParam, "'", "''") + "" rsPhoto.CursorType = 0 rsPhoto.CursorLocation = 2 rsPhoto.LockType = 3 rsPhoto.Open() rsPhoto_numRows = 0 %> <% 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 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows %> <% ' *** 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)%> <%=(rsPreferences.Fields.Item("headhtml").Value)%> <%=(rsPostcardsText.Fields.Item("BASO_greetingtitle").Value)%> <% Session("Photo_ID") = (rsPhoto.Fields.Item("photoid").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"> <% If (((rsPreferences.Fields.Item("subscriptions").Value) = (1)) AND (Not rsSubscriber.EOF Or Not rsSubscriber.BOF)) OR (rsPreferences.Fields.Item("subscriptions").Value) = (0)Then %> <%=(rsPostcardsText.Fields.Item("BASO_personalize").Value)%> <% End If %> " size="-2"> <% If ((rsPreferences.Fields.Item("subscriptions").Value) = (1)) AND (rsSubscriber.EOF And rsSubscriber.BOF) Then %> <%=(rsPostcardsText.Fields.Item("sub_mustbe").Value)%>
<%=(rsPostcardsText.Fields.Item("sub_joinnow").Value)%> <% End If %>
" 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 %>
"> <% If (rsPreferences.Fields.Item("pref_borders").Value) = (1) Then 'script %> <% End If ' end If (rsPreferences.Fields.Item("pref_borders").Value) = (1) script %> <% If (rsPreferences.Fields.Item("pref_borders").Value) = (1) Then 'script %> <% End If ' end If (rsPreferences.Fields.Item("pref_borders").Value) = (1) script %> <% If (rsPreferences.Fields.Item("pref_borders").Value) = (1) Then 'script %> <% End If ' end If (rsPreferences.Fields.Item("pref_borders").Value) = (1) script %> <% If (rsPreferences.Fields.Item("pref_borders").Value) = (1) Then 'script %> <% End If ' end If (rsPreferences.Fields.Item("pref_borders").Value) = (1) script %>
"> <% If (rsPhoto.Fields.Item("photowidth").Value) <= (rsPhoto.Fields.Item("photoheight").Value) Then %> <% End If ' end If (rsPhoto.Fields.Item("photowidth").Value) <= (rsPhoto.Fields.Item("photoheight").Value) %> <% If (rsPhoto.Fields.Item("photoheight").Value) < (rsPhoto.Fields.Item("photowidth").Value) Then %> <% End If ' end If (rsPhoto.Fields.Item("photoheight").Value) < (rsPhoto.Fields.Item("photowidth").Value) %>
<% If (rsPhoto.Fields.Item("photoflash").Value) = (1) Then 'script %> " height="<%=(rsPhoto.Fields.Item("photoheight").Value)%>"> "> " quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="<%=(rsPhoto.Fields.Item("photowidth").Value)%>" height="<%=(rsPhoto.Fields.Item("photoheight").Value)%>"> <% End If ' end If (rsPhoto.Fields.Item("photoflash").Value) = (1) script %> <% If (rsPhoto.Fields.Item("photoflash").Value) = (0) Then 'script %> " border="0"> <% End If ' end If (rsPhoto.Fields.Item("photoflash").Value) = (0) script %>
" size="-2" color="<%=(rsPreferences.Fields.Item("cardtextcolor").Value)%>"> <% If (rsPhoto.Fields.Item("copyrightlink").Value) > ("http://") Then 'script %> " target="_blank"> <%=(rsPhoto.Fields.Item("copyright").Value)%> <% End If ' end If (rsPhoto.Fields.Item("copyrightlink").Value) > ("http://") script %> <% If (rsPhoto.Fields.Item("copyrightlink").Value) <= ("http://") Then 'script %> <%=(rsPhoto.Fields.Item("copyright").Value)%> <% End If ' end If (rsPhoto.Fields.Item("copyrightlink").Value) <= ("http://") script %>
<% If (rsPreferences.Fields.Item("pref_stamp").Value) <> ("") Then 'script %> <% End If ' end If (rsPreferences.Fields.Item("pref_stamp").Value) <> ("") script %>

" face="<%=(rsPreferences.Fields.Item("font").Value)%>"><%=(rsPostcardsText.Fields.Item("BASO_title").Value)%>

" face="<%=(rsPreferences.Fields.Item("font").Value)%>" size="-1"><%=(rsPostcardsText.Fields.Item("BASO_dearsender").Value)%>
" face="<%=(rsPreferences.Fields.Item("font").Value)%>"> ">

" border="0" cellspacing="0" cellpadding="0">
<% If (rsPreferences.Fields.Item("pref_stamp").Value) <> ("") Then 'script %> <% End If ' end If (rsPreferences.Fields.Item("pref_stamp").Value) <> ("") script %>

" face="<%=(rsPreferences.Fields.Item("font").Value)%>"><%=(rsPostcardsText.Fields.Item("BASO_title").Value)%>

" face="<%=(rsPreferences.Fields.Item("font").Value)%>" size="-1"><%=(rsPostcardsText.Fields.Item("BASO_dearsender").Value)%>

" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_senton").Value)%>  <% If (rsPostcardsText.Fields.Item("BASO_dateformat").Value) = (1) Then 'script %> <%= DoDateTime( Now() , 2, 1033) %> <% End If ' end If (rsPostcardsText.Fields.Item("BASO_dateformat").Value) = (1) script %> <% If (rsPostcardsText.Fields.Item("BASO_dateformat").Value) = (2) Then 'script %> <%= DoDateTime( Now() , 2, 2057) %> <% End If ' end If (rsPostcardsText.Fields.Item("BASO_dateformat").Value) = (2) script %> <% If (rsPostcardsText.Fields.Item("BASO_dateformat").Value) = (3) Then 'script %> <%= DoDateTime( Now() , 2, 7177) %> <% End If ' end If (rsPostcardsText.Fields.Item("BASO_dateformat").Value) = (3) script %>  <%=(rsPostcardsText.Fields.Item("BASO_from").Value)%> <%=(rsPostcardsText.Fields.Item("BASO_you").Value)%> <%=(rsPostcardsText.Fields.Item("BASO_to").Value)%> <%=(rsPostcardsText.Fields.Item("BASO_them").Value)%>
 
" color="<%=(rsPreferences.Fields.Item("cardtextcolor").Value)%>" size="-1"> " size="-1"><%=(rsPostcardsText.Fields.Item("BASO_personalize").Value)%>
" color="<%=(rsPreferences.Fields.Item("cardtextcolor").Value)%>" size="-1">
','','1');return document.MM_returnValue"> <% If Not Recordset1.EOF Or Not Recordset1.BOF Then %> <% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_yourfriend").Value)%> ">
" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_friendemail").Value)%> ">
" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_yourname").Value)%> ">
" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_youremail").Value)%> ">
  " size="-2"> <%=(rsPostcardsText.Fields.Item("BASO_sendcopy").Value)%>
" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_titleyour").Value)%>
" size="-2"><%=(rsPostcardsText.Fields.Item("BASO_yourmessage").Value)%>
" size="-2"><%=(rsPostcardsText.Fields.Item("opt_option").Value)%> " size="-2"> <% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %> name="opted<%=(Recordset1.Fields.Item("optin_id").Value)%>" type="checkbox" id="opted<%=(Recordset1.Fields.Item("optin_id").Value)%>" value="1"> <%=(Recordset1.Fields.Item("optin_text").Value)%>
<% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Recordset1.MoveNext() Wend %>
  " size="-1"><%=(rsPostcardsText.Fields.Item("opt_which").Value)%>    <%=(rsPostcardsText.Fields.Item("opt_HTML").Value)%>
"> " onClick="tmt_regExpValidator('sentfrom','%5E%5B%5Cw%5C.=-%5D%2B@%5B%5Cw%5C.-%5D%2B%5C.%5Ba-z%5D%7B2,4%7D$','%3C%25=(rsPostcardsText.Fields.Item(%22BASO_errorfromemail%22).Value)%25%3E','','1');return document.MM_returnValue">
 
<%=(rsPreferences.Fields.Item("bottomhtml").Value)%> <% rsPhoto.Close() %> <% rsPreferences.Close() %> <% rsPostcardsText.Close() %> <% rsSubscriber.Close() %> <% Recordset1.Close() Set Recordset1 = Nothing %>