<% Dim seed ne = objConn.Execute("SELECT noexp FROM " & tablPfx & "Config;")(0) If Not Sess_Array(48) = Session.SessionID And Not Request.Cookies("admin_loggedin" & strSUnique) = ne then UpdateSessions False: Response.Redirect "default.asp" nen = Session.SessionID If Request.Cookies("admin_loggedin" & strSUnique) = ne then Sess_Array(48) = nen Response.Cookies("admin_loggedin" & strSUnique) = nen Response.Cookies("admin_loggedin" & strSUnique).Path = "/" objConn.Execute("UPDATE " & tablPfx & "Config SET noexp = '" & nen & "' ;") End If lp = tpass(ne, secure_content) If not Request.Cookies("template_loggedin" & strSUnique) = lp then If Len(Request.Form("hp")) > 0 then If Request.Form("hp") = lp then Response.Cookies("template_loggedin" & strSUnique) = lp Response.Cookies("template_loggedin" & strSUnique).Path = "/" Else: denied = True End If If denied then showInfo showDenied Response.End Else UpdateSessions False Response.Redirect "admin_template.asp" End If Else showInfo %>

Security code:  
<% If Request("n") = "n" then Response.Write "
Access denied! Try again...
" showDefaultLogon UpdateSessions False Response.End End If Else Response.Cookies("template_loggedin" & strSUnique) = tpass(nen, secure_content) Response.Cookies("template_loggedin" & strSUnique).Path = "/" End If Set objMD5 = Nothing On error Goto 0 Set objFile = Server.CreateObject("Scripting.FileSystemObject") set rscfg = objConn.Execute("SELECT web_site,dstyle,isWysiwyg FROM " & tablPfx & "Config;") If not rscfg.eof then web_site = rscfg(0) dstyle = rscfg(1) Wysiwyg_type = CLng(rscfg(2)) End If rscfg.close On Error Resume Next baseURL = Split(web_site, "/")(0) & "/" & Split(web_site, "/")(1) & "/" & Split(web_site, "/")(2) virtpath = Replace(web_site, baseURL, "") If err.number <> 0 then Response.Write "
Your Site URL in Admin Preferences is Incorrect!
" On Error Goto 0 css = replace(dstyle, ".css", "") %> Content Management <% If objFile.FolderExists(Server.Mappath("scripts")) then Wysiwyg_type = 1 %> <% End If Dim title, subject, body, ID, isWY, showWY, tid, itype If Request.Querystring.Count = 1 then showTempl = Request.Querystring.Item(1) End If Select Case Request.Form("Flag") Case 1 Select Case Request.Form("SF") Case "Backup" title = Request("id") On Error Resume Next page_name = title & ".asp" content_folder = server.mappath("content") page_path = content_folder & "\" & page_name objFile.CopyFile page_path, content_folder & "\back_" & page_name, true On error Goto 0 Case "Restore" title = Request("id") On Error Resume Next page_name = title & ".asp" content_folder = server.mappath("content") page_path = content_folder & "\" & page_name If objFile.FileExists(content_folder & "\back_" & page_name) then objFile.CopyFile content_folder & "\back_" & page_name, page_path, true On error Goto 0 Case "Save Template" ID = CLng(Request.Form("ID")) title = sq(Request.Form("title")) name = Request.Form("name") subject = sq(Request.Form("S1")) body = Request.Form("T1") itype = CLng(Request.Form("itype")) If subject = Empty Or body = Empty then Response.Write "
Cannot Save! Subject or Body is Empty." Else If itype = 3 Or itype = 4 Or itype = 5 Or itype = 6 then page_name = name & ".asp" content_folder = server.mappath("content") page_path = content_folder & "\" & page_name If itype = 3 then body = "" & vbcrlf & body & vbcrlf & "" End If If itype = 5 then body = chr(60) & chr(37) & " On Error Resume Next " & chr(37) & chr(62) & "" & vbcrlf & body & vbcrlf & "" & chr(60) & chr(37) & " If err.number <> 0 then Response.Write err.description " & chr(37) & chr(62) End If writeFile page_path, body Else strSQL = "UPDATE " & tablPfx & "Template SET " strSQL = strSQL & "title = '" & title & "', " strSQL = strSQL & "subject = '" & subject & "', " strSQL = strSQL & "body = '" & sq(body) & "' WHERE ID=" & ID & ";" objConn.Execute(strSQL) End If UpdateSessions True Response.Redirect "admin_template.asp?id=" & Server.URLEncode(name) End If Case "Delete" If Request.Form("itype") = 4 Or Request.Form("itype") = 5 then UpdateSessions True Response.Redirect "admin_template.asp" End If ID = CLng(Request.Form("ID")) objConn.Execute("DELETE FROM " & tablPfx & "Template WHERE ID=" & ID & ";") If Request.Form("itype") = 3 Or Request.Form("itype") = 6 then page_name = Request.Form("name") & ".asp" content_folder = server.mappath("content") page_path = content_folder & "\" & page_name On Error Resume Next objFile.DeleteFile(page_path) objFile.DeleteFile(content_folder & "\back_" & page_name) On Error Goto 0 End If UpdateSessions True Response.Redirect "admin_template.asp" End Select Case 2 ttype = CLng(Request.Form("NT5")) iname = sq(Request.Form("NT1")) title = sq(Request.Form("NT2")) subject = sq(Request.Form("NT3")) body = Request.Form("NT4") If ttype = 3 Or ttype = 6 then Set re = New RegExp re.Global = True re.IgnoreCase = True re.Pattern = "\W" If re.Test(iname) Then iname = re.Replace(iname, "") Set re = Nothing page_name = iname & ".asp" content_folder = server.mappath("content") page_path = content_folder & "\" & page_name If ttype = 3 then body = "" & vbcrlf & body & vbcrlf & "" If Not objFile.FileExists(page_path) then back_body = body writeFile page_path, body writeFile content_folder & "\back_" & page_name, back_body End If End If strTempl = "SELECT " & tablPfx & "Template.tname FROM " & tablPfx & "Template WHERE tname='" & iname & "';" Set rs = objConn.Execute(strTempl) If rs.EOF then rs.close If ttype = 3 Or ttype = 6 then objConn.Execute("INSERT INTO " & tablPfx & "Template(tname, title, subject, type) VALUES('" & iname & "','" & title & "','" & subject & "'," & ttype & ");") Else objConn.Execute("INSERT INTO " & tablPfx & "Template(tname, title, subject, body, type) VALUES('" & iname & "','" & title & "','" & subject & "','" & sq(body) & "'," & ttype & ");") End If UpdateSessions True Response.Redirect "admin_template.asp?id=" & Server.URLEncode(iname) Else rs.close retmsg = "
Template with this name already exists in database.
" retname = iname rettitle = title rettype = ttype retsubject = subject retbody = body showTempl = "" retstyle = "style=""color: red;""" End If Case 3 target_Menu = Request("id") target_link = Request.Form("targetpage") If target_Menu = "menu_top" then link_value = "<a class="hlinks" href="cindex.asp?id=" & target_link & "">Link Text</a>" ElseIf target_Menu = "menu_top_xl" then link_value = "<a class="xl-menu-links" href="cindex.asp?id=" & target_link & "">Link Text</a>" ElseIf target_Menu = "menu_bottom" then link_value = "<a class="footer" href="cindex.asp?id=" & target_link & "">Link Text</a>" End If %>

Possible Target Link:

Copy/Paste URL Link Code into appropriate spot in a template.
<% dragScript End Select Set rs = objConn.Execute("SELECT * FROM " & tablPfx & "Template ORDER BY type, tname;") Do while not rs.EOF template = rs("tname") tid = CLng(rs("type")) Select Case tid Case 1: style = "style=""color: red;""" Case 2: style = "style=""color: blue;""" Case 0: style = "style=""color: black;""" Case 3: style = "style=""color: green;""" Case 4: style = "style=""color: purple;""" Case 5: style = "style=""color: #B05E02;""" Case 6: style = "style=""color: #2B5E80;""" End Select Select Case showTempl Case "" showTempl = template getTheRest strTemplate = "" & vbcrLf Case else If showTempl = template then getTheRest strTemplate = strTemplate & "" & vbcrLf Else: strTemplate = strTemplate & "" & vbcrLf End If End Select rs.MoveNext Loop rs.close Sub getTheRest() title = rs("title") subject = rs("subject") itype = rs("type") ID = rs("ID") %> ", "",1,1,1) page_content = replace(page_content,"&","&") page_content = replace(page_content,"<","<") page_content = replace(page_content,">",">") Response.Write page_content %> <% isWY = CLng(rs("type")) If Not isWY = 0 AND Not isWY = 4 AND Application("WYSIWYG" & strUnique) = "1" AND isCompatible then showWY = True Else: showWY = False End If End Sub %>
Create New Template 
 
Content Type:    
Template/Content/Page Name:  maxlength="100" type="text" size="29" class="forms" name="NT1" value="<%= retname %>"> <%= retmsg %>
Description: 
Subject: 
Body/Content: 
 
<% objConn.close Set objConn = Nothing Set rs = Nothing Function dragScript() %> <% End Function Function tpass(ps, psd) Set objMD5 = New MD5 objMD5.Text = ps seed = objMD5.HEXMD5 objMD5.Text = psd psdf = objMD5.HEXMD5 objMD5.Text = psdf & seed tpass = objMD5.HEXMD5 Set objMD5 = Nothing End Function Sub showInfo() %>
Content Management page Security Guidelines:
  1. This page can only be opened from one computer and one browser window at a time.
  2. If opened from 2 different sources, this page might not be accessible for secure logon, be blank, or might even get redirected to the default page. If this occur, logout from admin area and log back in.
  3. You should see the logon box with a button at this point. If you do not see it,  try to log out and log back in from admin area.
  4. If you are accessing this page for the first time and do not see the logon box below, then this page was probably modified by your antivirus software while you were downloading the original RC zip package.  Please see message : HERE
<% End Sub Sub showDefaultLogon() If secure_content = "admin" Then %>
Please Note: The Default Security Code is admin
Change it by modifying this page directly in an editor.
Modify secure_content = "admin" variable in config/tn_config.asp.

This message would NOT appear once you changed the security code.
<% End If End Sub Sub showDenied %>
Access Denied! Possible Reasons:

1. Incorrect Password. Try again...

2. Multiple logons from different computers or browser windows. Logout from admin and log back in.

<% End Sub %>