<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Modify Store Text Configurations ' Product : CandyPress Store Frontend ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 0 %> <% 'Text Variables dim termsAndCond dim saveOrderEmail dim paySuccessMsg dim payErrorMsg dim passRequestEmail dim emailToFriend dim statusUpdateEmail dim cartMsg 'Database variables dim mySQL, cn, rs '************************************************************************* 'Are we in demo mode? if demoMode = "Y" then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("DEMO MODE. Sorry, this featured is NOT available in Demo Mode.") end if 'Get variables from the Form termsAndCond = trim(Request.Form("termsAndCond")) cartMsg = trim(Request.Form("cartMsg")) saveOrderEmail = trim(Request.Form("saveOrderEmail")) paySuccessMsg = trim(Request.Form("paySuccessMsg")) payErrorMsg = trim(Request.Form("payErrorMsg")) passRequestEmail = trim(Request.Form("passRequestEmail")) emailToFriend = trim(Request.Form("emailToFriend")) statusUpdateEmail = trim(Request.Form("statusUpdateEmail")) 'termsAndCond if len(termsAndCond) = 0 then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Terms and Conditions can not be empty.") end if 'saveOrderEmail if len(saveOrderEmail) = 0 then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Save Order Email Body can not be empty.") end if 'statusUpdateEmail if len(statusUpdateEmail) = 0 then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Update Order Status Email Body can not be empty.") end if 'passRequestEmail if len(passRequestEmail) = 0 then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Password Request Email Body can not be empty.") end if 'emailToFriend if len(emailToFriend) = 0 then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Email To Friend Email Body can not be empty.") end if 'paySuccessMsg if len(paySuccessMsg) = 0 then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Successful Payment Message can not be empty.") end if 'payErrorMsg if len(payErrorMsg) = 0 then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Unsuccessful Payment Message can not be empty.") end if 'Update the text configuration file call writeConfigFile() %>

Text Configuration


Success!


Text Configurations were successfully updated.

<% '********************************************************************** 'Update Text Configurations '********************************************************************** sub writeConfigFile() 'Create an array of variables which will use to drive the update dim configArr, I configArr = "termsAndCond,saveOrderEmail,paySuccessMsg," _ & "payErrorMsg,passRequestEmail,emailToFriend," _ & "statusUpdateEmail,cartMsg" configArr = split(configArr,",") 'Open Database call openDb() 'Loop through array and UPDATE / INSERT new config settings for I = 0 to UBound(configArr) if len(trim(configArr(I))) > 0 then mySQL = "SELECT configVar " _ & "FROM storeAdmin " _ & "WHERE configVar='" & configArr(I) & "' " _ & "AND adminType='T'" set rs = openRSexecute(mySQL) if rs.EOF then 'INSERT call closeRS(rs) mySQL = "INSERT INTO storeAdmin " _ & "(adminType,configVar,configValLong) " _ & "VALUES " _ & "('T','" & configArr(I) & "','" & replace(eval(configArr(I)),"'","''") & "')" set rs = openRSexecute(mySQL) else 'UPDATE call closeRS(rs) mySQL = "UPDATE storeAdmin SET " _ & " configValLong='" & replace(eval(configArr(I)),"'","''") & "' " _ & "WHERE configVar='" & configArr(I) & "' " _ & "AND adminType='T'" set rs = openRSexecute(mySQL) end if end if next 'Close Database call closedb() end sub %>