<% nav4 = "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

<% if request.querystring("Docid") = "" then %>
<% EditContent(1) %>
<% else %>
<% end if %> <% 'Set News tool Variables and buttons------------------------------------------- dim Story_Divider,DetailLinkText,BackButton Story_Divider = "" DetailLinkText = "More" if nobackbutton <> 1 then BackButton = "[Back to All]" end if ArchiveBack = "View All" 'Set SORT by using this line before this file include... externalSQL = "Title asc" 'reverse_sort set on include page - reverse_sort = 1 '---FIND THISPAGE---------------------------------------------------------- sDirPath = left(Request.ServerVariables("Script_NAME"),InStr(2,Request.ServerVariables("Script_NAME"),"/")) if sDirPath = "" then thispage = sDirPath & Request.ServerVariables("Script_NAME") else thispage = Request.ServerVariables("Script_NAME") end if sPage = thispage '------------------------------------------------------------- sDocID = Request.QueryString("DocID") if (NOT IsNumeric(sDocID)) then sDocID = 0 Sub listpage() if (previewmodeNews = "yes" and Permission = "edit") or sTitle <> "" then ShowLink = "yes" end if if instr(sLink,"http://") <> 0 or instr(sLink,".pdf") <> 0 or instr(sLink,".doc") <> 0 then 'If full path make new window sTarget = "_blank" end if if Request.QueryString("Archive") = "" then if sShow = "2" then 'Show Other Articles--------------------------------- 'Make link to View Story OR View links to URL entered %>
<% if len(sContent) < 10 and sLink = "" then %>
<% else %> <% End If %>
<% if sLink <> "" then %> <% if ShowLink = "yes" then %> <%= sTitle %> <% end if %> <% else %> <% if ShowLink = "yes" then %> <%= sTitle %> <% end if %> <% end if %>
<%= sSummary %>

<% listmenu %> <% elseif sShow = "1" and sTitle <> "" then 'Show Full Top Articles--------------------- %>
<%= sTitle %>
<%= sContent %>
<% 'if (previewmodeNews = "yes" and Permission = "edit") or sTitle <> "" then 'Story_Divider 'end if %> <% if sLink <> "" then 'Show link if link was entered in editor%> [<%= DetailLinkText %>] <% end if listmenu end if else if sShow = "3" then 'Put on Archive page Archive Articles------------------------------- %> <% if sLink <> "" then %> <% if ShowLink = "yes" then %> <%= sTitle %>
<% end if %> <% else %> <% if ShowLink = "yes" then %> <%= sTitle %>
<% end if %> <% end if %> <%= sSummary %>    <% if sLink <> "" then %> <% if ShowLink = "yes" then %> [<%= DetailLinkText %>]

<% end if %> <% else %> <% if ShowLink = "yes" then %> [<%= DetailLinkText %>]

<% end if %> <% end if %> <% listmenu end if end if end sub Sub listmenu() 'Show MENU only to admin if Permission = "edit" then %>
editbarRed <% else %> editbarGray <% end if %> ">    [Edit]    [Del]          <% If previewmodeNews = "yes" Then %> | Publish | Revert   <% Else %>  LIVE  - <% End if %> <% if ((maxorder1 <> int(sSortOrder) AND sShow= 1) OR (maxorder2 <> int(sSortOrder) AND sShow= 2) OR (maxorder3 <> int(sSortOrder) AND sShow= 3)) AND externalSQL = "" then 'turn off up link %> Up <% else %>       <% end if %> <% if sSortOrder > 1 AND externalSQL = "" then 'turn off DW link %> Down <% end if %>

<% 'PUBLISH OR REVERT======================================================================================================== if Request.QueryString("IsArchive") = "yes" then qArchive = "?Archive=view" end if If Request.QueryString("action") = "publishnews" AND Request.QueryString("action") <> "publish" Then strSQL = "Update Documents set Content= Preview, Title = TitlePreview, Summary=SummaryPreview, Preview='',TitlePreview='',SummaryPreview='', DateCreated='" & sDateCreated & "' where DocumentID=" & Request.QueryString("pDocID") adoCn.Execute strSQL response.redirect sPage & qArchive End If If Request.QueryString("action") = "revertnews" Then strSQL = "Update Documents set Preview='',TitlePreview='',SummaryPreview='' where DocumentID=" & Request.QueryString("pDocID") adoCn.Execute strSQL response.redirect sPage & qArchive End If '========================================================================================================================= end if %> <% end sub 'DELETE OR SORT NEWS STORIES================================================================= if Request.QueryString("action")="del" then strSQL = "DELETE FROM Documents where DocumentID=" & Request.QueryString("DocumentID") adoCn.Execute strSQL end if if reverse_sort then sortup = "dn" sortdown = "up" else sortup = "up" sortdown = "dn" end if sOrder = request.QueryString("order") if Request.QueryString("sort")= sortup then strSQL = "Update Documents set sortorder=" & sOrder & " where page = '" & spage & "' and Show = '" & request.QueryString("sortshow") & "' and sortorder=" & sOrder + 1 adoCn.Execute strSQL strSQL = "Update Documents set sortorder=" & sOrder + 1 & " where DocumentID=" & request.QueryString("DocumentID") adoCn.Execute strSQL end if if Request.QueryString("sort")= sortdown then strSQL = "Update Documents set sortorder=" & sOrder & " where page = '" & spage & "' and Show = '" & request.QueryString("sortshow") & "' and sortorder=" & sOrder - 1 adoCn.Execute strSQL strSQL = "Update Documents set sortorder=" & sOrder - 1 & " where DocumentID=" & request.QueryString("DocumentID") adoCn.Execute strSQL end if '====Main ============================================================ sPage = thispage 'Find Editor Permissions ====================================================================== If (session("admin") = 1) Then Permission = "edit" Else sUser = session("user") Set rsPermission = server.createobject("ADODB.Recordset") strSQL = "SELECT * FROM Permissions WHERE User = '" & sUser & "' and Page='" & sPage & "'" set rsPermission = adoCn.Execute(strSQL) If (not rsPermission.eof) Then PermissionUser = rsPermission("User") If (session("user") = PermissionUser) Then Permission = "edit" End If End If End If 'Show only to admin ========================================================================= if Permission = "edit" and sDocID = "" then %>
<% end if '============================================================================================ strNew = "

*** Content Needed ***

" if externalSQL = "" then sortSQL = "show,sortorder desc" else sortSQL = externalSQL end if if Permission = "edit" then 'Only find max if in admin mode set adoRs = adoCn.Execute("Select MAX(sortorder) From Documents where page = '" & spage & "' and Show = '1'") maxorder1 = adoRs(0) set adoRs = adoCn.Execute("Select MAX(sortorder) From Documents where page = '" & spage & "' and Show = '2'") maxorder2 = adoRs(0) set adoRs = adoCn.Execute("Select MAX(sortorder) From Documents where page = '" & spage & "' and Show = '3'") maxorder3 = adoRs(0) end if strSQL = "Select * From Documents where page = '" & sPage & "' order by " & sortSQL set adoRs = adoCn.Execute(strSQL) if adoRs.EOF then NoRecords = "yes" %> Sorry, No articles are available <% end if Do While Not adoRs.EOF sTitle = adoRs("Title") sTitlePreview = adoRs("TitlePreview") sSummary = adoRs("Summary") sSummaryPreview = adoRs("SummaryPreview") sDocumentID = adoRs("DocumentID") sDateCreated = adoRs("DateCreated") sContent = adoRs("Content") sPreview = adoRs("Preview") sShow = trim(adoRs("Show")) sSortOrder = trim(adoRs("sortorder")) sLink = adoRs("Link") if sShow = "3" then 'Are any files in archive? IsArchive = "yes" end if if sShow = "1" and sTitle <> "" then 'Are any Full text stories? IsFull = "yes" end if if (sPreview <> "" OR sTitlePreview <> "") and Permission = "edit" then previewmodeNews = "yes" sTitle = sTitlePreview sSummary = sSummaryPreview sContent = sPreview else previewmodeNews = "no" end if 'Show a single selected story if sDocID <> "" then 'Back to All button---------------------------------------- if trim(sDocID) = trim(sDocumentID) then %> <% if sShow = 3 then %>
Archived Article
<% end if %>
<% if sShow = 3 then %>

<% end if %>
<%= sTitle %>

<%= sContent %>
<%= Story_Divider %> <% end if else 'Show all stories 'Draw line after full text articles if sShow = "2" and Request.QueryString("Archive") <> "view" then if drawline <> 1 then if ((previewmodeNews = "yes" and Permission = "edit") or sTitle <> "") AND IsFull = "yes" then %>
More...
<%= Story_Divider %> <% drawline = 1 end if end if end if 'Draw line Archive articles if sShow = "3" and Request.QueryString("Archive") = "view" then if arcline <> 1 then %>


<%= Story_Divider %> <% arcline = 1 end if end if listpage end if adoRs.MoveNext Loop adoRs.Close set adoRs = nothing 'adoCn.Close 'set adoCn = nothing %> <% if Request.QueryString("Archive") <> "view" and IsArchive = "yes" then %> <% if session("admin") <> "" or sPage <> "/About-Employment-Opportunities.asp" then %> <% 'else %>
<% end if %> <% end if %>

<% if request.querystring("DocID") = "" then %>
<% EditContent(2) %>

<% End If %>





<% adoCn.Close set adoCn = nothing %>