<%@ CodePage=65001 Language="VBScript"%> <% option explicit %> <% GetConfigVariables dim sResult, iCategoryID, sCategoryName, sCategoryURL, bLocked, ischemeDefault, SQL, ischemeid ' The returned scheme is chosen as follows: ' ' 1) If the user has a username and password cookie, return the default scheme associated with the username ' 2) If the user is a guest, return the scheme associated with the cookie ' 3) If a catlock cookie or parameter is found, and the script is going to return a 'default scheme', ' then return the default scheme for that category, rather than the BBS's default scheme. ' The passed URL parameter, schemeid, is usually ignored. If you also pass the url parameter ' override=true, then schemeid will be returned no matter what. response.contenttype = "text/css" ischemeid = request.querystring("schemeid") if ischemeid = 0 then ' Retrieve the default scheme response.write ReadDefaultScheme else set dbConnection = server.createobject("ADODB.Connection") set rsMaster = server.createobject("ADODB.Recordset") dbConnection.CursorLocation = adUseClient dbConnection.ConnectionString = sConnString dbConnection.ConnectionTimeout = 5 dbConnection.Open rsMaster.open "select [body] from [colorschemes] where [schemeid]=" & ischemeid & ";", dbConnection, adOpenForwardOnly, adLockReadOnly if rsMaster.EOF and sLogonType="ok" then rsMaster.Close rsMaster.open "select [schemeid] from [members] where [username]='"& ValidateSQL(sUsername) & "';", dbConnection, adOpenForwardOnly, adLockOptimistic rsMaster("schemeid") = 0 rsMaster.Update rsMaster.Close response.write ReadDefaultScheme elseif rsMaster.EOF then response.write ReadDefaultScheme rsMaster.Close else response.write replace(rsMaster("body"), "__forumroot__", sValidatedBaseURL, 1, -1, 1) rsMaster.Close end if end if Function ReadDefaultScheme Const ForReading = 1, ForWriting = 2 Dim fso, f, path, schemebody path = server.mappath(sForumRoot & "/schemes/files/") & "/1.css" Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile( path , ForReading) schemebody = f.ReadAll schemebody = replace(schemebody, "__forumroot__", sValidatedBaseURL, 1, -1, 1) ReadDefaultScheme = Schemebody set fso = nothing set f = nothing End Function %>