<% ' ************************************************** ' © VWA Software Development 2011 ' Release: 1.01.0003 ' Changed: Jul 15, 2011 ' Author : Berco Wassink ' ************************************************** %><% const cMailingCSSExclude = "/* Vanaf hier niet meesturen met nieuwsbrief */" const cKey = "coredata" ' Database openen if VWA_SQLConnect(cKey, true) then ' CSS ophalen call GetCSS() end if ' Database sluiten call VWA_SQLDisconnect(cKey) ' Stoppen met uitvoering response.end '******************************************************************************** ' Geselecteerde CSS ophalen private function GetCSS() dim rst dim sSQL, sTable, sField dim iSiteID, iStyleID, iModuleID dim bRst sTable = GetRequestValue("Table", "") sField = GetRequestValue("FieldID", "") iSiteID = VWA_CNumber(GetRequestValue("SiteID", -99)) iStyleID = VWA_CNumber(GetRequestValue("StyleID", -99)) iModuleID = VWA_CNumber(GetRequestValue("ModuleID", -99)) ' Recordset met CSS openen sSQL = "SELECT TOP 1 A." & sField & " AS ID, A.SizeUse, A.CSSContent" if (iSiteID < 0) then if (sTable = "tblcssstyle") then sSQL = sSQL & " FROM tbltemplatecssstyle AS A" else sSQL = sSQL & " FROM " & replace(sTable, "site", "template") & " AS A" end if sSQL = sSQL & " WHERE A.TemplateID=" & abs(iSiteID) else sSQL = sSQL & " FROM " & sTable & " AS A" sSQL = sSQL & " WHERE A.SiteID=" & iSiteID end if sSQL = sSQL & " ORDER BY " & VWA_SQLFuncIIf(cKey, "A." & sField & "=" & iStyleID, "0", "1") sSQL = sSQL & ", " & VWA_SQLFuncIIf(cKey, "A." & VWA_SQLFuncObjectName(cKey, "Default") & "<>0", "0", "1") if VWA_SQLOpenRecordset(cKey, sSQL, rst, true) then iStyleID = rst("ID") if (rst("SizeUse") = 0) and (not isnull(rst("CSSContent"))) then bRst = true else rst.close end if end if if not bRst then sSQL = "SELECT A.CSSContent" sSQL = sSQL & " FROM " & sTable & "size AS A" sSQL = sSQL & " WHERE A.SiteID=" & iSiteID sSQL = sSQL & " AND A." & sField & "=" & iStyleID sSQL = sSQL & " AND A.SizeID=" & VWA_CNumber(GetRequestValue("SizeID", -99)) bRst = VWA_SQLOpenRecordset(cKey, sSQL, rst, true) end if if (not bRst) and (iModuleID > 0) then sSQL = "SELECT A.CSSContent FROM tblmodule AS A" sSQL = sSQL & " WHERE A.ModuleID=" & iModuleID sSQL = sSQL & " AND A.CSSContent IS NOT NULL" bRst = VWA_SQLOpenRecordset(cKey, sSQL, rst, true) end if if bRst then ' Bestand verzending voorbereiden response.clear response.charset = "iso-8859-1" response.contenttype = "text/css" ' Controleren op speciale acties select case VWA_CNumber(GetRequestValue("ModuleID", -99)) case 10 ' Nieuwsbrief response.write trim(mid(rst("CSSContent"), instr(1, rst("CSSContent"), cMailingCSSExclude, vbTextCompare) - 1)) case else response.write rst("CSSContent") end select response.write vbCrLf ' Bestand verzenden response.flush rst.close end if set rst = nothing GetCSS = true end function %>