<% nav2 = "on" %> <% set adoCn = server.createobject("adodb.connection") adoCn.Open "DBQ=" & Server.Mappath("/de49sye3/mm_j483hteys55.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};" '************** Database Connect **************** 'Can leave alone------------------------------------------------------------------------------ contentpath = "http://" & Request.ServerVariables("HTTP_HOST") & "/" 'Set for content path PrePath = "/" 'Set to subdir, blank for relative, / for absolute Session.Timeout=45 %> <% dim vararea, previewmode2,sDocID,sPageParent,sPage2,sDateCreated, sTitle 'sPageParent = sPage 'Page Address '=================ShowAdminBar=========================== Sub ShowAdminBar2() If (previewmode2 = "yes") Then strColor = "#ff0000" Else strColor = "#009933" End If %>
Edit <% If previewmode2 = "yes" Then %> | Publish | Revert <% Else %>  LIVE  - <% End if %> <% if session ("admin") = 1 then %> | Users <% end if %> <% if vararea = 1 then %> | Admin | >LogOut <% end if %>
<% sDocID = Request.QueryString("DocumentID") sDateCreated = now If Request.QueryString("action") = "publish" & vararea Then strSQL2 = "Update Documents set Content= Preview, Title = TitlePreview, Summary = SummaryPreview, Preview='', TitlePreview = '', SummaryPreview = '', DateCreated='" & sDateCreated & "' where DocumentID=" & sDocID adoCn.Execute strSQL2 response.redirect sPageParent End If If Request.QueryString("action") = "revert" & vararea Then strSQL3 = "Update Documents set Preview='',TitlePreview='',SummaryPreview='' where DocumentID=" & sDocID adoCn.Execute strSQL3 response.redirect sPageParent End If End Sub Sub EditContent(area) vararea = area sAdminLink = replace(Request.ServerVariables("Script_NAME"),"/","") sPageParent = Request.ServerVariables("Script_NAME") 'sPage = Request.ServerVariables("Script_NAME") sLen = len(Request.ServerVariables("Script_NAME"))-4 if area = 1 then 'Primary content area spage2 = sPageParent else spage2 = left(Request.ServerVariables("Script_NAME"),sLen) & "~" & area & ".asp" end if strNew = "Coming Soon..." strSQL = "Select * From Documents where ISNULL(SubID) and page = '" & spage2 & "'" set adoRsTwo = adoCn.Execute(strSQL) If adorsTwo.eof Then strSQL = "Insert Into Documents (Page,Content) values ('" & replace(spage2,"'","''") & "','" & replace(strNew,"'","''") & "')" adoCn.Execute strSQL Else Do While Not adoRsTwo.EOF sDocID = adoRsTwo("DocumentID") sDateCreated = adoRsTwo("DateCreated") sContent2 = adoRsTwo("Content") sPreview2 = adoRsTwo("Preview") if len(sPreview2) > 3 then previewmode2 = "yes" end if if previewmode2 = "yes" and session("admin") <> "" then response.write sPreview2 else response.write sContent2 end if adoRsTwo.MoveNext Loop End If 'EDIT LINK======Show only to admin====================== If (session("admin") = 1) Then ShowAdminBar2 Else 'Dim rsPermission, PermissionUser,sUser sUser = session("user") Set rsPermission = server.createobject("ADODB.Recordset") strSQL = "SELECT * FROM Permissions WHERE User = '" & sUser & "' and Page='" & spage2 & "'" set rsPermission = adoCn.Execute(strSQL) If (not rsPermission.eof) Then PermissionUser = rsPermission("User") If (session("user") = PermissionUser) Then ShowAdminBar2 End If End If End If adoRsTwo.Close set adoRsTwo = nothing 'adoCn.Close 'set adoCn = nothing 'sDocID = "" 'sDateCreated = "" 'sContent2 = "" 'sPreview2 = "" previewmode2 = "" sPreview = "" sTitlePreview = "" end sub 'Get Titles, Meta========================================== if request.querystring("action") = "" then 'CHECK IF PUBLISHING sTitlepage = Request.ServerVariables("SCRIPT_NAME") if instr(lcase(Request.ServerVariables("QUERY_STRING")),"docid") > 0 then sTitleSubID = replace(lcase(Request.ServerVariables("QUERY_STRING")),"docid=","") end if if sTitleSubID <> "" then strSQL = "Select Title,Summary,MetaKeywords From Documents where page = '" & stitlepage & "' and DocumentID = " & sTitleSubID else strSQL = "Select Title,Summary,MetaKeywords From Documents where page = '" & stitlepage & "'" end if set adoRs5 = adoCn.Execute(strSQL) if NOT adoRs5.eof then sTitle = adoRs5("Title") sSummary = adoRs5("Summary") sMetaKeywords = adoRs5("MetaKeywords") end if adoRs5.Close set adoRs5 = nothing end if 'Get Metatags from index page if not entered on local page if (sTitle = "" or ISNULL(sTitle)) or (sSummary = "" or ISNULL(sSummary)) or (sMetaKeywords = "" or ISNULL(sMetaKeywords)) then strSQL = "Select Title,Summary,MetaKeywords From Documents where page = '/index.asp'" set adoRs = adoCn.Execute(strSQL) if adoRS.EOF then strSQL2 = "Insert Into Documents (Page,Content) values ('/index.asp','Coming soon')" adoCn.Execute strSQL2 else if sTitle = "" then sTitle = adoRs("Title") end if if sSummary = "" then sSummary = adoRs("Summary") end if if sMetaKeywords = "" then sMetaKeywords = adoRs("MetaKeywords") end if end if end if if sTitle <> "" then sMetaTitle = replace(sTitle,"
"," ") sMetaTitle = replace(sTitle,"
"," ") sMetaTitle = replace(sTitle,"
"," ") end if if sSummary <> "" then sMetaDescription = replace(sSummary,"
","") sMetaDescription = replace(sSummary,"
","") sMetaDescription = replace(sSummary,"
","") end if if sMetaKeywords <> "" then sMetaKeywords = replace(sMetaKeywords,"
","") sMetaKeywords = replace(sMetaKeywords,"
","") end if if len(sPreview) > 3 then previewmode = "yes" end if if sMetaDescription = "" then sMetaDescription = defaultMetaDescription end if if sMetaKeywords = "" then sMetaKeywords = defaultMetaKeywords end if if TitleOverride <> "" and qStrDocID= "" then sMetaTitle = TitleOverRide end if %> <%= sMetaTitle %> <% if session ("admin") <> "" then 'Show POPUP code and css %> <% end if %>
For directions and other information please call us at   (952) 929-3423

<% EditContent(1) %>








<% adoCn.Close set adoCn = nothing %>