<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "570, 571, 585, 401, 402, 359" strThisBackPage = "config" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== Dim Uploader, File Set Uploader = New FileUploader Uploader.Upload() numLangID = uploader.form("numLangID") N_DeleteImage = Uploader.Form("N_DeleteImage") aryNewsIDs = split(Mid(uploader.form("NewsIDs"), 3), ",") '------------------------------------------- 'CHECK FILE UPLOAD IS OK FILETYPE '------------------------------------------- If Uploader.Files.Exists("N_Image") Then strFileUploadName = Uploader.Files("N_Image").FileName If Not strFileUploadName = "" Then aryFileUploadName = Split(strFileUploadName, ".") strFileType = LCase(aryFileUploadName(Ubound(aryFileUploadName))) End If If InStr("," & Application(LICENSENUMBER & "allowedimages") & ",", "," & strFileType & ",") < 1 Then numErrorNo = numErrorNo + 1 strErrorText = strErrorText + "" + CStr(numErrorNo) + ". " + GetString("ContentText_ErrorChkUploadFileType") & replace(Application(LICENSENUMBER & "allowedimages"),",",", ") & ".
" End If End If If strErrorText = "" then For Each numCounter In aryNewsIDs N_Headline = Uploader.Form("b" & numCounter) N_Content = Uploader.Form("t" & numCounter) strQuery="UPDATE tblCactuShopNews SET N_Content='" & sqlsafe(N_Content) & "', N_Headline='" & sqlsafe(N_Headline) & "' WHERE N_ID=" & numCounter Call ExecuteSQL(strQuery, numCursorType, objRecordSet) Next 'Upload File Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject") If N_DeleteImage = "y" Or Uploader.Files.Exists("N_Image") Then DeleteFile Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_products/news" & numLangID), Split(Application(LICENSENUMBER & "allowedimages"), ","), objFileSystem If Uploader.Files.Exists("N_Image") Then Uploader.Files("N_Image").FileName = "news" & numLangID & "." & strFileType Uploader.Files("N_Image").SaveToDisk Server.MapPath(Application(LICENSENUMBER & "uploadsfolder") & "images_products/") End If Set objFileSystem = Nothing End If %> <% =GetString("Config_headtitle") %>
<% if strErrorText = "" then %> <% else %> <% end if %>
<% WriteString("PageTitle_Updated") %>
<% WriteString("ContentText_NewsItemsUpdatePagetext") %>
<% WriteString("PageTitle_Problems") %>
<% WriteString("ContentText_PleaseGoBackAndCorrect") %>
<% =strErrorText %>
<< <% WriteString("ContentText_BackLink") %>
<% objDataConn.Close set objDataConn = nothing %>