ThemeSave + ThemeRead

Saves/Reads selected theme into file.
Used with Bootstrap 3 in most of my websites to allow users to select theme
Attached is some theme CSS's to be used along with ASP code to apply the one that was selected

Function ThemeSave(NewTheme)
 If NewTheme>"" Then
  Set FSO = Server.CreateObject("scripting.FileSystemObject")
  Set myFile = fso.CreateTextFile(Server.MapPath(ThemesSettingFile), true)
  myFile.WriteLine(NewTheme)
  myFile.Close
 End If
End Function
Function ThemeRead()
 Rett=""
 Set FSO = Server.CreateObject("scripting.FileSystemObject")
 If not fso.fileexists(Server.MapPath(ThemesSettingFile)) Then
  Rett="Default"
  Theme_Change Rett
 Else
  set f = fso.OpenTextFile(Server.MapPath(ThemesSettingFile),1,true)
  Rett= f.ReadLine
  f.Close
 End If
 If instr(Rett,"%")>0 Then Rett=Left(Rett,instr(Rett,"%")-1)
 ThemeRead=Rett
End Function

Parameters

NewTheme

Views 107 Downloads 50

Perm link