<% 'REMOVING THIS MESSAGE IS A VIOLATION OF TERMS '---------------------------------------------- ' Open Site Editor: An OpenSource site editing ' system (http://fuzzelfish.com/siteeditor/) ' Designed by Fuzzel Fish (http://fuzzelfish.com/) '---------------------------------------------- 'END OF MESSAGE %> <% '---------------------------------------------- ' CONFIGURATION SECTION '---------------------------------------------- 'What is the topmost edit directory? 'THIS MUST BE A RELATIVE PATH FROM SERVER ROOT '(IT MUST START WITH A /). const sTopDir = "/" '(Files outside this directory will be uneditable.) '(Files in this directory and its subdirectories ' will be editable.) 'What is the site's name? 'IF YOU ARE A DESIGN FIRM, PUT YOUR FIRM'S NAME, 'NOT YOUR CLIENT'S const sSiteName = "Alepos Internet GbR" 'What is the relative path to editor folder? const sEditorURL = "editor/" '(Relative path from engine.asp.) 'What is the editing password? const sPassword = "alepos" 'This password will be required to edit anything. '---------------------------------------------- ' END OF CONFIGURATION '---------------------------------------------- ' If you edit anything below this point, ' things are going to get messy ;) %> <% '---------------------------------------------- ' CHANGE LOG (LAST UPDATED: 11/04/2004) v0.2 '---------------------------------------------- '#MM/D/YYYY: Name Change Description ' '#11/4/2004: rdude Fixed bug that made empty ' editable areas uneditable ' ' Added password protection ' ' Added Google text ads ' '#08/2/2003: rdude First version available %> <%=sSiteName%> CMS-Modul
<%=sSiteName%> CMS-Modul

Passwort:



<% dim sPage,lEditables,sPageName,sStyleSheet function LoadPage(Byref FileName) set fso = Server.CreateObject("Scripting.FileSystemObject") set f = fso.OpenTextFile(FileName) LoadPage = f.ReadAll f.Close set f = Nothing set fso = Nothing end function function PlaceEditableRegions(Byref Content) set reg = New RegExp reg.Global = True reg.IgnoreCase = True reg.Pattern = "[\S\s]*?" set matches = reg.Execute(Content) for i = 0 to matches.Count - 1 PlaceEditableRegions = i + 1 Content = Replace(Content, "", "", 1, 1, vbTextCompare) if lenB(Request("editRegion" & i + 1)) > 0 then reg.Pattern = "" Content = reg.Replace(Content, "") end if next end function function ReplaceSSIs(Content) set reg = New RegExp reg.Global = True reg.IgnoreCase = True reg.Pattern = "" set matches = reg.Execute(Content) for i = 0 to matches.Count - 1 Content = Replace(Content, matches(0), "<" & Mid(matches(0), 2, len(matches(0)) - 2) & ">") next ReplaceSSIs = Content end function function ScanForCSS(Content) dim sBuffer set reg = New RegExp reg.IgnoreCase = True reg.Pattern = "" set matches = reg.Execute(Content) if matches.Count >= 1 then sBuffer = matches(0) ScanForCSS = Replace(Replace(sBuffer, "", vbNullString, 1, 1, vbTextCompare) end function function SetHTMLAreas(NumofAreas,StyleSheet) dim sBuffer sBuffer = "" & vbCrLf dim sGenerateStatements if NumOfAreas >= 1 then for i = 1 to NumOfAreas sGenerateStatements = sGenerateStatements & "editor_generate('editRegion" & i & "',config);" & vbCrLf next end if sBuffer = Replace(sBuffer, "%GENERATE_STATEMENTS%", sGenerateStatements, 1, 1) SetHTMLAreas = sBuffer end function function PlaceForm(Content,NumOfAreas) dim sBuffer sBuffer = sBuffer & "" & vbCrLf sBuffer = sBuffer & Content PlaceForm = sBuffer end function function SavePage(Content,FileName) set fso = Server.CreateObject("Scripting.FileSystemObject") set f = fso.CreateTextFile(FileName, true) f.Write Content f.Close set f = Nothing set fso = Nothing end function function CheckSecurity() if left(sTopDir, 1) <> "/" then Err.Raise 30126, sSiteName & " Site Editor", "The security configuration is invalid (sTopDir must start with ""/"")." Response.End end if if left(GetPageName(), len(sTopDir)) <> sTopDir then Err.Raise 30626, sSiteName & " Site Editor", "You cannot edit this file." Response.End end if end function function GetPageName() GetPageName = request("page") end function function ProcessSave(FileName) if Request("txtPassword") <> sPassword then Response.Write "
Sorry, you must enter the correct editing password above to save your changes.
Your changes have not been saved, but your edits have been preserved in the edit boxes below.


" exit function end if NumOfAreas = request("NumOfAreas") sOriginalContent = LoadPage(FileName) set reg = New RegExp reg.Global = True reg.Pattern = "[\S\s]*?" set matches = reg.Execute(sOriginalContent) sBuffer = sOriginalContent for i = 0 to matches.Count - 1 sBuffer = Replace(sBuffer, matches(i), "" & request("editRegion" & (i + 1)) & "", 1, 1) next SavePage sBuffer, FileName Response.Redirect GetPageName() end function CheckSecurity() sPageName = Server.MapPath(GetPageName()) if lenB(request("save")) > 0 then ProcessSave(sPageName) sPage = LoadPage(sPageName) sPage = ReplaceSSIs(sPage) lEditables = PlaceEditableRegions(sPage) sStyleSheet = ScanForCSS(sPage) sPage = PlaceForm(sPage,lEditables) sPage = sPage & SetHTMLAreas(lEditables,sStyleSheet) vorher = " 

<%=sSiteName%> CMS-Modul