<%@ Language=VBScript %> <% Response.Buffer = TRUE %> <% ' Script Name : aspWebHeadlines ' File Name : news.asp ' Version : 1.1 ' Release Date : 6/02/2002 ' ' Copyright (c) 2002 by Full Revolution, Inc., All Rights Reserved %> <% '******** Set the Local ********************************************************** Session.LCID = 1033 'English (US) TimeZone = "EST" ArticleImagePath = "news/articleimages/" FileDirectory = Server.MapPath("news/") & "\articleimages\" '******** Open the database ***************************************************** UseSQLServer = "NO" 'Set to YES if you are using SQL Server instead of MS Access Dim dbc Dim strConn If UseSQLServer = "YES" then '---- SQL Connection String ----------------------------------------------------------- strConn = "Provider=SQLOLEDB; Data Source=(local); Initial Catalog=news; User ID=admin; Password=password;" Set dbc = Server.CreateObject("ADODB.Connection") dbc.open strConn Else '------- Access Connection String ----------------------------------------------------- strConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("news/news.mdb") Set dbc = Server.CreateObject("ADODB.Connection") dbc.open strConn End If '******* Pull in the Config from DB ********************************************** If Session("ConfigPulledIn") <> "YES" then SQL = "SELECT * FROM Config" Set RS=dbc.execute(SQL) Session("DefaultLayoutType") = RS("DefaultLayoutType") Session("DefaultArticleType") = RS("DefaultArticleLayout") Session("DefaultFontFace") = RS("DefaultFontFace") Session("DefaultFontTitleSize") = RS("DefaultFontTitleSize") Session("DefaultFontBodySize") = RS("DefaultFontBodySize") Session("DefaultFontColor") = RS("DefaultFontColor") Session("EmailComponent") = RS("EmailComponent") Session("RecordsPerPage") = RS("AdminRecordsPerPage") Session("AdminColor") = RS("AdminColor") Session("BackColorOne") = RS("AdminBackColorOne") Session("BackColorTwo") = RS("AdminBackColorTwo") Session("EmailSiteName") = RS("EmailSiteName") Session("EmailSiteURL") = RS("EmailSiteURL") Session("EmailHost") = RS("EmailHost") Session("BBShowSearch") = RS("BBShowSearch") Session("BBShowArchives") = RS("BBShowArchives") Session("BBShowSubmit") = RS("BBShowSubmit") Session("BBShowEmailAdmin") = RS("BBShowEmailAdmin") Session("BBShowLogin") = RS("BBShowLogin") Session("BBShowHome") = RS("BBShowHome") Session("BBShowSyndication") = RS("BBShowSyndication") Session("AdminEmail") = RS("AdminEmail") Session("SyndicationText") = RS("SyndicationText") Session("ConfigPulledIn") = "YES" AdminFolderColor = "news/adminimages/" & Session("AdminColor") & "/" RS.Close Set RS=Nothing End If If Session("ConfigPulledIn") = "YES" then DefaultLayoutType = Session("DefaultLayoutType") DefaultArticleType = Session("DefaultArticleLayout") DefaultFontFace = Session("DefaultFontFace") DefaultFontTitleSize = Session("DefaultFontTitleSize") DefaultFontBodySize = Session("DefaultFontBodySize") DefaultFontColor = Session("DefaultFontColor") EmailComponent = Session("EmailComponent") RecordsPerPage = Session("RecordsPerPage") AdminColor = Session("AdminColor") BackColorOne = Session("AdminBackColorOne") BackColorTwo = Session("AdminBackColorTwo") EmailSiteName = Session("EmailSiteName") EmailSiteURL = Session("EmailSiteURL") EmailHost = Session("EmailHost") BBShowSearch = Session("BBShowSearch") BBShowArchives = Session("BBShowArchives") BBShowSubmit = Session("BBShowSubmit") BBShowEmailAdmin = Session("BBShowEmailAdmin") BBShowLogin = Session("BBShowLogin") BBShowHome = Session("BBShowHome") BBShowSyndication = Session("BBShowSyndication") SyndicationText = Session("SyndicationText") AdminEmail = Session("AdminEmail") AdminFolderColor = "news/adminimages/" & AdminColor & "/" End If If request.querystring("action") <> "syndicate" then %> <% End If '******** Check the Browser Type ************************************************* Dim Browser Browser = Request.ServerVariables("HTTP_USER_AGENT") If InStr(Browser, "MSIE") Then BrowserType = "Microsoft" Else BrowserType = "OTHER" End If '******** Find out what we should be doing ************************************** If request.querystring("action") = "" or request.querystring("action") = "catview" then Call DrawHeader Call NewsHomePage Call DrawFooter End If If request.querystring("action") = "detail" or request.querystring("action") = "print" then Call DrawHeader Call DetailView Call DrawFooter End If If request.querystring("action") = "login" then Call DrawLoginScreen End If If request.querystring("action") = "processlogin" then Call ProcessLogin End If If request.querystring("action") = "mainmenu" then Call DrawMainMenu End If If request.querystring("action") = "logoff" then Call LogOff End If If request.querystring("action") = "manageauthors" then Call ManageAuthors End If If request.querystring("action") = "addauthor" then Call AddAuthor End If If request.querystring("action") = "addauthorprocess" then Call AddAuthorProcess End If If request.querystring("action") = "editauthor" then Call EditAuthor End If If request.querystring("action") = "editauthorprocess" then Call EditAuthorProcess End If If request.querystring("action") = "deleteauthor" then Call DeleteAuthor End If If request.querystring("action") = "deleteauthorprocess" then Call DeleteAuthorProcess End If If request.querystring("action") = "managecategories" then Call ManageCategories End If If request.querystring("action") = "addcategory" then Call AddCategory End If If request.querystring("action") = "addcategoryprocess" then Call AddCategoryProcess End If If request.querystring("action") = "editcategory" then Call EditCategory End If If request.querystring("action") = "editcategoryprocess" then Call EditCategoryProcess End If If request.querystring("action") = "deletecategory" then Call DeleteCategory End If If request.querystring("action") = "deletecategoryprocess" then Call DeleteCategoryProcess End If If request.querystring("action") = "managearticles" then Call ManageArticles End If If request.querystring("action") = "addarticle" then Call AddArticle End If If request.querystring("action") = "addarticleprocess" then Call AddArticleProcess End If If request.querystring("action") = "editarticle" then Call EditArticle End If If request.querystring("action") = "editarticleprocess" then Call EditArticleProcess End If If request.querystring("action") = "deletearticle" then Call DeleteArticle End If If request.querystring("action") = "deletearticleprocess" then Call DeleteArticleProcess End If If request.querystring("action") = "uploadfile" then Call UploadFile End If If request.querystring("action") = "uploadfileprocess" then Call UploadFileProcess End If If request.querystring("action") = "managelayouttypes" then Call ManageLayoutTypes End If If request.querystring("action") = "addlayouttype" then Call AddLayoutType End If If request.querystring("action") = "addlayouttypeprocess" then Call AddLayoutTypeProcess End If If request.querystring("action") = "editlayouttype" then Call EditLayoutType End If If request.querystring("action") = "editlayouttypeprocess" then Call EditLayoutTypeProcess End If If request.querystring("action") = "deletelayouttype" then Call DeleteLayoutType End If If request.querystring("action") = "deletelayouttypeprocess" then Call DeleteLayoutTypeProcess End If If request.querystring("action") = "editconfig" then Call EditConfig End If If request.querystring("action") = "editconfigprocess" then Call EditConfigProcess End If If request.querystring("action") = "managearticlelayouts" then Call ManageArticleLayouts End If If request.querystring("action") = "addarticlelayout" then Call AddArticleLayout End If If request.querystring("action") = "addarticlelayoutprocess" then Call AddArticleLayoutProcess End If If request.querystring("action") = "editarticlelayout" then Call EditArticleLayout End If If request.querystring("action") = "editarticlelayoutprocess" then Call EditArticleLayoutProcess End If If request.querystring("action") = "deletearticlelayout" then Call DeleteArticleLayout End If If request.querystring("action") = "deletearticlelayoutprocess" then Call DeleteArticleLayoutProcess End If If request.querystring("action") = "archivearticles" then Call ArchiveArticles End If If request.querystring("action") = "archivearticlesprocess" then Call ArchiveArticlesProcess End If If request.querystring("action") = "searcharticles" then Call DrawHeader Call SearchArticles Call DrawFooter End If If request.querystring("action") = "searcharticlesprocess" then Call DrawHeader Call SearchArticlesProcess Call DrawFooter End If If request.querystring("action") = "archives" then Call DrawHeader Call Archives Call DrawFooter End If If request.querystring("action") = "summary" then Call Summary End If If request.querystring("action") = "email" then Call EmailToFriend End If If request.querystring("action") = "sendemail" then Call SendEmail End If If request.querystring("action") = "syndicate" then Call Syndicate End If If request.querystring("action") = "createsyndicationhtml" then Call CreateSyndicationHTML End If If request.querystring("action") = "createsyndicationhtmlprocess" then Call CreateSyndicationHTMLProcess End If If request.querystring("action") = "submitnews" then Call DrawHeader Call AddArticle Call DrawFooter End If If request.querystring("action") = "minical" then If request.querystring("date") = "" then CalendarDate = Date() Else CalendarDate = request.querystring("date") End If Call DrawMiniCalendar(CalendarDate) End If '******** Write out the page header ******************************************** Sub DrawHeader If request.querystring("category") <> "" then SQL = "SELECT * FROM Categories WHERE CategoryID =" & request.querystring("category") Set RS=dbc.execute(SQL) CategoryLTID = RS("CategoryLayoutType") RS.Close Set RS=Nothing If CategoryLTID <> 0 then SQL = "SELECT * FROM LayoutTypes WHERE LTID = " & CategoryLTID Set RS=dbc.execute(SQL) Session("DefaultHeader") = RS("LTHeader") Session("DefaultFooter") = RS("LTFooter") Else SQL = "SELECT DefaultArticleLayout FROM Config" Set RS=dbc.execute(SQL) DefaultLayoutType = RS("DefaultArticleLayout") RS.Close Set RS=Nothing SQL = "SELECT * FROM LayoutTypes WHERE LTID = " & DefaultLayoutType Set RS=dbc.execute(SQL) Session("DefaultHeader") = RS("LTHeader") Session("DefaultFooter") = RS("LTFooter") RS.Close Set RS=Nothing End If Else SQL = "SELECT DefaultLayoutType FROM Config" Set RS=dbc.execute(SQL) DefaultLayoutType = RS("DefaultLayoutType") RS.Close Set RS=Nothing SQL = "SELECT * FROM LayoutTypes WHERE LTID = " & DefaultLayoutType Set RS=dbc.execute(SQL) Session("DefaultHeader") = RS("LTHeader") Session("DefaultFooter") = RS("LTFooter") RS.Close Set RS=Nothing End If If request.querystring("action") = "print" then SQL = "SELECT * FROM LayoutTypes WHERE LTName = 'PRINT'" Set RS=dbc.execute(SQL) Session("DefaultHeader") = RS("LTHeader") Session("DefaultFooter") = RS("LTFooter") End If response.write Session("DefaultHeader") End Sub '******* Draw HLBox ************************************************************* Sub DrawHLBox(HLHeader, HLFooter) SQLh = "SELECT ArticleTitle, ArticleID, ArticleStartDate, ArticleEndDate FROM Articles WHERE ArticleStatus = 'PUBLISHED' ORDER BY ArticleDate DESC" Set RSh=dbc.execute(SQLh) If UseSQLServer <> "YES" then RSh.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" Else RSh.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" End If If NOT RSh.EOF then response.write HLHeader response.write "" Do While NOT RSh.EOF response.write "" response.write RSh("ArticleTitle") response.write "

" RSh.MoveNext Loop response.write "
" response.write HLFooter End If RSh.Close Set RSh = Nothing End Sub '******* News Home Page (Layout Style) ****************************************** Sub NewsHomePage If request.querystring("category") = "" then UsingLayoutType = DefaultLayoutType Else SQL = "SELECT * FROM Categories WHERE CategoryID = " & request.querystring("category") Set RS=dbc.execute(SQL) UsingLayoutType = RS("CategoryLayoutType") RS.Close Set RS=Nothing End If SQL = "SELECT * FROM LayoutTypes WHERE LTID = " & UsingLayoutType Set RS=dbc.execute(SQL) If RS.EOF then SQL = "SELECT * FROM LayoutTypes WHERE LTID = 1" Set RS=dbc.execute(SQL) End If LTName = RS("LTName") LTDescription = RS("LTDescription") LTNumberToShow = RS("LTNumberToShow") LTNumberofFeatures = RS("LTNumberOfFeatures") LTShowCategorySection = RS("LTShowCategorySection") LTShowNormalHLBox = RS("LTShowNormalHLBox") LTDateBlockHeader = RS("LTDateBlockHeader") LTDateBlockFooter = RS("LTDateBlockFooter") LTLinkToDetailText = RS("LTLinkToDetailText") LTHLLocation = RS("LTHLLocation") LTFeaturesAcross = RS("LTFeaturesAcross") LTShowLastUpdate = RS("LTShowLastUpdate") LTUpdateBGColor = RS("LTUpdateBGColor") LTTopNewsHeading = RS("LTTopNewsHeading") LTRecentNewsHeading = RS("LTRecentNewsHeading") LTCategoryNewsHeading = RS("LTCategoryNewsHeading") LTArticlesAcross = RS("LTArticlesAcross") LTCategoriesAcross = RS("LTCategoriesAcross") LTGroupByDay = RS("LTGroupByDay") LTDaysToShow = RS("LTDaysToShow") LTArticlePadding = RS("LTArticlePadding") LTShowMoreInfo = RS("LTShowMoreInfo") LTHLBoxHeader = RS("LTHLBoxHeader") LTHLBoxFooter = RS("LTHLBoxFooter") RS.Close Set RS=Nothing If request.querystring("action") <> "catview" then SQL = "SELECT * FROM Articles WHERE ArticleStatus = 'PUBLISHED' ORDER BY ArticleDate DESC" Set RS=dbc.execute(SQL) If UseSQLServer <> "YES" then RS.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" Else RS.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" End If Else SQLc = "SELECT * FROM ArticleCategoryLink WHERE CategoryID = " & request.querystring("category") Set RSc = dbc.execute(SQLc) Do While NOT RSc.EOF Articles = Articles & RSc("ArticleID") & ", " RSc.MoveNext Loop If Articles = "" then Articles = 0 End If RSc.Close Set RSc=Nothing SQL = "SELECT * FROM Articles WHERE ArticleID IN(" & Articles & ") AND ArticleStatus = 'PUBLISHED' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic If UseSQLServer <> "YES" then RS.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" Else RS.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" End If End If TotalRecords = 0 Do While NOT RS.EOF TotalRecords = TotalRecords + 1 RS.MoveNext Loop If TotalRecords <> 0 then RS.MoveFirst End If If NOT RS.EOF then RS.MoveFirst LastUpdate = FormatDate(RS("ArticleDate"), "FULL") End If '----- Headline Box Start ----------------------------- If LTShowNormalHLBox = "YES" then response.write "" If LTHLBoxLocation = "LEFT" then response.write "" response.write "" Else response.write "" End If response.write "
" Call DrawHLBox(LTHLBoxHeader, LTHLBoxFooter) response.write "" Else response.write "" End If End If '----- Write last update date ------------------------- If LTShowLastUpdate = "YES" then response.write "
LAST UPDATE: " response.write LastUpdate response.write "

" End If '----- Write out feature articles ------------------ If NOT RS.EOF then If LTNumberOfFeatures <> 0 then If LTNumberOfFeatures > TotalRecords then LTNumberOfFeatures = TotalRecords End If response.write LTTopNewsHeading CellWidth = (100 \ LTFeaturesAcross) Counter = 0 response.write "" For I = 1 to LTNumberOfFeatures If Counter = 0 then response.write "" End If response.write "" Counter = Counter + 1 If Counter = LTFeaturesAcross then response.write "" Counter = 0 End If If NOT RS.EOF then RS.MoveNext End If Next response.write "
" If RS("ArticleImage") <> "" then response.write "" End If response.write "

" response.write "" response.write RS("ArticleTitle") response.write "" If LTShowMoreInfo = "YES" then response.write "
" SQLa="SELECT * FROM Authors WHERE AuthorID = " & RS("ArticleAuthor") Set RSa = dbc.execute(SQLa) response.write "" & RSa("AuthorFirstName") & " " & RSa("AuthorLastName") & " | " & RS("ArticleSource") response.write "" RSa.Close Set RSa=Nothing End If response.write "
" response.write RS("ArticleSummary") response.write "" If LTLinkToDetailText <> "" then response.write "

" response.write "" & LTLinkToDetailText & "" End If response.write "

" End If '----- Write Out Recent News Items ----------------------- If LTGroupByDay <> "YES" then response.write LTRecentNewsHeading LTNumberToShow = LTNumberToShow - LTNumberOfFeatures CellWidth = (100 \ LTArticlesAcross) Counter = 0 response.write "" For I = 1 to LTNumberToShow If NOT RS.EOF then If Counter = 0 then response.write "" End If response.write "" Counter = Counter + 1 If Counter = LTArticlesAcross then response.write "" Counter = 0 End If If NOT RS.EOF then RS.MoveNext End If End If Next response.write "
" response.write "" response.write "
" response.write "" response.write RS("ArticleTitle") response.write "" If LTShowMoreInfo = "YES" then response.write "
" SQLa="SELECT * FROM Authors WHERE AuthorID = " & RS("ArticleAuthor") Set RSa = dbc.execute(SQLa) response.write "" & RSa("AuthorFirstName") & " " & RSa("AuthorLastName") & " | " & RS("ArticleSource") response.write "" RSa.Close Set RSa=Nothing End If response.write "
" response.write RS("ArticleSummary") response.write "" If LTLinkToDetailText <> "" AND RS("ArticleBody") <> "" then response.write "

" response.write "" & LTLinkToDetailText & "" End If response.write "

" RS.Close Set RS=Nothing Else Counter = 0 For I = 1 to LTDaysToShow If NOT RS.EOF then If Counter = 0 then response.write "" response.write LTDateBlockHeader response.write FormatDateTime(RS("ArticleDate"),1) response.write LTDateBlockFooter CurrentDate = Trim(Left(RS("ArticleDate"), 8)) End If response.write "" response.write "" If NOT RS.EOF then RS.MoveNext If NOT RS.EOF then If CurrentDate <> Trim(Left(RS("ArticleDate"), 8)) then response.write "
" response.write "" response.write "
" response.write "" response.write RS("ArticleTitle") response.write "" If LTShowMoreInfo = "YES" then response.write "
" SQLa="SELECT * FROM Authors WHERE AuthorID = " & RS("ArticleAuthor") Set RSa = dbc.execute(SQLa) response.write "" & RSa("AuthorFirstName") & " " & RSa("AuthorLastName") & " | " & RS("ArticleSource") response.write "" RSa.Close Set RSa=Nothing End If response.write "
" response.write RS("ArticleSummary") response.write "" If LTLinkToDetailText <> "" AND RS("ArticleBody") <> "" then response.write "

" response.write "" & LTLinkToDetailText & "" End If response.write "

" Counter = 0 Else Counter = Counter + 1 End If End If End If End If Next RS.Close Set RS=Nothing End If Else response.write "There is currently no news articles in this category.

" End If '----- Write Out The News Categories ------------------ If LTShowCategorySection = "YES" then response.write LTCategoryNewsHeading CellWidth = (100 \ LTCategoriesAcross) SQLc = "SELECT * FROM Categories ORDER BY CategoryName" Set RSc=dbc.execute(SQLc) Counter = 0 response.write "" Do While NOT RSc.EOF If Counter = 0 then response.write "" End If response.write "" Counter = Counter + 1 If Counter = LTCategoriesAcross then response.write "" Counter = 0 End If If NOT RSc.EOF then RSc.MoveNext End If Loop response.write "
" response.write "
" response.write "" response.write RSc("CategoryName") response.write "
" SQLd = "SELECT * FROM ArticleCategoryLink WHERE CategoryID = " & RSc("CategoryID") Set RSd = dbc.execute(SQLd) ShowCounter = 0 Do While NOT RSd.EOF SQLe = "SELECT * FROM Articles WHERE ArticleID = " & RSd("ArticleID") & " AND ArticleStatus = 'PUBLISHED'" Set RSe=dbc.execute(SQLe) If UseSQLServer <> "YES" then RSe.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" Else RSe.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" End If If NOT RSe.EOF then ShowCounter = 1 response.write " - " & RSe("ArticleTitle") & "" response.write "
" Else If RSd.EOF then ShowCounter = 1 response.write "Currently No News" End If End If RSe.Close Set RSe=Nothing RSd.MoveNext Loop If ShowCounter <> 1 then response.write "Currently No News" End If RSd.Close Set RSd=Nothing response.write "

" RSc.Close Set RSc=Nothing End If If LTShowNormalHLBox = "YES" then If LTHLBoxLocation = "LEFT" then response.write "
" Call DrawHLBox(LTHLBoxHeader, LTHLBoxFooter) response.write "
" End If response.write "
" Call DrawButtonBar End Sub '******* Detail View of an Article (Default View) ********************************* Sub DetailView 'SQL = "SELECT ArticleViews FROM Articles WHERE ArticleID = " & request.querystring("article") 'Set RS=dbc.execute(SQL) 'NumberOfViews = RS("ArticleViews") + 1 'RS.Close 'Set RS=Nothing 'SQL="UPDATE Articles Set ArticleViews = " & NumberOfViews & " WHERE [ArticleID] ="&request.querystring("article")&"" 'dbc.Execute(SQL) '-------- Pull In Layout Type -------------------------------------------------- If request.querystring("category") = "" then UsingLayoutType = DefaultLayoutType Else SQL = "SELECT * FROM Categories WHERE CategoryID = " & request.querystring("category") Set RS=dbc.execute(SQL) UsingLayoutType = RS("CategoryLayoutType") RS.Close Set RS=Nothing End If If request.querystring("action") = "print" then UsingLayoutType = "PRINT" End If If UsingLayoutType <> "PRINT" then SQL = "SELECT * FROM LayoutTypes WHERE LTID = " & UsingLayoutType Set RS=dbc.execute(SQL) Else SQL = "SELECT * FROM LayoutTypes WHERE LTName = 'PRINT'" Set RS=dbc.execute(SQL) End If If RS.EOF then SQL = "SELECT * FROM LayoutTypes WHERE LTID = 1" Set RS=dbc.execute(SQL) End If LTShowNormalHLBox = RS("LTShowNormalHLBox") LTHLLocation = RS("LTHLLocation") LTHLBoxHeader = RS("LTHLBoxHeader") LTHLBoxFooter = RS("LTHLBoxFooter") RS.Close Set RS=Nothing '------------ Determine the layout type ----------------------------------------- SQL = "SELECT * FROM Articles WHERE ArticleID =" & request.querystring("article") Set RS=dbc.execute(SQL) ArticleALID = RS("ArticleLayout") SQLc = "SELECT * FROM ArticleCategoryLink WHERE ArticleID = " & request.querystring("article") Set RSc=dbc.execute(SQLc) If NOT RS.EOF then ArticleCatID = RSc("CategoryID") End If If request.querystring("category") <> "" then ArticleCatID = request.querystring("category") End If RSc.Close Set RSc=Nothing RS.Close Set RS=Nothing UseALID = ArticleALID If ArticleALID = 0 then SQL = "SELECT * FROM Categories WHERE CategoryID = " & ArticleCatID Set RS=dbc.execute(SQL) CategoryALID = RS("CategoryArticleLayout") RS.Close Set RS=Nothing UseALID = CategoryALID End If If CateoryALID = 0 then SQL = "SELECT * FROM Config WHERE ConfigID = 1" Set RS=dbc.execute(SQL) DefaultALID = RS("DefaultArticleLayout") RS.Close Set RS=Nothing UseALID = DefaultALID End If If request.querystring("action") = "print" then UseALID = "PRINT" End If '------- Pull in the Article Layout from DB ------------------------------------- If UseALID <> "PRINT" then SQL = "SELECT * FROM ArticleLayouts WHERE ALID = " & UseALID Set RS=dbc.execute(SQL) Else SQL = "SELECT * FROM ArticleLayouts WHERE ALName = 'PRINT'" Set RS=dbc.execute(SQL) End If If RS.EOF then SQL = "SELECT * FROM ArticleLayouts WHERE ALID = 1" Set RS=dbc.execute(SQL) End If ALID = RS("ALID") ALName = RS("ALName") ALDescription = RS("ALDescription") ALShowHeadline = RS("ALShowHeadline") ALShowAuthor = RS("ALShowAuthor") ALShowSource = RS("ALShowSource") ALShowDateTime = RS("ALShowDateTime") ALShowSummary = RS("ALShowSummary") ALSummaryFontSize = RS("ALSummaryFontSize") ALShowArticleImage = RS("ALShowArticleImage") ALShowEmailLink = RS("ALShowEmailLink") ALShowPrintButton = RS("ALShowPrintButton") ALShowRelatedArticles = RS("ALShowRelatedArticles") ALShowLine = RS("ALShowLine") ALPreview = RS("ALPreview") ALRAHeader = RS("ALRAHeader") RS.Close Set RS=Nothing '-------------------------------------------------------------------------------- SQL = "SELECT * FROM Articles WHERE ArticleID =" & request.querystring("article") Set RS=dbc.execute(SQL) SQLa = "SELECT * FROM Authors WHERE AuthorID =" & RS("ArticleAuthor") Set RSa=dbc.execute(SQLa) AuthorFullName = RSa("AuthorFirstName") & " " & RSa("AuthorLastName") AuthorEmailAddress = RSa("AuthorEmailAddress") If LTShowNormalHLBox = "YES" then response.write "" If LTHLBoxLocation = "LEFT" then response.write "" Else response.write "" End If response.write "
" Call DrawHLBox(LTHLBoxHeader, LTHLBoxFooter) response.write "" Else response.write "" End If End If response.write "

" If ALShowArticleImage = "YES" then If RS("ArticleImage") <> "" then response.write "" End If End If If ALShowHeadline = "YES" then response.write "" & RS("ArticleTitle") & "" End If response.write "" response.write "" If ALShowAuthor = "YES" then response.write "
" response.write "By: " & AuthorFullName & "" End If If ALShowSource = "YES" then If RS("ArticleSource") <> "" then response.write " | Source: " If RS("ArticleSourceLink") <> "" then response.write "" End If response.write RS("ArticleSource") If RS("ArticleSourceLink") <> "" then response.write "" End If End If End If If ALShowDateTime = "YES" then response.write "
" response.write FormatDate(RS("ArticleDate"), "FULL") End If If ALShowLine = "YES" then response.write "


" End If response.write "

" If ALShowSummary = "YES" then response.write "" response.write RS("ArticleSummary") & "
" End If response.write "

" '-------- Multi-Page Articles ------------------------------------- If RS("ArticleMultiPage") = "YES" then txtArticleBodyArray = split(RS("ArticleBody"), "$$PAGE$$") If request.querystring("page") <> "" and request.querystring("page") <> "0" and request.querystring("page") <> "1" then page = request.querystring("page") - 1 txtArticleBody = txtArticleBodyArray(page) TotalPages = ubound(txtArticleBodyArray) NextPage = page + 2 PrevPage = page If Page + 1 <> TotalPages then txtArticleLinkArray = split(txtArticleBody, "$$") txtArticleBody = txtArticleLinkArray(0) txtArticlePageLink = txtArticleLinkArray(1) End If txtArticleBody = txtArticleBody & "

" & "Back" If NextPage <= TotalPages then txtArticleBody = txtArticleBody & " | " & txtArticlePageLink & "" End If Else txtArticleBody = txtArticleBodyArray(0) NextPage = 2 txtArticleLinkArray = split(txtArticleBody, "$$") txtArticleBody = txtArticleLinkArray(0) txtArticlePageLink = txtArticleLinkArray(1) txtArticleBody = txtArticleBody & "
" & txtArticlePageLink & "" End If Else txtArticleBody = RS("ArticleBody") End If response.write txtArticleBody response.write "

" response.write "" If ALShowEmailLink = "YES" then response.write "" response.write "" End If If ALShowPrintButton = "YES" then response.write "" response.write "" End If response.write "
onClick="calpopup('news.asp?action=email&article=<%=RS("ArticleID")%>', '350', '300'); return false"> <% response.write " Email this Article Printer Friendly Version
" If ALShowRelatedArticles = "YES" then SQLr = GenerateSQLSearch(FixString(RS("ArticleTitle")), "Articles", "ArticleTitle") SQLr = SQLr & " AND ArticleID <> " & RS("ArticleID") Set RSr=dbc.execute(SQLr) If NOT RSr.EOF then response.write "
" response.write ALRAHeader End If Do While NOT RSr.EOF response.write "- " response.write "" response.write RSr("ArticleTitle") response.write "
" RSr.MoveNext Loop End If If LTShowNormalHLBox = "YES" then If LTHLBoxLocation = "LEFT" then response.write "
" Call DrawHLBox(LTHLBoxHeader, LTHLBoxFooter) response.write "
" End If response.write "
" Call DrawButtonBar End Sub '******* Draw Search Page ****************************************************** Sub SearchArticles response.write "
" response.write "Search For:

" response.write "
All Words " response.write "Any Words" response.write "

" response.write "
" Call DrawButtonBar response.write "
" End Sub '******* Search Articles Process *********************************************** Sub SearchArticlesProcess txtSearchFor = request.form("txtSearchFor") txtSearchIn = request.form("txtSearchIn") txtAndOr = request.form("txtAndOr") SQL = "SELECT ArticleID, ArticleTitle, ArticleSummary, ArticleDate, ArticleStatus, ArticleStartDate, ArticleEndDate FROM Articles WHERE " SQL = SQL & "ArticleTitle LIKE '%" SQL = SQL & Replace( Trim( txtSearchFor ), " ", "%' " & txtAndOr & " ArticleTitle LIKE '%") & "%'" SQL = SQL & " OR ArticleSummary LIKE '%" SQL = SQL & Replace( Trim( txtSearchFor ), " ", "%' " & txtAndOr & " ArticleSummary LIKE '%") & "%'" SQL = SQL & " ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.Filter = "ArticleStatus = 'PUBLISHED' OR ArticleStatus = 'ARCHIVED'" If UseSQLServer <> "YES" then RS.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" Else RS.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" End If response.write "
" response.write "" response.write "Your search returned " & RS.RecordCount & " results

" I = 0 Do While NOT RS.EOF response.write (I + 1) & ". " & RS("ArticleTitle") & " - " & FormatDate(RS("ArticleDate"), "FULL") & "
" I = I + 1 RS.MoveNext Loop response.write "

" Call DrawButtonBar response.write "
" End Sub '******* Draw Archive Page ****************************************************** Sub Archives If request.form("txtYear") <> "" then txtYear = request.form("txtYear") Else txtYear = Year(Now) End If If request.form("txtMonth") <> "" then txtMonth = request.form("txtMonth") Else txtMonth = Month(Now) End If If txtMonth = 4 OR txtMonth = 6 OR txtMonth = 9 OR txtMonth = 11 then txtDay = 30 Else txtDay = 31 End If If txtMonth = 2 then txtDay = 28 End If SQL = "SELECT ArticleID, ArticleTitle, ArticleDate, ArticleStartDate, ArticleEndDate FROM Articles WHERE ArticleStatus = 'ARCHIVED' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic If UseSQLServer <> "YES" then RS.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" RS.Filter = "ArticleDate >= #" & txtMonth & "/1/" & txtYear & "# AND ArticleDate <= #" & txtMonth & "/" & txtDay & "/" & txtYear & "#" Else RS.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" RS.Filter = "ArticleDate >= '" & txtMonth & "/1/" & txtYear & "' AND ArticleDate <= '" & txtMonth & "/" & txtDay & "/" & txtYear & "'" End If response.write "
" response.write "
" response.write "Select A Month: " response.write " " response.write "Select A Year: " response.write " " response.write "" response.write "
" response.write "News Archive for " & MonthName(txtMonth) & ", " & txtYear & "
" response.write "There are (" & RS.RecordCount & ") articles...

" I = 0 Do While NOT RS.EOF response.write (I + 1) & ". " & RS("ArticleTitle") & " - " & FormatDate(RS("ArticleDate"), "FULL") & "
" I = I + 1 RS.MoveNext Loop response.write "
" response.write "
" Call DrawButtonBar response.write "
" End Sub '******* Draw Login Screen ***************************************************** Sub DrawLoginScreen response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Please Login
" response.write "" response.write "" response.write "" response.write "" End Sub '******* Syndication Routine ****************************************************** Sub Syndicate NumberToShow = Int(request.querystring("num")) SyndFont = request.querystring("font") SyndSize = request.querystring("size") SyndColor = request.querystring("color") If request.querystring("category") = "" then SQL = "SELECT * FROM Articles WHERE ArticleStatus = 'PUBLISHED' ORDER BY ArticleDate DESC" Set RS=dbc.execute(SQL) If UseSQLServer <> "YES" then RS.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" Else RS.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" End If Else SQLc = "SELECT * FROM ArticleCategoryLink WHERE CategoryID = " & request.querystring("category") Set RSc = dbc.execute(SQLc) Do While NOT RSc.EOF Articles = Articles & RSc("ArticleID") & ", " RSc.MoveNext Loop If Articles = "" then Articles = 0 End If RSc.Close Set RSc=Nothing SQL = "SELECT * FROM Articles WHERE ArticleID IN(" & Articles & ") AND ArticleStatus = 'PUBLISHED' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic If UseSQLServer <> "YES" then RS.Filter = "ArticleStartDate <= #" & Date() & "# AND ArticleEndDate >= #" & Date() & "#" Else RS.Filter = "ArticleStartDate <= '" & Date() & "' AND ArticleEndDate >= '" & Date() & "'" End If End If Content = "" I = 0 Do While NOT RS.EOF If I >= NumberToShow then Exit Do End If Content = Content & "" & RS("ArticleTitle") & "

" I = I + 1 RS.MoveNext Loop Content = Content & SyndicationText Content = Replace(Content, "'", "\'") %> function ShowSyndication() { var TempStr; TempStr = ('<%=Content%>'); document.write(TempStr); } <% End Sub '******* Create Syndication HTML ************************************************** Sub CreateSyndicationHTML If request.querystring("type") <> "public" then If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If Call DrawWelcomeBar response.write "
" response.write "
" response.write "" If request.querystring("err") = "nouser" then response.write "Sorry, you must enter a USER NAME.

" End If If request.querystring("err") = "baduser" then response.write "Sorry, the USER NAME you entered is invalid.

" End If If request.querystring("err") = "badpass" then response.write "Sorry, the PASSWORD you entered is invalid.

" End If If request.querystring("err") = "notlogged" then response.write "Sorry, you must be logged in to access this feature.

" End If response.write "User Name:
" response.write "" response.write "
" response.write "Password:
" response.write "" response.write "

" response.write "" response.write "


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Edit Configuration
Manage Syndication

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Manage Syndication


" End If response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" SQL = "SELECT * FROM Categories ORDER BY CategoryName" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "How many articles would you like to display:
" response.write "
" response.write "
" response.write "What font would you like to use:
" response.write "
" response.write "
" response.write "What font size would you like to use:
" response.write "
" response.write "
" response.write "What color would you like to use:
" response.write "
" response.write "
" response.write "What category would you like to show:
" response.write "" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" If request.querystring("type") = "public" then response.write "
" Call DrawButtonBar End If End Sub '******* Create Syndication HTML Process ****************************************** Sub CreateSyndicationHTMLProcess SiteURL = request.servervariables("HTTP_REFERER") SiteURLTemp = split(SiteURL, "?") SiteURL = SiteURLTemp(0) & "?action=" SyndNumberOfArticles = request.form("txtSyndNumberOfArticles") SyndFontFace = request.form("txtSyndFontFace") SyndFontSize = request.form("txtSyndFontSize") SyndFontColor = request.form("txtSyndFontColor") SyndCategory = request.form("txtSyndCategory") If request.querystring("type") <> "public" then If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Edit Configuration
Manage Syndication

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Manage Syndication


" End If response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Syndication HTML:
" response.write "Below is the HTML code that you need to use on your standard
page to add our syndicated content to your website, simply
copy and paste this code into your page.

" response.write "
" response.write "Syndication HTML:
" response.write "
" response.write "
" response.write "
" If request.querystring("type") = "public" then response.write "
" Call DrawButtonBar End If End Sub '******* Process Login ************************************************************ Sub ProcessLogin If request.form("txtUserName") = "" then response.redirect "news.asp?action=login&err=nouser" End If SQL = "SELECT * FROM Authors WHERE AuthorUserName = '" & request.form("txtUserName") & "'" Set RS=dbc.execute(SQL) If RS.EOF then response.redirect "news.asp?action=login&err=baduser" End If If RS("AuthorPassword") = request.form("txtPassword") then Session("frAuthorID") = RS("AuthorID") Session("frUserName") = RS("AuthorUserName") Session("frFirstName") = RS("AuthorFirstName") Session("frLastName") = RS("AuthorLastName") Session("frEmailAddress") = RS("AuthorEmailAddress") Session("frLevel") = RS("AuthorLevel") Session("frRequireApproval") = RS("AuthorRequireApproval") If RS("AuthorLevel") = 1 then Session("frRights") = "Administrator" Else Session("frRights") = "Publisher" End If response.redirect "news.asp?action=mainmenu" Else response.redirect "news.asp?action=login&err=badpass" End If End Sub '******* Draw Main Menu *********************************************************** Sub DrawMainMenu If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If Call DrawWelcomeBar response.write "
" If Session("frLevel") = 1 then response.write "" response.write "" response.write "" response.write "" response.write "

" response.write "
" response.write "

" response.write "
" response.write "
" Else response.write "" response.write "" response.write "" response.write "

" End If End Sub '******* Process LogOff *********************************************************** Sub LogOff Session.Abandon response.redirect "news.asp" End Sub '******* Manage Authors ************************************************************* Sub ManageAuthors If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM Authors ORDER BY AuthorFirstName" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.MoveFirst '-------- Paging ---------------------------------------------- If request.querystring("Page") = "" Then Page = 1 RS.Move First Else Page = Request.QueryString("Page") If Page = 1 then RS.Move First Else RS.Move CInt((Page * RecordsPerPage) - RecordsPerPage) End If End If n = 0 RS.PageSize = RecordsPerPage '----------------------------------------------------------------- Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Authors
Tasks: Add An Author

" response.write "

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" UseBackColor = BackColorOne Do until RS.EOF If n = RecordsPerPage then exit do End If If RS("AuthorLevel") = 1 then RightsType = "Administrator" Else RightsType = "Publisher" End If SQLc = "SELECT * FROM AuthorCategoryLink WHERE AuthorID = " & RS("AuthorID") Set RSc=dbc.execute(SQLc) If NOT RSc.EOF then AssignedCategories = "" Do While NOT RSc.EOF If RSc("CategoryID") = "99999" then AssignedCategories = "ALL" Else SQLd = "SELECT * FROM Categories WHERE CategoryID = " & RSc("CategoryID") Set RSd=dbc.execute(SQLd) AssignedCategories = AssignedCategories & " " & RSd("CategoryName") & "
" End If RSc.MoveNext Loop AssignedCatLength = len(AssignedCategories) AssignedCategories = left(AssignedCategories, (AssignedCatLength -1)) Else AssignedCategories = "None" End If response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" RS.MoveNext If UseBackColor = BackColorOne then UseBackColor = BackColorTwo Else UseBackColor = BackColorOne End If n=n+1 Loop response.write "
  First NameLast NameUserNameEmailRights LevelCategories
    " & RS("AuthorFirstName") & "" & RS("AuthorLastName") & "" & RS("AuthorUserName") & "" & RS("AuthorEmailAddress") & "" & RightsType & "" & AssignedCategories & "
" '------- Page Navigation ---------------------------------- response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
 " response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" If Page <> 1 then response.write "" response.write "<< Prev" End If If Page <> 1 then response.write " " end If For intCount = 1 to RS.PageCount If IntCount = 1 then response.write " | " End If If cint(intCount) = cint(Page) then response.write "" & intCount & " | " Else response.write "" & intCount & " | " End If Next If cint(page) <> cint(RS.PageCount) then response.write "" response.write " Next >>" End If If cint(Page) = cint(RS.PageCount) then response.write "" End If response.write "
" response.write "
" '------------------------------------------------------------- End Sub '******** Add An Author *********************************************************** Sub AddAuthor If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Authors
Add Author

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add Author


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" SQL = "SELECT * FROM Categories ORDER BY CategoryName" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "First Name:
" response.write "
" response.write "
" response.write "Last Name:
" response.write "
" response.write "
" response.write "User Name:
" response.write "
" response.write "
" response.write "Password:
" response.write "
" response.write "
" response.write "Email Address:
" response.write "
" response.write "
" response.write "Rights Level:
" response.write "Publisher" response.write "Administrator
" response.write "
" response.write "Require Approval Before Publishing:
" response.write "YES" response.write "NO
" response.write "
" response.write "Assigned Categories:
Hold CTRL to select multiple categories.

" response.write "" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Add Author Process ******************************************************* Sub AddAuthorProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM Authors", dbc, adOpenDynamic, adLockPessimistic, adCMDText RS.AddNew RS("AuthorFirstName")=request.form("txtFirstName") RS("AuthorLastName")=request.form("txtLastName") RS("AuthorUserName")=request.form("txtUserName") RS("AuthorPassword")=request.form("txtPassword") RS("AuthorEmailAddress")=request.form("txtEmailAddress") RS("AuthorRequireApproval")=request.form("txtAuthorRequireApproval") RS("AuthorLevel")=request.form("txtRightsLevel") RS.Update RS.Close Set RS=Nothing SQL = "SELECT * FROM Authors" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.MoveLast AuthorID = RS("AuthorID") RS.Close Set RS=Nothing Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM AuthorCategoryLink", dbc, adOpenDynamic, adLockPessimistic, adCMDText Dim Arr Arr = Split(CStr(Request.Form("txtAssignedCategories")),",") For x = 0 to UBound(Arr) RS.AddNew RS("AuthorID") = AuthorID RS("CategoryID") = Trim(Arr(x)) Next RS.Update RS.Close Set RS=Nothing response.redirect "news.asp?action=summary&type=addauthorsuccess" End Sub '******* Edit Author Screen ******************************************************* Sub EditAuthor If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM Authors WHERE AuthorID = " & request.querystring("authorid") Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Authors
Edit Author

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Author


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" SQLc = "SELECT * FROM Categories ORDER BY CategoryName" Set RSc=Server.CreateObject("adodb.Recordset") RSc.Open SQLc, dbc, adopenstatic response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "First Name:
" response.write "
" response.write "
" response.write "Last Name:
" response.write "
" response.write "
" response.write "User Name:
" response.write "
" response.write "
" response.write "Password:
" response.write "
" response.write "
" response.write "Email Address:
" response.write "
" response.write "
" response.write "Rights Level:
" response.write "Publisher" response.write "Administrator
" response.write "
" response.write "Require Approval Before Publishing:
" response.write "YES" response.write "NO
" response.write "
" response.write "Assigned Categories:
Hold CTRL to select multiple categories.

" response.write "" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Edit Author Process ****************************************************** Sub EditAuthorProcess If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL="UPDATE Authors Set AuthorFirstName = '"&request.form("txtFirstName")&"', AuthorLastName = '"&request.form("txtLastName")&"', AuthorUserName = '"&request.form("txtUserName")&"', AuthorPassword = '"&request.form("txtPassword")&"', AuthorEmailAddress = '"&request.form("txtEmailAddress")&"', AuthorLevel = '"&request.form("txtRightsLevel")&"', AuthorRequireApproval = '"&request.form("txtAuthorRequireApproval")&"' WHERE [AuthorID] ="&request.form("txtAuthorID")&"" dbc.Execute(SQL) SQL = "DELETE FROM AuthorCategoryLink WHERE AuthorID IN("& request.form("txtAuthorID") &")" dbc.Execute(SQL) Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM AuthorCategoryLink", dbc, adOpenDynamic, adLockPessimistic, adCMDText Dim Arr Arr = Split(CStr(Request.Form("txtAssignedCategories")),",") For x = 0 to UBound(Arr) RS.AddNew RS("AuthorID") = request.form("txtAuthorID") RS("CategoryID") = Trim(Arr(x)) Next RS.Update RS.Close Set RS=Nothing response.redirect "news.asp?action=summary&type=editauthorsuccess" End Sub '******* Delete Author Screen ***************************************************** Sub DeleteAuthor If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Authors
Delete Author

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Author


" SQL = "SELECT * FROM Authors WHERE AuthorID = " & request.querystring("authorid") Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic If RS("AuthorID") = 1 then response.write "

" response.write "Sorry you cannot delete this Author.

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Administrator

" response.write "Main Menu | Manage Authors
" response.write "

" Else response.write "

" response.write "Are you sure you want to delete this Author?

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" & RS("AuthorFirstName") & " " & RS("AuthorLastName") & "

" response.write "YES | NO
" response.write "

" End If RS.Close Set RS = Nothing End Sub '******* Delete Author Process **************************************************** Sub DeleteAuthorProcess If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "DELETE FROM AuthorCategoryLink WHERE AuthorID IN("& request.querystring("authorid") &")" dbc.Execute(SQL) SQL = "DELETE FROM Authors WHERE AuthorID IN("& request.querystring("authorid") &")" dbc.Execute(SQL) SQL = "UPDATE Articles SET ArticleAuthor = 1 WHERE ArticleAuthor = " & request.querystring("authorid") dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=deleteauthorsuccess" End Sub '******* Draw Manage Categories Screen ******************************************** Sub ManageCategories If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM Categories ORDER BY CategoryName" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.MoveFirst '-------- Paging ---------------------------------------------- If request.querystring("Page") = "" Then Page = 1 RS.Move First Else Page = Request.QueryString("Page") If Page = 1 then RS.Move First Else RS.Move CInt((Page * RecordsPerPage) - RecordsPerPage) End If End If n = 0 RS.PageSize = RecordsPerPage '----------------------------------------------------------------- Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Categories
Tasks: Add A Category

" response.write "

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" UseBackColor = BackColorOne Do until RS.EOF If n = RecordsPerPage then exit do End If SQLc = "SELECT * FROM AuthorCategoryLink WHERE CategoryID = " & RS("CategoryID") & " OR CategoryID = 99999" Set RSc=dbc.execute(SQLc) If NOT RSc.EOF then AssignedAuthors = "" Do While NOT RSc.EOF SQLd = "SELECT * FROM Authors WHERE AuthorID = " & RSc("AuthorID") Set RSd=dbc.execute(SQLd) AssignedAuthors = AssignedAuthors & "" & RSd("AuthorFirstName") & " " & RSd("AuthorLastName") & "
" RSc.MoveNext Loop AssignedAuthLength = len(AssignedAuthors) AssignedAuthors = left(AssignedAuthors, (AssignedAuthLength -1)) Else AssignedAuthors = "None" End If response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" RS.MoveNext If UseBackColor = BackColorOne then UseBackColor = BackColorTwo Else UseBackColor = BackColorOne End If n=n+1 Loop response.write "
  Category NameCategory DescriptionLayout TypeArticle LayoutAssigned Authors
    " & RS("CategoryName") & "" & RS("CategoryDescription") & "" & RS("CategoryLayoutType") & " - " If RS("CategoryLayoutType") <> 0 then SQLz = "SELECT * FROM LayoutTypes WHERE LTID = " & RS("CategoryLayoutType") Set RSz=dbc.execute(SQLz) response.write RSz("LTName") RSz.Close Set RSz=Nothing Else response.write "Use Config Default" End If response.write "" & RS("CategoryArticleLayout") & " - " If RS("CategoryArticleLayout") <> 0 then SQLz = "SELECT * FROM ArticleLayouts WHERE ALID = " & RS("CategoryArticleLayout") Set RSz=dbc.execute(SQLz) response.write RSz("ALName") RSz.Close Set RSz=Nothing Else response.write "Use Config Default" End If response.write "" & AssignedAuthors & "
" '------- Page Navigation ---------------------------------- response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
 " response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" If Page <> 1 then response.write "" response.write "<< Prev" End If If Page <> 1 then response.write " " end If For intCount = 1 to RS.PageCount If IntCount = 1 then response.write " | " End If If cint(intCount) = cint(Page) then response.write "" & intCount & " | " Else response.write "" & intCount & " | " End If Next If cint(page) <> cint(RS.PageCount) then response.write "" response.write " Next >>" End If If cint(Page) = cint(RS.PageCount) then response.write "" End If response.write "
" response.write "
" '------------------------------------------------------------- End Sub '******* Add New Category Screen ************************************************** Sub AddCategory If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Categories
Add Category

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add Category


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Category Name:
" response.write "
" response.write "
" response.write "Category Description:
" response.write "
" response.write "
" response.write "Category Layout Type:
" response.write "
" response.write "
" response.write "Article Layout Type:
" response.write "
" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Add Category Process ***************************************************** Sub AddCategoryProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM Categories", dbc, adOpenDynamic, adLockPessimistic, adCMDText RS.AddNew RS("CategoryName")=request.form("txtCategoryName") RS("CategoryDescription")=request.form("txtCategoryDescription") RS("CategoryLayoutType")=request.form("txtLayoutType") RS("CategoryArticleLayout")=request.form("txtArticleLayout") RS.Update RS.Close Set RS=Nothing SQL = "SELECT * FROM Categories" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.MoveLast CategoryID = RS("CategoryID") RS.Close Set RS=Nothing 'Set RS=Server.CreateObject("ADODB.RecordSet") 'RS.Open "SELECT * FROM AuthorCategoryLink", dbc, adOpenDynamic, adLockPessimistic, adCMDText 'RS.AddNew 'RS("CategoryID") = CategoryID 'RS("AuthorID") = 1 'RS.Update 'RS.Close 'Set RS=Nothing response.redirect "news.asp?action=summary&type=addcategorysuccess" End Sub '******* Edit Category Screen ************************************************** Sub EditCategory If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM Categories WHERE CategoryID = " & request.querystring("categoryid") Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Categories
Edit Category

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Category


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Category Name:
" response.write "
" response.write "
" response.write "Category Description:
" response.write "
" response.write "
" response.write "Category Layout Type:
" response.write "
" response.write "
" response.write "Category Article Layout:
" response.write "
" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Edit Category Process **************************************************** Sub EditCategoryProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If SQL="UPDATE Categories Set CategoryName = '"&FixString(request.form("txtCategoryName"))&"', CategoryDescription = '"&FixString(request.form("txtCategoryDescription"))&"', CategoryLayoutType = '"&request.form("txtLayoutType")&"', CategoryArticleLayout = '"&request.form("txtArticleLayout")&"' WHERE [CategoryID] ="&request.form("txtCategoryID")&"" dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=editcategorysuccess" End Sub '******* Delete Category Screen ***************************************************** Sub DeleteCategory If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Categories
Delete Category

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Category


" SQL = "SELECT * FROM Categories WHERE CategoryID = " & request.querystring("categoryid") Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic SQLb = "SELECT * FROM ArticleCategoryLink WHERE CategoryID = " & request.querystring("categoryid") Set RSb=dbc.execute(SQLb) If RSb.EOF then response.write "

" response.write "Are you sure you want to delete this Category?

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" & RS("CategoryName") & "

" response.write "YES | NO
" response.write "

" Else response.write "

" response.write "Sorry you cannot delete this category because it still contains articles.
Remove any articles from this category first.

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" & RS("CategoryName") & "

" response.write "OK
" response.write "

" End If RSb.Close Set RSb=Nothing RS.Close Set RS = Nothing End Sub '******* Delete Category Process **************************************************** Sub DeleteCategoryProcess If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "DELETE FROM AuthorCategoryLink WHERE AuthorID IN("& request.querystring("categoryid") &")" dbc.Execute(SQL) SQL = "DELETE FROM Categories WHERE CategoryID IN("& request.querystring("categoryid") &")" dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=deletecategorysuccess" End Sub '******* Manage Articles ********************************************************** Sub ManageArticles If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If request.querystring("filter") <> "" then Session("frFilter") = request.querystring("filter") End If If Session("frFilter") = "all" or Session("frFilter") = "" then SQL = "SELECT * FROM Articles ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic End If If Session("frFilter") = "published" then SQL = "SELECT * FROM Articles WHERE ArticleStatus = 'PUBLISHED' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic End If If Session("frFilter") = "un-published" then SQL = "SELECT * FROM Articles WHERE ArticleStatus = 'UN-PUBLISHED' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic End If If Session("frFilter") = "archived" then SQL = "SELECT * FROM Articles WHERE ArticleStatus = 'ARCHIVED' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic End If If Session("frFilter") = "usersubmitted" then SQL = "SELECT * FROM Articles WHERE ArticleStatus = 'USER SUBMITTED' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic End If If Session("frFilter") = "waitingapproval" then SQL = "SELECT * FROM Articles WHERE ArticleStatus = 'AWAITING APPROVAL' ORDER BY ArticleDate DESC" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic End If If NOT RS.EOF then RS.MoveFirst End If '-------- Paging ---------------------------------------------- If request.querystring("Page") = "" Then Page = 1 If NOT RS.EOF then RS.MoveFirst End If Else Page = Request.QueryString("Page") If Page = 1 then RS.Move First Else RS.Move CInt((Page * RecordsPerPage) - RecordsPerPage) End If End If n = 0 RS.PageSize = RecordsPerPage '----------------------------------------------------------------- Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" If Session("frFilter") <> "published" then response.write "" Else response.write "" End If response.write "" If Session("frFilter") <> "un-published" then response.write "" Else response.write "" End If response.write "" If Session("frFilter") <> "waitingapproval" then response.write "" Else response.write "" End If response.write "" If Session("frFilter") <> "archived" then response.write "" Else response.write "" End If response.write "" If Session("frFilter") <> "usersubmitted" then response.write "" Else response.write "" End If response.write "" If Session("frFilter") <> "all" then response.write "" Else response.write "" End If response.write "" response.write "
Navigation: Main Menu
Manage Articles
Tasks: Add An Article
Archive Articles
Filters: PUBLISHED
PUBLISHED
UN-PUBLISHED
UN-PUBLISHED
AWAITING APPROVAL
AWAITING APPROVAL
ARCHIVED
ARCHIVED
USER SUBMITTED
USER SUBMITTED
ALL
ALL

" response.write "


" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" UseBackColor = BackColorOne Do until RS.EOF If n = RecordsPerPage then exit do End If SQLd = "SELECT * FROM ArticleCategoryLink WHERE ArticleID = " & RS("ArticleID") Set RSd=dbc.execute(SQLd) ArticleCategory = "" Do While NOT RSd.EOF SQLe = "SELECT * FROM Categories WHERE CategoryID = " & RSd("CategoryID") Set RSe=dbc.execute(SQLe) ArticleCategoryLink = RSe("CategoryName") RSe.Close Set RSe=Nothing ArticleCategory = ArticleCategory & " " & ArticleCategoryLink & "
" RSd.MoveNext Loop RSd.Close Set RSd=Nothing SQLd = "SELECT * FROM Authors WHERE AuthorID = " & RS("ArticleAuthor") Set RSd=dbc.execute(SQLd) ArticleAuthor = RSd("AuthorFirstName") & " " & RSd("AuthorLastName") RSd.Close Set RSd=Nothing response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" RS.MoveNext If UseBackColor = BackColorOne then UseBackColor = BackColorTwo Else UseBackColor = BackColorOne End If n=n+1 Loop response.write "
  Title / SummaryCategoriesAuthorStatusDate
      " & RS("ArticleTitle") & "
" & RS("ArticleSummary") & "
" & ArticleCategory & "" & ArticleAuthor & "" & RS("ArticleStatus") & "" & FormatDate(RS("ArticleDate"),"FULL") & "
" '------- Page Navigation ---------------------------------- response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
 " response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" If Page <> 1 then response.write "" response.write "<< Prev" End If If Page <> 1 then response.write " " end If For intCount = 1 to RS.PageCount If IntCount = 1 then response.write " | " End If If cint(intCount) = cint(Page) then response.write "" & intCount & " | " Else response.write "" & intCount & " | " End If Next If cint(page) <> cint(RS.PageCount) AND NOT RS.EOF then response.write "" response.write " Next >>" End If If cint(Page) = cint(RS.PageCount) then response.write "" End If response.write "
" response.write "
" '------------------------------------------------------------- End Sub '******* Add An Article *********************************************************** Sub AddArticle If Session("frUserName") = "" AND request.querystring("action") <> "submitnews" then response.redirect "news.asp?action=login&err=notlogged" End If %> <% If request.querystring("action") <> "submitnews" then Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Add Article

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add Article


" End If response.write "
" response.write "" If request.querystring("action") = "submitnews" then response.write "" End If response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" If request.querystring("action") <> "submitnews" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" End If response.write "" response.write "" response.write "" response.write "" If request.querystring("action") <> "submitnews" then response.write "" response.write "" response.write "" response.write "" End If response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" If request.querystring("action") <> "submitnews" then response.write "" response.write "" response.write "" response.write "" End If SQLc = "SELECT * FROM Categories ORDER BY CategoryName" Set RSc=Server.CreateObject("adodb.Recordset") RSc.Open SQLc, dbc, adopenstatic response.write "" response.write "" response.write "" response.write "" If request.querystring("action") <> "submitnews" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" End If response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Article Title:
" response.write "
" response.write "
" response.write "Article Summary:
" response.write "
" response.write "
" response.write "Article Body:
" response.write "Browser Type: " & BrowserType & "" If BrowserType = "Microsoft" then %> <% Else response.write "
" response.write "" End If response.write "
" response.write "
" response.write "Article Multi-Page:
" response.write "This is a Multi-Page Article
" response.write "
" response.write "Article Layout:
" response.write "" response.write "
" response.write "
" response.write "Article Date:
" response.write " " %> <% response.write "
" response.write "
" response.write "Article Author:
" response.write "" & Session("frFirstName") & " " & Session("frLastName") & "
" response.write "
" response.write "Article Source:
" response.write "
" response.write "
" response.write "Article Source Link:
" response.write "
" response.write "
" response.write "Article Status:
" response.write "Published" response.write "Un-Published Draft" response.write "Archived" response.write "User Submitted" response.write "Awaiting Approval
" response.write "
" response.write "Article Categories:
Hold CTRL to select multiple categories.

" response.write "" response.write "
" response.write "Article Image:
" response.write " " %> <% response.write "
" response.write "
" response.write "Article Start Date:
" response.write " " %> <% response.write "
" response.write "
" response.write "Article End Date:
" response.write " " %> <% response.write "
" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" If request.querystring("action") = "submitnews" then response.write "
" Call DrawButtonBar End If End Sub '******* Add Article Process ****************************************************** Sub AddArticleProcess 'If Session("frUserName") = "" then ' response.redirect "news.asp?action=login&err=notlogged" 'End If If Session("frRequireApproval") = "YES" then ArticleStatus = "AWAITING APPROVAL" Else ArticleStatus = request.form("txtArticleStatus") End If If request.form("txtArticleStatusHidden") <> "" then ArticleStatus = "USER SUBMITTED" End If If request.form("txtArticleStartDate") = "" then txtArticleStartDate = FormatDateTime(cDate(request.form("txtArticleDate")),2) Else txtArticleStartDate = cDate(request.form("txtArticleStartDate")) End If If request.form("txtArticleEndDate") = "" then txtArticleEndDate = cDate("12/31/2010") Else txtArticleEndDate = cDate(request.form("txtArticleEndDate")) End If If Session("frAuthorID") = "" then Session("frAuthorID") = 1 End If Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM Articles", dbc, adOpenDynamic, adLockPessimistic, adCMDText RS.AddNew RS("ArticleTitle")=request.form("txtArticleTitle") RS("ArticleSummary")=request.form("txtArticleSummary") RS("ArticleBody")=request.form("txtArticleBody") RS("ArticleDate")=request.form("txtArticleDate") RS("ArticleAuthor")=Session("frAuthorID") RS("ArticleSource")=request.form("txtArticleSource") RS("ArticleSourceLink")=request.form("txtArticleSourceLink") RS("ArticleStatus")=ArticleStatus RS("ArticleImage")=request.form("txtArticleImage") RS("ArticleStartDate")=txtArticleStartDate RS("ArticleEndDate")=txtArticleEndDate RS("ArticleMultiPage")=request.form("txtArticleMultiPage") RS("ArticleLayout")=request.form("txtArticleLayout") RS.Update RS.Close Set RS=Nothing SQL = "SELECT * FROM Articles ORDER BY ArticleID" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.MoveLast ArticleID = RS("ArticleID") RS.Close Set RS=Nothing Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM ArticleCategoryLink", dbc, adOpenDynamic, adLockPessimistic, adCMDText Dim Arr Arr = Split(CStr(Request.Form("txtArticleCategories")),",") For x = 0 to UBound(Arr) RS.AddNew RS("ArticleID") = ArticleID RS("CategoryID") = Trim(Arr(x)) Next RS.Update RS.Close Set RS=Nothing' If request.form("txtArticleStatusHidden") = "" then response.redirect "news.asp?action=summary&type=addarticlesuccess" Else response.redirect "news.asp?action=summary&type=submitarticlesuccess" End If End Sub '******* Edit Article Screen ****************************************************** Sub EditArticle If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If SQLc = "SELECT * FROM ArticleCategoryLink WHERE ArticleID = " & request.querystring("articleid") Set RSc=dbc.execute(SQLc) Do While NOT RSc.EOF SQL = "SELECT * FROM AuthorCategoryLink WHERE AuthorID = " & Session("frAuthorID") & " AND CategoryID = " & RSc("CategoryID") & " OR AuthorID = " & Session("frAuthorID") & " AND CategoryID = 99999" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic If NOT RS.EOF then CanEdit = "YES" Exit Do End If RSc.MoveNext Loop RS.Close Set RS=Nothing RSc.Close Set RSc=Nothing If CanEdit <> "YES" then response.redirect "news.asp?action=summary&type=notallowed" End If %> <% Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Edit Article

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Article


" SQL = "SELECT * FROM Articles WHERE ArticleID = " & request.querystring("articleid") Set RS=dbc.execute(SQL) response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" SQLc = "SELECT * FROM Categories ORDER BY CategoryName" Set RSc=Server.CreateObject("adodb.Recordset") RSc.Open SQLc, dbc, adopenstatic response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Article Title:
" response.write ""<% response.write "'>
" response.write "
" response.write "Article Summary:
" response.write "
" response.write "
" response.write "Article Body:
" response.write "Browser Type: " & BrowserType & "" If BrowserType = "Microsoft" then %> <% Else response.write "
" response.write "" End If response.write "
" response.write "
" response.write "Multi-Page Article:
" response.write "This is a Multi-Page Article
" response.write "
" response.write "Article Layout:
" response.write "" response.write "
" response.write "
" response.write "Article Date:
" response.write " " %> <% response.write "
" response.write "
" response.write "Article Author:
" response.write "" SQLa = "SELECT * FROM Authors WHERE AuthorID = " & RS("ArticleAuthor") Set RSa=dbc.execute(SQLa) ArticleAuthor = RSa("AuthorFirstName") & " " & RSa("AuthorLastName") RSa.Close Set RSa=Nothing response.write "Previous Author:" & ArticleAuthor & "
" response.write "" response.write "Current Author:" & Session("frFirstName") & " " & Session("frLastName") & "
" response.write "
" response.write "Article Source:
" response.write "
" response.write "
" response.write "Article Source Link:
" response.write "
" response.write "
" response.write "Article Status:
" response.write "Published" response.write "Un-Published Draft" response.write "Archived" response.write "User Submitted" response.write "Awaiting Approval
" response.write "
" response.write "Article Categories:
Hold CTRL to select multiple categories.

" response.write "" response.write "
" response.write "Article Image:
" response.write " " %> <% response.write "
" response.write "
" response.write "Article Start Date:
" response.write " " %> <% response.write "
" response.write "
" response.write "Article End Date:
" response.write " " %> <% response.write "
" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Edit Article Process ***************************************************** Sub EditArticleProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frRequireApproval") = "YES" then ArticleStatus = "AWAITING APPROVAL" Else ArticleStatus = request.form("txtArticleStatus") End If If request.form("txtArticleStartDate") = "" then txtArticleStartDate = FormatDateTime(cDate(request.form("txtArticleDate")),2) Else txtArticleStartDate = cDate(request.form("txtArticleStartDate")) End If If request.form("txtArticleEndDate") = "" then txtArticleEndDate = cDate("12/31/2010") Else txtArticleEndDate = cDate(request.form("txtArticleEndDate")) End If SQL="UPDATE Articles SET ArticleTitle = '"&FixString(request.form("txtArticleTitle"))&"', " SQL = SQL & "ArticleSummary = '"&FixString(request.form("txtArticleSummary"))&"', " SQL = SQL & "ArticleBody = '"&FixString(request.form("txtArticleBody"))&"', " SQL = SQL & "ArticleMultiPage = '"&request.form("txtArticleMultiPage")&"', " SQL = SQL & "ArticleLayout = '"&request.form("txtArticleLayoutType")&"', " SQL = SQL & "ArticleDate = '"&request.form("txtArticleDate")&"', " SQL = SQL & "ArticleStatus = '"&ArticleStatus&"', " SQL = SQL & "ArticleAuthor = '"&request.form("txtArticleAuthor")&"', " SQL = SQL & "ArticleSource = '"&FixString(request.form("txtArticleSource"))&"', " SQL = SQL & "ArticleSourceLink = '"&FixString(request.form("txtArticleSourceLink"))&"', " SQL = SQL & "ArticleImage = '"&request.form("txtArticleImage")&"' " SQL = SQL & ", ArticleStartDate = '"&txtArticleStartDate&"' " SQL = SQL & ", ArticleEndDate = '"&txtArticleEndDate&"' " SQL = SQL & "WHERE [ArticleID] ="&request.form("txtArticleID") response.write SQL dbc.Execute(SQL) SQL = "DELETE FROM ArticleCategoryLink WHERE ArticleID IN("& request.form("txtArticleID") &")" response.write SQL dbc.Execute(SQL) Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM ArticleCategoryLink", dbc, adOpenDynamic, adLockPessimistic, adCMDText Dim Arr Arr = Split(CStr(Request.Form("txtArticleCategories")),",") For x = 0 to UBound(Arr) RS.AddNew RS("ArticleID") = request.form("txtArticleID") RS("CategoryID") = Trim(Arr(x)) Next RS.Update RS.Close Set RS=Nothing response.redirect "news.asp?action=summary&type=editarticlesuccess" End Sub '******* Delete Article Screen **************************************************** Sub DeleteArticle If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Delete Article

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Article


" SQL = "SELECT * FROM Articles WHERE ArticleID = " & request.querystring("articleid") Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic response.write "

" response.write "Are you sure you want to delete this Article?

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" & RS("ArticleTitle") & "
" & RS("ArticleSummary") & "


" response.write "YES | NO
" response.write "

" RS.Close Set RS = Nothing End Sub '******* Delete Article Process **************************************************** Sub DeleteArticleProcess SQL = "DELETE FROM ArticleCategoryLink WHERE ArticleID IN("& request.querystring("articleid") &")" dbc.Execute(SQL) SQL = "DELETE FROM Articles WHERE ArticleID IN("& request.querystring("articleid") &")" dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=deletearticlesuccess" End Sub '******* Manage Layout Types ****************************************************** Sub ManageLayoutTypes If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM LayoutTypes ORDER BY LTName" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.MoveFirst '-------- Paging ---------------------------------------------- If request.querystring("Page") = "" Then Page = 1 RS.Move First Else Page = Request.QueryString("Page") If Page = 1 then RS.Move First Else RS.Move CInt((Page * RecordsPerPage) - RecordsPerPage) End If End If n = 0 RS.PageSize = RecordsPerPage '----------------------------------------------------------------- Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Tasks: Add An New Layout Type

" response.write "

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" UseBackColor = BackColorOne Do until RS.EOF If n = RecordsPerPage then exit do End If response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" RS.MoveNext If UseBackColor = BackColorOne then UseBackColor = BackColorTwo Else UseBackColor = BackColorOne End If n=n+1 Loop response.write "
  Name / DescriptionPreview
      " & RS("LTName") & "
" & RS("LTDescription") & "
" '------- Page Navigation ---------------------------------- response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
 " response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" If Page <> 1 then response.write "" response.write "<< Prev" End If If Page <> 1 then response.write " " end If For intCount = 1 to RS.PageCount If IntCount = 1 then response.write " | " End If If cint(intCount) = cint(Page) then response.write "" & intCount & " | " Else response.write "" & intCount & " | " End If Next If cint(page) <> cint(RS.PageCount) then response.write "" response.write " Next >>" End If If cint(Page) = cint(RS.PageCount) then response.write "" End If response.write "
" response.write "
" '------------------------------------------------------------- End Sub '******* Add Layout Type Screen *************************************************** Sub AddLayoutType If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Add A New Layout Type

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add A New Layout Type


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Layout Type Name:
" response.write "
" response.write "
" response.write "Layout Type Description:
" response.write "
" response.write "
" response.write "Number of Articles to Show:
This is the total number of articles you want to show on the main and category news screens.

" response.write "
" response.write "
" response.write "Number of Days to Show:
This is the total number of days to show on the main / category news screens if you are using a grouped by day format.

" response.write "
" response.write "
" response.write "Number of Features to Show:
Features are the most recent articles... they will have an image next to the on the main / category news listing areas.

" response.write "
" response.write "
" response.write "How many columns should should be used to display Features:
" response.write "
" response.write "
" response.write "How many columns should should be used to display Regular news items:
" response.write "
" response.write "
" response.write "Link To Full Article Text:
If you enter something here it will appear under each article summary with a link to the full article:

" response.write "
" response.write "
" response.write "Would you like to display the last updated date:
" response.write "YES" response.write "NO
" response.write "
" response.write "If you do want to show the last updated date what color would you like the background of the cell to be:
" response.write "
" response.write "
" response.write "Would you like to show a category summary on the main page:
" response.write "YES" response.write "NO
" response.write "
" response.write "If you said YES to the previous item, how many columns should it have:
" response.write "
" response.write "
" response.write "Enter the amount of cell padding that should be between articles:
" response.write "
" response.write "
" response.write "Would you like to show a information about the author under the title on the main / category pages:
" response.write "YES" response.write "NO
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Enter a heading to go above the Feature Articles:
If you enter nothing there will be no heading... You can enter HTML Here

" response.write "
" response.write "
" response.write "Enter a heading to go above the Recent Articles:
If you enter nothing there will be no heading... You can enter HTML Here

" response.write "
" response.write "
" response.write "Enter a heading to go above the Category Summary:
If you enter nothing there will be no heading... You can enter HTML Here

" response.write "
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Custom Page Header:
" response.write "
" response.write "
" response.write "Custom Page Footer:
" response.write "
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Would you like to group your news into day blocks:
" response.write "YES" response.write "NO
" response.write "
" response.write "Enter an HTML Header for the date block if you are grouping articles by day:
The date will be inserted between the Header and Footer.

" response.write "
" response.write "
" response.write "Enter an HTML Footer for the date block if you are grouping articles by day:
The date will be inserted between the Header and Footer.

" response.write "
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Would you like to show a headline box on your pages:
" response.write "YES" response.write "NO
" response.write "
" response.write "Would you like to headline box on the left or right side:
" response.write "LEFT" response.write "RIGHT
" response.write "
" response.write "Enter the HTML Header for your Headline Box:
" response.write "
" response.write "
" response.write "Enter the HTML Footer for your Headline Box:
" response.write "
" response.write "
" response.write "Layout Type Preview:
You can upload a preview image of this layout type for easier reference.

" response.write " " %> <% response.write "
" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Add Layout Type Process ************************************************** Sub AddLayoutTypeProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM LayoutTypes", dbc, adOpenDynamic, adLockPessimistic, adCMDText RS.AddNew RS("LTName")=request.form("txtLTName") RS("LTDescription")=request.form("txtLTDescription") RS("LTNumberToShow")=request.form("txtLTNumberToShow") RS("LTNumberOfFeatures")=request.form("txtLTNumberOfFeatures") RS("LTShowCategorySection")=request.form("txtLTShowCategorySection") RS("LTShowNormalHLBox")=request.form("txtLTShowNormalHLBox") RS("LTDateBlockHeader")=request.form("txtLTDateBlockHeader") RS("LTDateBlockFooter")=request.form("txtLTDateBlockFooter") RS("LTLinkToDetailText")=request.form("txtLTLinkToDetailText") RS("LTHLLocation")=request.form("txtLTHLLocation") RS("LTFeaturesAcross")=request.form("txtLTFeaturesAcross") RS("LTShowLastUpdate")=request.form("txtLTShowLastUpdate") RS("LTUpdateBGColor")=request.form("txtLTUpdateBGColor") RS("LTTopNewsHeading")=request.form("txtLTTopNewsHeading") RS("LTRecentNewsHeading")=request.form("txtLTRecentNewsHeading") RS("LTCategoryNewsHeading")=request.form("txtLTCategoryNewsHeading") RS("LTArticlesAcross")=request.form("txtLTArticlesAcross") If request.form("txtLTCategoriesAcross") <> "" then RS("LTCategoriesAcross")=request.form("txtLTCategoriesAcross") End If RS("LTGroupByDay")=request.form("txtLTGroupByDay") RS("LTDaysToShow")=request.form("txtLTDaysToShow") RS("LTArticlePadding")=request.form("txtLTArticlePadding") RS("LTShowMoreInfo")=request.form("txtLTShowMoreInfo") RS("LTPreview")=request.form("txtLTPreview") RS("LTHLBoxHeader")=request.form("txtLTHLBoxHeader") RS("LTHLBoxFooter")=request.form("txtLTHLBoxFooter") RS("LTHeader")=request.form("txtLTHeader") RS("LTFooter")=request.form("txtLTFooter") RS.Update RS.Close Set RS=Nothing response.redirect "news.asp?action=summary&type=addlayouttypesuccess" End Sub '******* Edit Layout Type ********************************************************* Sub EditLayoutType If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM LayoutTypes WHERE LTID = " & request.querystring("ltid") Set RS=dbc.execute(SQL) Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Edit Layout Type

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Layout Type


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Layout Type Name:
" response.write "
" response.write "
" response.write "Layout Type Description:
" response.write "
" response.write "
" response.write "Number of Articles to Show:
This is the total number of articles you want to show on the main and category news screens.

" response.write "
" response.write "
" response.write "Number of Days to Show:
This is the total number of days to show on the main / category news screens if you are using a grouped by day format.

" response.write "
" response.write "
" response.write "Number of Features to Show:
Features are the most recent articles... they will have an image next to the on the main / category news listing areas.

" response.write "
" response.write "
" response.write "How many columns should should be used to display Features:
" response.write "
" response.write "
" response.write "How many columns should should be used to display Regular news items:
" response.write "
" response.write "
" response.write "Link To Full Article Text:
If you enter something here it will appear under each article summary with a link to the full article:

" response.write "
" response.write "
" response.write "Would you like to display the last updated date:
" response.write "YES" response.write "NO
" response.write "
" response.write "If you do want to show the last updated date what color would you like the background of the cell to be:
" response.write "
" response.write "
" response.write "Would you like to show a category summary on the main page:
" response.write "YES" response.write "NO
" response.write "
" response.write "If you said YES to the previous item, how many columns should it have:
" response.write "
" response.write "
" response.write "Enter the amount of cell padding that should be between articles:
" response.write "
" response.write "
" response.write "Would you like to show a information about the author under the title on the main / category pages:
" response.write "YES" response.write "NO
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Enter a heading to go above the Feature Articles:
If you enter nothing there will be no heading... You can enter HTML Here

" response.write "
" response.write "
" response.write "Enter a heading to go above the Recent Articles:
If you enter nothing there will be no heading... You can enter HTML Here

" response.write "
" response.write "
" response.write "Enter a heading to go above the Category Summary:
If you enter nothing there will be no heading... You can enter HTML Here

" response.write "
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Custom Page Header:
" response.write "
" response.write "
" response.write "Custom Page Footer:
" response.write "
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Would you like to group your news into day blocks:
" response.write "YES" response.write "NO
" response.write "
" response.write "Enter an HTML Header for the date block if you are grouping articles by day:
The date will be inserted between the Header and Footer.

" response.write "
" response.write "
" response.write "Enter an HTML Footer for the date block if you are grouping articles by day:
The date will be inserted between the Header and Footer.

" response.write "
" response.write "
" response.write " 
" response.write "" response.write "
" response.write "Would you like to show a headline box on your pages:
" response.write "YES" response.write "NO
" response.write "
" response.write "Would you like to headline box on the left or right side:
" response.write "LEFT" response.write "RIGHT
" response.write "
" response.write "Enter the HTML Header for your Headline Box:
" response.write "
" response.write "
" response.write "Enter the HTML Footer for your Headline Box:
" response.write "
" response.write "
" response.write "Layout Type Preview:
You can upload a preview image of this layout type for easier reference.

" response.write " " %> <% response.write "
" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Edit Layout Type Process ************************************************* Sub EditLayoutTypeProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL="UPDATE LayoutTypes SET LTName = '"&FixString(request.form("txtLTName"))&"', " SQL = SQL & "LTDescription = '"&FixString(request.form("txtLTDescription"))&"', " SQL = SQL & "LTNumberToShow = '"&request.form("txtLTNumberToShow")&"', " SQL = SQL & "LTNumberOfFeatures = '"&request.form("txtLTNumberOfFeatures")&"', " SQL = SQL & "LTShowCategorySection = '"&request.form("txtLTShowCategorySection")&"', " SQL = SQL & "LTShowNormalHLBox = '"&request.form("txtLTShowNormalHLBox")&"', " SQL = SQL & "LTDateBlockHeader = '"&FixString(request.form("txtLTDateBlockHeader"))&"', " SQL = SQL & "LTDateBlockFooter = '"&FixString(request.form("txtLTDateBlockFooter"))&"', " SQL = SQL & "LTLinkToDetailText = '"&FixString(request.form("txtLTLinkToDetailText"))&"', " SQL = SQL & "LTHLLocation = '"&request.form("txtLTHLLocation")&"', " SQL = SQL & "LTFeaturesAcross = '"&request.form("txtLTFeaturesAcross")&"', " SQL = SQL & "LTShowLastUpdate = '"&request.form("txtLTShowLastUpdate")&"', " SQL = SQL & "LTUpdateBGColor = '"&FixString(request.form("txtLTUpdateBGColor"))&"', " SQL = SQL & "LTTopNewsHeading = '"&FixString(request.form("txtLTTopNewsHeading"))&"', " SQL = SQL & "LTRecentNewsHeading = '"&FixString(request.form("txtLTRecentNewsHeading"))&"', " SQL = SQL & "LTCategoryNewsHeading = '"&FixString(request.form("txtLTCategoryNewsHeading"))&"', " SQL = SQL & "LTArticlesAcross = '"&request.form("txtLTArticlesAcross")&"', " SQL = SQL & "LTCategoriesAcross = '"&request.form("txtLTCategoriesAcross")&"', " SQL = SQL & "LTGroupByDay = '"&request.form("txtLTGroupByDay")&"', " SQL = SQL & "LTDaysToShow = '"&request.form("txtLTDaysToShow")&"', " SQL = SQL & "LTArticlePadding = '"&request.form("txtLTArticlePadding")&"', " SQL = SQL & "LTShowMoreInfo = '"&request.form("txtLTShowMoreInfo")&"', " SQL = SQL & "LTPreview = '"&FixString(request.form("txtLTPreview"))&"', " SQL = SQL & "LTHLBoxHeader = '"&FixString(request.form("txtLTHLBoxHeader"))&"', " SQL = SQL & "LTHeader = '"&FixString(request.form("txtLTHeader"))&"', " SQL = SQL & "LTFooter = '"&FixString(request.form("txtLTFooter"))&"', " SQL = SQL & "LTHLBoxFooter = '"&FixString(request.form("txtLTHLBoxFooter"))&"' " SQL = SQL & "WHERE [LTID] ="&request.form("txtLTID") dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=editlayouttypesuccess" End Sub '******* Delete Layout Type Screen ************************************************ Sub DeleteLayoutType If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Delete Layout Type

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Layout Type


" SQL = "SELECT * FROM LayoutTypes WHERE LTID = " & request.querystring("ltid") Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic response.write "

" response.write "Are you sure you want to delete this Layout Type?
Note: Doing so will reset any category using this layout type back to the default layout type.
If this is currently your default layout type it will be changed back to the first layout type.

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" & RS("LTName") & "
" & RS("LTDescription") & "


" response.write "YES | NO
" response.write "

" RS.Close Set RS = Nothing End Sub '******* Delete Layout Type Process *********************************************** Sub DeleteLayoutTypeProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM Categories WHERE CategoryLayoutType = " & request.querystring("ltid"), dbc, adOpenDynamic, adLockPessimistic, adCMDText Do While NOT RS.EOF SQLc="UPDATE Categories SET CategoryLayoutType = 1 WHERE [CategoryID] = " & RS("CategoryID") dbc.Execute(SQLc) RS.MoveNext RSc.Close Set RSc=Nothing Loop RS.Close Set RS=Nothing SQL = "DELETE FROM LayoutTypes WHERE LTID IN("& request.querystring("ltid") &")" dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=deletelayouttypesuccess" End Sub '******* Edit Configuration Screen ************************************************ Sub EditConfig If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM Config" Set RS=dbc.execute(SQL) Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Edit Configuration
Tasks: Syndication HTML

" response.write "

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Configuration


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Default Layout Type:
" response.write "
" response.write "Default Article Layout:
" response.write "" response.write "
" response.write "
" response.write "Default Font Face:
" response.write "
" response.write "
" response.write "Default Font Title Size:
" response.write "
" response.write "
" response.write "Default Font Body Size:
" response.write "
" response.write "
" response.write "Default Font Color:
" response.write "
" response.write "
" response.write "Email Component:
" response.write "" response.write "
" response.write "Email The Administrators Email Address:
" response.write "
" response.write "
" response.write "Email Site Name:
" response.write "
" response.write "
" response.write "Email Site URL:
" response.write "
" response.write "
" response.write "Email Host (Required for some mail components):
" response.write "
" response.write "
" response.write "Text to append to Syndication Feed:
" response.write "
" response.write "
" response.write "Admin Records Per Page:
" response.write "
" response.write "
" response.write "Admin Color Scheme:
" response.write "
" response.write "
" response.write "Admin Back Color 1:
" response.write "
" response.write "
" response.write "Admin Back Color 2:
" response.write "
" response.write "
" response.write "Which links would you like to show at the bottom of the public areas:
" response.write "" response.write " Home " response.write " Search " response.write " Archives " response.write " Submit News " response.write " Email Admin " response.write " Login " response.write " Syndication Link " response.write "" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Edit Config Process ****************************************************** Sub EditConfigProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL="UPDATE Config SET DefaultLayoutType = '"&request.form("txtDefaultLayoutType")&"', " SQL = SQL & "DefaultArticleLayout = '"&request.form("txtDefaultArticleLayout")&"', " SQL = SQL & "DefaultFontFace = '"&FixString(request.form("txtDefaultFontFace"))&"', " SQL = SQL & "DefaultFontTitleSize = '"&FixString(request.form("txtDefaultFontTitleSize"))&"', " SQL = SQL & "DefaultFontBodySize = '"&FixString(request.form("txtDefaultFontBodySize"))&"', " SQL = SQL & "DefaultFontColor = '"&FixString(request.form("txtDefaultFontColor"))&"', " SQL = SQL & "EmailComponent = '"&FixString(request.form("txtEmailComponent"))&"', " SQL = SQL & "EmailSiteName = '"&FixString(request.form("txtEmailSiteName"))&"', " SQL = SQL & "AdminEmail = '"&FixString(request.form("txtAdminEmail"))&"', " SQL = SQL & "EmailSiteURL = '"&FixString(request.form("txtEmailSiteURL"))&"', " SQL = SQL & "EmailHost = '"&FixString(request.form("txtEmailHost"))&"', " SQL = SQL & "SyndicationText = '"&FixString(request.form("txtSyndicationText"))&"', " SQL = SQL & "AdminRecordsPerPage = '"&request.form("txtAdminRecordsPerPage")&"', " SQL = SQL & "AdminColor = '"&FixString(request.form("txtAdminColor"))&"', " SQL = SQL & "AdminBackColorOne = '"&FixString(request.form("txtAdminBackColorOne"))&"', " SQL = SQL & "BBShowSearch = '"&request.form("txtBBShowSearch")&"', " SQL = SQL & "BBShowArchives = '"&request.form("txtBBShowArchives")&"', " SQL = SQL & "BBShowSubmit = '"&request.form("txtBBShowSubmit")&"', " SQL = SQL & "BBShowEmailAdmin = '"&request.form("txtBBShowEmailAdmin")&"', " SQL = SQL & "BBShowLogin = '"&request.form("txtBBShowLogin")&"', " SQL = SQL & "BBShowHome = '"&request.form("txtBBShowHome")&"', " SQL = SQL & "BBShowSyndication = '"&request.form("txtBBShowSyndication")&"', " SQL = SQL & "AdminBackColorTwo = '"&FixString(request.form("txtAdminBackColorTwo"))&"' " SQL = SQL & " WHERE [ConfigID] ="&request.form("txtConfigID") dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=editconfigsuccess" End Sub '******* Manage Article Layouts Screen ******************************************** Sub ManageArticleLayouts If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM ArticleLayouts ORDER BY ALName" Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic RS.MoveFirst '-------- Paging ---------------------------------------------- If request.querystring("Page") = "" Then Page = 1 RS.Move First Else Page = Request.QueryString("Page") If Page = 1 then RS.Move First Else RS.Move CInt((Page * RecordsPerPage) - RecordsPerPage) End If End If n = 0 RS.PageSize = RecordsPerPage '----------------------------------------------------------------- Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Article Layouts
Tasks: Add A New Article Layout

" response.write "

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" UseBackColor = BackColorOne Do until RS.EOF If n = RecordsPerPage then exit do End If response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" RS.MoveNext If UseBackColor = BackColorOne then UseBackColor = BackColorTwo Else UseBackColor = BackColorOne End If n=n+1 Loop response.write "
  Name / DescriptionPreview
      " & RS("ALName") & "
" & RS("ALDescription") & "
" '------- Page Navigation ---------------------------------- response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
 " response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" If Page <> 1 then response.write "" response.write "<< Prev" End If If Page <> 1 then response.write " " end If For intCount = 1 to RS.PageCount If IntCount = 1 then response.write " | " End If If cint(intCount) = cint(Page) then response.write "" & intCount & " | " Else response.write "" & intCount & " | " End If Next If cint(page) <> cint(RS.PageCount) then response.write "" response.write " Next >>" End If If cint(Page) = cint(RS.PageCount) then response.write "" End If response.write "
" response.write "
" '------------------------------------------------------------- End Sub '******* Add Article Layout Screen ************************************************ Sub AddArticleLayout If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Add A New Article Layout

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add A New Article Layout


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Article Layout Name:
" response.write "
" response.write "
" response.write "Article Layout Description:
" response.write "
" response.write "
" response.write "Show Headline:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Author:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Source:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Date / Time:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Article Image:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Summary:
" response.write "YES" response.write "NO
" response.write "
" response.write "Summary Font Size:
" response.write "
" response.write "
" response.write "Show Email Link:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Print Button:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Related Articles:
" response.write "YES" response.write "NO
" response.write "
" response.write "Related Articles Header:
" response.write "" response.write "
" response.write "
" response.write "Show Line Under Info:
" response.write "YES" response.write "NO
" response.write "
" response.write "Article Layout Preview:
You can upload a preview image of this article layout for easier reference.

" response.write " " %> <% response.write "
" 'response.write "Upload An Image" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Add Article Layout Process *********************************************** Sub AddArticleLayoutProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM ArticleLayouts", dbc, adOpenDynamic, adLockPessimistic, adCMDText RS.AddNew RS("ALName")=request.form("txtALName") RS("ALDescription")=request.form("txtALDescription") RS("ALShowHeadline")=request.form("txtALShowHeadline") RS("ALShowAuthor")=request.form("txtALShowAuthor") RS("ALShowSource")=request.form("txtALShowSource") RS("ALShowDateTime")=request.form("txtALShowDateTime") RS("ALShowSummary")=request.form("txtALShowSummary") RS("ALSummaryFontSize")=request.form("txtALSummaryFontSize") RS("ALShowArticleImage")=request.form("txtALShowArticleImage") RS("ALShowEmailLink")=request.form("txtALShowEmailLink") RS("ALShowPrintButton")=request.form("txtALShowPrintButton") RS("ALShowRelatedArticles")=request.form("txtALShowRelatedArticles") RS("ALShowLine")=request.form("txtALShowLine") RS("ALPreview")=request.form("txtALPreview") RS("ALRAHeader")=request.form("txtALRAHeader") RS.Update RS.Close Set RS=Nothing response.redirect "news.asp?action=summary&type=addarticlelayoutsuccess" End Sub '******* Edit Article Layout ****************************************************** Sub EditArticleLayout If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL = "SELECT * FROM ArticleLayouts WHERE ALID = " & request.querystring("alid") Set RS=dbc.execute(SQL) Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Article Layouts
Edit Article Layout

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Article Layout


" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "Article Layout Name:
" response.write "
" response.write "
" response.write "Article Layout Description:
" response.write "
" response.write "
" response.write "Show Headline:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Author:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Source:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Date / Time:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Article Image:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Summary:
" response.write "YES" response.write "NO
" response.write "
" response.write "Summary Font Size:
" response.write "
" response.write "
" response.write "Show Email Link:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Print Button:
" response.write "YES" response.write "NO
" response.write "
" response.write "Show Related Articles:
" response.write "YES" response.write "NO
" response.write "
" response.write "Related Articles Header:
" response.write "" response.write "
" response.write "
" response.write "Show Line Under Info:
" response.write "YES" response.write "NO
" response.write "
" response.write "Article Layout Preview:
You can upload a preview image of this article layout for easier reference.

" response.write " " %> <% response.write "
" response.write "
" response.write " 
" response.write "
" response.write "
" response.write "
" End Sub '******* Edit Article Layout Process ********************************************** Sub EditArticleLayoutProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If SQL="UPDATE ArticleLayouts SET ALName = '"&FixString(request.form("txtALName"))&"', " SQL = SQL & "ALDescription = '"&FixString(request.form("txtALDescription"))&"', " SQL = SQL & "ALShowHeadline = '"&request.form("txtALShowHeadline")&"', " SQL = SQL & "ALShowAuthor = '"&request.form("txtALShowAuthor")&"', " SQL = SQL & "ALShowSource = '"&request.form("txtALShowSource")&"', " SQL = SQL & "ALShowDateTime = '"&request.form("txtALShowDateTime")&"', " SQL = SQL & "ALShowSummary = '"&request.form("txtALShowSummary")&"', " SQL = SQL & "ALSummaryFontSize = '"&FixString(request.form("txtALSummaryFontSize"))&"', " SQL = SQL & "ALShowArticleImage = '"&request.form("txtALShowArticleImage")&"', " SQL = SQL & "ALShowEmailLink = '"&request.form("txtALShowEmailLink")&"', " SQL = SQL & "ALShowPrintButton = '"&request.form("txtALShowPrintButton")&"', " SQL = SQL & "ALShowRelatedArticles = '"&request.form("txtALShowRelatedArticles")&"', " SQL = SQL & "ALRAHeader = '"&FixString(request.form("txtALRAHeader"))&"', " SQL = SQL & "ALShowLine = '"&request.form("txtALShowLine")&"', " SQL = SQL & "ALPreview = '"&FixString(request.form("txtALPreview"))&"' " SQL = SQL & "WHERE [ALID] ="&request.form("txtALID") dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=editarticlelayoutsuccess" End Sub '******* Delete Article Layout **************************************************** Sub DeleteArticleLayout If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles Layouts
Delete Article Layout

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Article Layout


" SQL = "SELECT * FROM ArticleLayouts WHERE ALID = " & request.querystring("alid") Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic response.write "

" response.write "Are you sure you want to delete this Article Layout?
Note: Doing so will reset any category using this article layout back to the default article layout.
If this is currently your default article layout it will be changed back to the first article layout.

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" & RS("ALName") & "
" & RS("ALDescription") & "


" response.write "YES | NO
" response.write "

" RS.Close Set RS = Nothing End Sub '******* Delete Article Layout Process ******************************************** Sub DeleteArticleLayoutProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Set RS=Server.CreateObject("ADODB.RecordSet") RS.Open "SELECT * FROM Categories WHERE CategoryArticleLayout = " & request.querystring("alid"), dbc, adOpenDynamic, adLockPessimistic, adCMDText Do While NOT RS.EOF SQLc="UPDATE Categories SET CategoryArticleLayout = '1' WHERE [CategoryID] = " & RS("CategoryID") dbc.Execute(SQLc) RS.MoveNext RSc.Close Set RSc=Nothing Loop RS.Close Set RS=Nothing SQL = "DELETE FROM ArticleLayouts WHERE ALID IN("& request.querystring("alid") &")" dbc.Execute(SQL) response.redirect "news.asp?action=summary&type=deletearticlelayoutsuccess" End Sub '******* Archive Articles Screen ************************************************** Sub ArchiveArticles If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Archive Articles

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Archive Articles


" response.write "

" response.write "Select a date that should be used to archive the articles... anything older than the date you select will be archived.

" response.write "

" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write " " %> <% response.write "

" response.write "

" response.write "" response.write "
" response.write "

" End Sub '******* Archive Articles Process ************************************************* Sub ArchiveArticlesProcess If Session("frUserName") = "" then response.redirect "news.asp?action=login&err=notlogged" End If If Session("frLevel") <> 1 then response.redirect "news.asp?action=mainmenu" End If ArchiveDate = CDate(request.form("txtArchiveDate")) If UseSQLServer <> "YES" then SQL = "SELECT * FROM Articles WHERE ArticleDate < #" & ArchiveDate & "#" Else SQL = "SELECT * FROM Articles WHERE ArticleDate < '" & ArchiveDate & "'" End If Set RS=Server.CreateObject("adodb.Recordset") RS.Open SQL, dbc, adopenstatic NumberArchived = RS.RecordCount RS.Close Set RS=Nothing If UseSQLServer <> "YES" then SQL = "UPDATE Articles SET ArticleStatus = 'ARCHIVED' WHERE ArticleDate < #" & ArchiveDate & "#" Else SQL = "UPDATE Articles SET ArticleStatus = 'ARCHIVED' WHERE ArticleDate < '" & ArchiveDate & "'" End If Set RS=dbc.execute(SQL) Call DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Archive Articles

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Archive Articles


" response.write "

" response.write "You have successfuly archived " & NumberArchived & " articles.

" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "

" response.write "OK
" response.write "

" End Sub '******* Draw Send Email Screen *************************************************** Sub EmailToFriend response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Email Article


" response.write "

" response.write "

" response.write "" response.write "Send TO Email Address:
" response.write "
" response.write "Send FROM Email Address:
" response.write "
" response.write "Comments:
" response.write "

" response.write "" response.write "" response.write "

" End Sub '******* Send the Email *********************************************************** Sub SendEmail SQL = "SELECT * FROM Articles WHERE ArticleID = " & request.querystring("article") Set RS=dbc.execute(SQL) '------ Fill the Variables -------------------------- txtSendTo = request.form("txtSendTo") txtSendFrom = request.form("txtSendFrom") txtComments = request.form("txtComments") txtSubject = RS("ArticleTitle") txtBody = "This " & EmailSiteName & "(" & EmailSiteURL & ") article has been sent to your from:
" txtBody = txtBody & "" & txtSendFrom & "

Senders Comments:
" & txtComments & "
" txtBody = txtBody & "-------------------------------------------------------------------------
" txtBody = txtBody & "
" txtBody = txtBody & "" & RS("ArticleTitle") & "
" & RS("ArticleDate") & "
" txtBody = txtBody & RS("ArticleBody") '----------------------------------------------------- %> <% If EmailComponent = "CDONTS" then Set sMail = Server.CreateObject("CDONTS.NewMail") sMail.BodyFormat = 0 sMail.MailFormat = 0 sMail.From = txtSendFrom sMail.To = txtSendTo sMail.Subject = txtSubject sMail.Body = txtBody sMail.Send( ) response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Email Article


" response.write "The article was successfully sent to: " & txtSendTo response.write "

onclick="closewin(); return false" <% response.write ">Click HERE to close this window." End If If EmailComponent = "ASPEmail" then Set sMail = Server.CreateObject("Persits.MailSender") sMail.Host = EmailHost sMail.From = txtSendFrom sMail.FromName = txtSendFrom sMail.ReplyTo = txtSendFrom sMail.AddAddress = txtSendTo 'This needs to be changed to handle multiples!!! sMail.Subject = txtSubject sMail.Body = txtBody sMail.Send response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Email Article


" response.write "The article was successfully sent to: " & txtSendTo response.write "

onclick="closewin(); return false" <% response.write ">Click HERE to close this window." End If If EmailComponent = "JMail" then Set sMail = Server.CreateObject("JMail.Message") sMail.Logging = true sMail.silent = true sMail.From = txtSendFrom sMail.FromName = txtSendFrom sMail.AddRecipient = txtSendTo 'This needs to be changed to handle multiples!!! sMail.Subject = txtSubject sMail.Body = txtBody sMail.Send(EmailHost) response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Email Article


" response.write "The article was successfully sent to: " & txtSendTo response.write "

onclick="closewin(); return false" <% response.write ">Click HERE to close this window." End If If EmailComponent = "ASPMail" then Set sMail = Server.CreateObject("SMTPsvg.Mailer") sMail.RemoteHost = EmailHost sMail.FromAddress = txtSendFrom sMail.FromName = txtSendFrom sMail.AddRecipient = txtSendTo 'This needs to be changed to handle multiples!!! sMail.Subject = txtSubject sMail.BodyText = txtBody sMail.SendMail response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Email Article


" response.write "The article was successfully sent to: " & txtSendTo response.write "

onclick="closewin(); return false" <% response.write ">Click HERE to close this window." End If End Sub '******* Draw Button Bar ********************************************************** Sub DrawButtonBar response.write "" response.write "
" If BBShowHome = "YES" then response.write "Home" End If If BBShowSearch = "YES" then response.write "| Search" End If If BBShowArchives = "YES" then response.write "| News Archives" End If If BBShowSubmit = "YES" then response.write "| Submit News" End If If BBShowEmailAdmin = "YES" then response.write "| Email Administrator" End If If BBShowLogin = "YES" then response.write "| Login" End If If BBShowSyndication = "YES" then response.write "| Get Syndicated Content" End If response.write "
" End Sub '******* Draw Summary Screen ****************************************************** Sub Summary 'If Session("frUserName") = "" then ' response.redirect "news.asp?action=login&err=notlogged" 'End If If request.querystring("type") <> "submitarticlesuccess" then response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Welcome: " & Session("frFirstName") & " " & Session("frLastName") & " | Rights: " & Session("frRights") & " | Log Off
" End If If request.querystring("type") = "submitarticlesuccess" then response.write "

" response.write "Thank you for your submission... Your article will be reviewed by our administrators.

" response.write "Click Here
" response.write "

" End If If request.querystring("type") = "addauthorsuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Authors
Add Author

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add Author


" response.write "

" response.write "The Author was added successfully.

" response.write "Add Another Author | Back To Manage Authors | Main Menu
" response.write "

" End If If request.querystring("type") = "editauthorsuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Authors
Edit Author

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Author


" response.write "

" response.write "The Author was edited successfully.

" response.write "Back To Manage Authors | Main Menu
" response.write "

" End If If request.querystring("type") = "deleteauthorsuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Authors
Delete Author

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Author


" response.write "

" response.write "The Author was deleted successfully.

" response.write "Back to Manage Authors | Main Menu
" response.write "

" End If If request.querystring("type") = "addcategorysuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Categories
Add Category

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add Category


" response.write "

" response.write "The Category was added successfully.

" response.write "Add Another Category | Back To Manage Categories | Main Menu
" response.write "

" End If If request.querystring("type") = "editcategorysuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Categories
Edit Categories

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Categories


" response.write "

" response.write "The Category was edited successfully.

" response.write "Back To Manage Categories | Main Menu
" response.write "

" End If If request.querystring("type") = "deletecategorysuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Categories
Delete Category

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Category


" response.write "

" response.write "The Category was deleted successfully.

" response.write "Back to Manage Categories | Main Menu
" response.write "

" End If If request.querystring("type") = "addarticlesuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Add Article

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add Article


" response.write "

" response.write "The Article was added successfully." If Session("frRequireApproval") = "YES" then response.write "Your Article will appear on the website after it is approved by an administrator" End If response.write "

" response.write "Add Another Article | Back To Manage Articles | Main Menu
" response.write "

" End If If request.querystring("type") = "editarticlesuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Edit Article

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Article


" response.write "

" response.write "The Article was modified successfully." If Session("frRequireApproval") = "YES" then response.write "Your Article will appear on the website after it is approved by an administrator" End If response.write "

" response.write "Back To Manage Articles | Main Menu
" response.write "

" End If If request.querystring("type") = "notallowed" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Edit Article

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Article


" response.write "

" response.write "You don't have access to perform this function.

" response.write "Back To Manage Articles | Main Menu
" response.write "

" End If If request.querystring("type") = "deletearticlesuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Articles
Delete Article

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Article


" response.write "

" response.write "The Article was deleted successfully.

" response.write "Back To Manage Articles | Main Menu
" response.write "

" End If If request.querystring("type") = "addlayouttypesuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Add A New Layout Type

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add A New Layout Type


" response.write "

" response.write "The Layout Type was added successfully.

" response.write "Add Another Layout Type | Back To Manage Layout Types | Main Menu
" response.write "

" End If If request.querystring("type") = "editlayouttypesuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Edit Layout Type

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Layout Type


" response.write "

" response.write "The Layout Type was edited successfully.

" response.write "Back To Manage Layout Types | Main Menu
" response.write "

" End If If request.querystring("type") = "deletelayouttypesuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Layout Types
Delete Layout Type

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Layout Type


" response.write "

" response.write "The Layout Type was deleted successfully.

" response.write "Back To Manage Layout Types | Main Menu
" response.write "

" End If If request.querystring("type") = "editconfigsuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Edit Configuration

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Configuration


" response.write "

" response.write "The Configuration was edited successfully.

" response.write "Main Menu
" response.write "

" End If If request.querystring("type") = "addarticlelayoutsuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Article Layouts
Add A New Article Layout

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Add A New Article Layout


" response.write "

" response.write "The Article Layout was added successfully.

" response.write "Add Another Article Layout | Back To Manage Article Layouts | Main Menu
" response.write "

" End If If request.querystring("type") = "editarticlelayoutsuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Article Layouts
Edit Article Layout

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Edit Article Layout


" response.write "

" response.write "The Article Layout was updated successfully.

" response.write "Back To Manage Article Layouts | Main Menu
" response.write "

" End If If request.querystring("type") = "deletearticlelayoutsuccess" then response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Navigation: Main Menu
Manage Article Layouts
Delete Article Layout

" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Delete Article Layout


" response.write "

" response.write "The Article Layout was deleted successfully.

" response.write "Back To Manage Article Layouts | Main Menu
" response.write "

" End If End Sub '******* Draw Welcome Bar ******************************************************** Sub DrawWelcomeBar response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Welcome: " & Session("frFirstName") & " " & Session("frLastName") & " | Rights: " & Session("frRights") & " | Log Off
" End Sub '******* Format Date Function ***************************************************** Function FormatDate(sDate, sFormat) Dim NewDate, timeReturnAMPM, timeValue timeValue = FormatDateTime(sDate, 3) If sFormat = "FULL" then NewDate = MonthName(Month(sDate)) & " " & Day(sDate) & ", " & Year(sDate) timeReturnAMPM = right(timeValue, 2) If Len(timeValue) = 10 then timeValue = left(timeValue,4) timeValue = timeValue + timeReturnAMPM Else timeValue = left(timeValue,5) timeValue = timeValue + timeReturnAMPM End If NewDate = NewDate & " " & timeValue FormatDate = NewDate & " " & TimeZone End If End Function '****** Upload A File ****************************************************************** Sub UploadFile formname = request.querystring("form") elementname = request.querystring("element") %> <% response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Upload A File


" response.write "

" response.write "

" response.write "Select a file to upload:
" response.write "NOTE: This uploaded will place your files in the following directory:
" response.write "" & FileDirectory & "

" response.write "

" response.write "" response.write "
" response.write "

" End Sub '****** Upload File Process ************************************************************ Sub UploadFileProcess Dim Uploader, File Set Uploader = New FileUploader formname = request.querystring("form") elementname = request.querystring("element") %> <% response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Upload A File


" Uploader.Upload() If Uploader.Files.Count = 0 Then Response.Write "No File(s) were uploaded." Else For Each File In Uploader.Files.Items File.SaveToDisk FileDirectory Next response.write "Your image was uploaded successfully!
" response.write " onClick="calpopulate('<% response.write Session("frFileName") %>')" return false; <% response.write ">CLICK HERE" End If End Sub '****** Draw A Mini Calendar Selector ************************************************** Sub DrawMiniCalendar(theDate) '---------------------------------- Draw a month calendar Dim ThisMonthsFirstDay Dim NextMonthsFirstDay Dim ThisMonthsLastDay Dim LastMonthsLastDay Dim StartDate Dim Counter formname = request.querystring("form") elementname = request.querystring("element") '------- Setup some information about the month ----------------- ThisMonthsFirstDay = cDate(Month(theDate) & "/1/" & Year(theDate)) NextMonthsFirstDay = dateAdd("m",1,ThisMonthsFirstDay) ThisMonthsLastDay = dateadd("d",-1,NextMonthsFirstDay) LastMonthsLastDay = dateadd("d",-1,ThisMonthsFirstDay) StartDate = dateadd("d",1-weekday(ThisMonthsFirstDay),ThisMonthsFirstDay) '------- Draw the beginning of the calendar ---------------------- %> <% If Month(theDate) > 1 then PrevMonthLink = Month(theDate) - 1 PrevYearLink = Year(theDate) PreviousLink = PrevMonthLink & "/1/" & PrevYearLink End If If Month(theDate) < 12 then NextMonthLink = Month(theDate) + 1 NextYearLink = Year(theDate) NextLink = NextMonthLink & "/1/" & NextYearLink End If If Month(theDate) = 1 then PrevMonthLink = 12 PrevYearLink = Year(theDate) - 1 PreviousLink = PrevMonthLink & "/1/" & PrevYearLink End If If Month(theDate) = 12 then NextMonthLink = 1 NextYearLink = Year(theDate) + 1 NextLink = NextMonthLink & "/1/" & NextYearLink End If response.write "" & chr(13) response.write "" & chr(13) response.write "" response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) '-------- If the first day is not sunday -------------------------- If weekday(ThisMonthsFirstDay) > 1 then For Counter = day(StartDate) to day(LastMonthsLastDay) Call DrawOtherMiniDay (Counter, theDate) Next End if '-------- Draw normal days after Saturday start a new row --------- For Counter = 1 to day(ThisMonthsLastDay) Call DrawMiniNormalDay (Counter, theDate) If weekday(cDate(Month(theDate) & "/" & Counter & "/" & Year(theDate))) = 7 then response.write "" & chr(13) If Counter <> day(ThisMonthsLastDay) then response.write "" & chr(13) End If End if Next '-------- If last day is not saturday ----------------------------- If weekday(ThisMonthsLastDay) < 7 then For Counter = 1 to 7 - weekday(ThisMonthsLastDay) Call DrawOtherMiniDay (Counter, theDate) Next End if '-------- Draw the last row of the calendar ----------------------- response.write "" & chr(13) response.write "
" & chr(13) response.write "" & chr(13) response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "" response.write "" response.write "" ' response.write "" response.write "" & chr(13) response.write MonthName(Month(theDate)) & " " & Year(theDate) ' response.write "" response.write "" response.write "" If CalendarType <> "day" AND CalendarType <> "week" AND CalendarType <> "year" then response.write "" response.write "" Else response.write "" End If response.write "
" response.write "
SMTWTFS
" & chr(13) End Sub Sub DrawMiniNormalDay(DayNumber, theDate) '----------------------------------- Draw a Normal Day If Day(Now) = DayNumber and Month(Now) = Month(theDate) and Year(Now) = Year(theDate) then MiniCalDayBGColor = "#DDDDDD" Else MiniCalDayBGColor = "#EEEEEE" End If If weekday(cDate(Month(theDate) & "/" & DayNumber & "/" & Year(theDate))) = 7 or weekday(cDate(Month(theDate) & "/" & DayNumber & "/" & Year(theDate))) = 1 then MiniCalDayBGColor = "#DEDEEF" End If DateToSend = Month(theDate) & "/" & DayNumber & "/" & Year(theDate) response.write " onMouseover="this.bgColor='#DDDDFF'" onMouseout="this.bgColor='#EEEEEE'" onClick="calpopulate('<% response.write DateToSend %>')" <% response.write " width='14%' valign='top' bgcolor='" & MiniCalDayBGColor & "' align='center'>" & chr(13) response.write "" & chr(13) If CalendarType = "day" then response.write "" response.write DayNumber End If If CalendarType = "week" then response.write "" response.write DayNumber End If If CalendarType = "year" then response.write "" response.write DayNumber End If If CalendarType <> "year" and CalendarType <> "week" and CalendarType <> "day" then response.write DayNumber End If response.write "" response.write "" & chr(13) End Sub Sub DrawOtherMiniDay(DayNumber, theDate) '--------------------------------------- Draw Other Day response.write "" & chr(13) response.write "" & chr(13) response.write "" & chr(13) End Sub '******* SQL Search Query Builder ************************************************ Function GenerateSQLSearch(strText, strTable, strField ) Dim selectClause Dim fromClause Dim whereClause selectClause = "SELECT * " fromClause = "FROM " & strTable & " " whereClause = "WHERE " '-------- Remove Any Words that are 3 letters or less -------------------------- strTextTEMP = split(strText, " ") CountMax = ubound(strTextTEMP) For I = 0 to CountMax If len(strTextTEMP(I)) > 3 then strTextFIXED = strTextFIXED & " " & strTextTEMP(I) End If Next strText = strTextFIXED '------------------------------------------------------------------------------- whereClause = whereClause & " (" & strField & " LIKE '%" & _ Replace( Trim( strText ), " ", "%' OR " & strField & " LIKE '%") & "%')" GenerateSQLSearch = selectClause & fromClause & whereClause End Function '******* Fix String Function ***************************************************** Function FixString(strSource) FixString = Replace(strSource, "'", "''") End Function '******* Write out the page footer *********************************************** Sub DrawFooter response.write Session("DefaultFooter") End Sub %>