<%@LANGUAGE="VBSCRIPT"%> <% option explicit '=================================================== 'Copyright 2005 Patrick Robin, Host Forest, all rights reserved ' 'All Host Forest software is provided for free under a linkware license. 'You may modify any part of the software at your own risk, but the software '(altered or otherwise) may not be distributed to entities beyond the 'license holder without the explicit written permission of the copyright holder. ' 'You may not remove, alter or otherwise disable all or any of the hyperlinks 'to the Host Forest website (http://www.hostforest.co.uk). All images, links or 'text must remain unchanged and intact and visible when the pages are viewed 'unless you first obtain explicit written permission from the copyright holders. ' 'Permission to remove the links, images and branding on a site by site basis 'basis can be obtained by purchasing the appropriate license from Host Forest 'by visiting http://www.hostforest.co.uk/Purchase/default.asp ' 'You may not pass of in part or in whole any part of this software, including 'images and source code, as your own work. You may use parts of this program in 'your own private works, including images and source code, but you may NOT 'redistribute, repackage, sublicense or sell in part or in whole any part of 'this program regardless of any modifications that may have been made without 'the express written permission of the copyright holder. ' 'This software is provided WITHOUT warranty, either expressed or implied, 'including, but not limited to, the implied warranties of merchantability and 'fitness for a particular purpose. '=================================================== 'set time session and disable caches session.lcid = 2057 response.buffer = true response.expires = 60 response.expiresabsolute = now() - 1 response.addheader "pragma","no-cache" response.addheader "cache-control","private" response.cachecontrol = "no-cache" %> [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] <% 'dimension variables dim rsArticles, sqlArticles, intArticlesCount, arrArticlesData, rsComments, sqlComments, intCommentsCount, arrCommentsData, rsDetails, sqlDetails, intDetailsCount, arrDetailsData dim intCategory, intDisplay, intArticlesLoop, intCommentsLoop, intLevel dim strTitle 'load and check variables if request.querystring("Category") <> "" and isnumeric(request.querystring("Category")) = true then intCategory = int(request.querystring("Category")) else intCategory = 0 end if if request.querystring("Display") <> "" and isnumeric(request.querystring("Display")) = true then intDisplay = int(request.querystring("Display")) end if if session("FB_UserLevel") <> "" then intLevel = int(session("FB_UserLevel")) else intLevel = 0 end if if intDisplay <> "" then 'grab specified article details set rsArticles = server.createobject("adodb.recordset") rsArticles.cursorlocation = 3 sqlArticles = "SELECT Articles.Article_ID, Articles.Article_Title, Articles.Article_Excerpt, Articles.Article_Content, Articles.Article_Posted, Articles.Article_Comments, Articles.Article_Images, Categories.Category_ID, Categories.Category_Title, Users.User_ID, Users.User_Name, Articles.Article_Level FROM FB_Users AS Users INNER JOIN (FB_Categories AS Categories INNER JOIN FB_Articles AS Articles ON Categories.Category_ID = Articles.Article_Category_ID) ON Users.User_ID = Articles.Article_User_ID WHERE Article_ID = "& intDisplay &";" rsArticles.open sqlArticles, adoConn if not (rsArticles.bof or rsArticles.eof) then intArticlesCount = rsArticles.recordcount arrArticlesData = rsArticles.getrows() else intArticlesCount = 0 end if rsArticles.close set rsArticles = nothing 'increment query count intQuery = intQuery + 1 'check for valid article specified if intArticlesCount = 0 then response.redirect(strBlogLocation &"/error.asp?Type=Article&Error=Article&Redirect=/default.asp") else strTitle = " >> "& arrArticlesData(1, 0) end if 'check user meets the required level if arrArticlesData(11, 0) <> 0 and intLevel < arrArticlesData(11, 0) then response.redirect(strBlogLocation &"/error.asp?Type=Article&Error=Level&Redirect=/default.asp") end if else 'set sql query string based on database type select case strDatabase case "MSSQL" 'specify category if required if intCategory = 0 then sqlArticles = "SELECT TOP "& intBlogArticleLimit &" Articles.Article_ID, Articles.Article_Title, Articles.Article_Excerpt, Articles.Article_Content, Articles.Article_Posted, Articles.Article_Comments, Articles.Article_Images, Categories.Category_ID, Categories.Category_Title, Users.User_ID, Users.User_Name FROM FB_Users AS Users INNER JOIN (FB_Categories AS Categories INNER JOIN FB_Articles AS Articles ON Categories.Category_ID = Articles.Article_Category_ID) ON Users.User_ID = Articles.Article_User_ID WHERE Article_Status = 1 AND Article_Level <= "& intLevel &" ORDER BY Article_Posted DESC;" else sqlArticles = "SELECT TOP "& intBlogArticleLimit &" Articles.Article_ID, Articles.Article_Title, Articles.Article_Excerpt, Articles.Article_Content, Articles.Article_Posted, Articles.Article_Comments, Articles.Article_Images, Categories.Category_ID, Categories.Category_Title, Users.User_ID, Users.User_Name FROM FB_Users AS Users INNER JOIN (FB_Categories AS Categories INNER JOIN FB_Articles AS Articles ON Categories.Category_ID = Articles.Article_Category_ID) ON Users.User_ID = Articles.Article_User_ID WHERE Article_Status = 1 AND Article_Category_ID = "& intCategory &" AND Article_Level <= "& intLevel &" ORDER BY Article_Posted DESC;" end if case "MySQL" 'specify category if required if intCategory = 0 then sqlArticles = "SELECT Articles.Article_ID, Articles.Article_Title, Articles.Article_Excerpt, Articles.Article_Content, Articles.Article_Posted, Articles.Article_Comments, Articles.Article_Images, Categories.Category_ID, Categories.Category_Title, Users.User_ID, Users.User_Name FROM FB_Users AS Users INNER JOIN (FB_Categories AS Categories INNER JOIN FB_Articles AS Articles ON Categories.Category_ID = Articles.Article_Category_ID) ON Users.User_ID = Articles.Article_User_ID WHERE Article_Status = 1 AND Article_Level <= "& intLevel &" ORDER BY Article_Posted DESC LIMIT "& intBlogArticleLimit &";" else sqlArticles = "SELECT Articles.Article_ID, Articles.Article_Title, Articles.Article_Excerpt, Articles.Article_Content, Articles.Article_Posted, Articles.Article_Comments, Articles.Article_Images, Categories.Category_ID, Categories.Category_Title, Users.User_ID, Users.User_Name FROM FB_Users AS Users INNER JOIN (FB_Categories AS Categories INNER JOIN FB_Articles AS Articles ON Categories.Category_ID = Articles.Article_Category_ID) ON Users.User_ID = Articles.Article_User_ID WHERE Article_Status = 1 AND Article_Category_ID = "& intCategory &" AND Article_Level <= "& intLevel &" ORDER BY Article_Posted DESC LIMIT "& intBlogArticleLimit &";" end if end select 'grab specified range of articles set rsArticles = server.createobject("adodb.recordset") rsArticles.cursorlocation = 3 rsArticles.open sqlArticles, adoConn if not (rsArticles.bof or rsArticles.eof) then arrArticlesData = rsArticles.getrows(intBlogArticleLimit) intArticlesCount = ubound(arrArticlesData, 2) + 1 else intArticlesCount = 0 end if rsArticles.close set rsArticles = nothing 'increment query count intQuery = intQuery + 1 'set page title if intCategory = 0 or intArticlesCount = 0 then strTitle = " >> Home" else strTitle = " >> "& arrArticlesData(8, 0) end if end if %> <%=strBlogTitle & strTitle%> [an error occurred while processing this directive]
<% 'display blog breadcrumb call display_breadcrumb() 'check if an article has been specified if intDisplay <> "" then 'draw article container response.write("
") 'display article title response.write("

"& SQL_decode(arrArticlesData(1, 0)) &"

") 'display article details response.write("") 'check if an excerpt has been specified if arrArticlesData(2, 0) <> "" then 'display article excerpt response.write("
") response.write(SQL_decode(arrArticlesData(2, 0))) response.write("
") end if 'display article response.write(SQL_decode(arrArticlesData(3, 0))) 'check for images and whether the gallery is enabled if (isnull(arrArticlesData(6, 0)) = false and arrArticlesData(6, 0) <> "") and intBlogGalleryEnabled = 1 then 'display thumbnail gallery call display_thumbs(SQL_decode(arrArticlesData(6, 0))) end if response.write("
") response.write("

Bookmark

") %> <% 'check comments are enabled if intBlogCommentEnabled = 1 and arrArticlesData(5, 0) = 1 then 'build comments container response.write("
") 'grab all comments for the specified article set rsComments = server.createobject("adodb.recordset") sqlComments = "SELECT Comment_ID, Comment_Author_Name, Comment_Author_Website, Comment_Date, Comment_Content FROM FB_Comments WHERE Comment_Article_ID = "& intDisplay &" AND Comment_Status = 1 ORDER BY Comment_Date ASC;" rsComments.cursorlocation = 3 rsComments.open sqlComments, adoConn if not (rsComments.bof or rsComments.eof) then intCommentsCount = rsComments.recordcount arrCommentsData = rsComments.getrows() else intCommentsCount = 0 end if rsComments.close set rsComments= nothing 'increment query count intQuery = intQuery + 1 'iniliase counter intCommentsLoop = 0 'display comments header response.write("

Comments

") 'check whether there are any comments if intCommentsCount = 0 then 'build comments container response.write("
") 'display no comments message response.write("

") response.write("There have been no comments made on this article. Why not be the first and add your own comment using the form below.") response.write("

") response.write("
") else 'loop through all comments do until intCommentsLoop = intCommentsCount 'build comments container response.write("
") 'display comments header response.write("
    ") 'display comment number response.write("
  • #"& intCommentsLoop + 1 &"
  • ") 'check for comment website and display commenter details if arrCommentsData(2, intCommentsLoop) <> "" then response.write("
  • Posted by: "& SQL_decode(arrCommentsData(1, intCommentsLoop)) &"
  • ") else response.write("
  • Posted by: "& SQL_decode(arrCommentsData(1, intCommentsLoop)) &"
  • ") end if 'display posted date response.write("
  • On: "& web_time(arrCommentsData(3, intCommentsLoop), strBlogTimeFormat, "Full") &"
  • ") 'check user level if session("FB_UserLevel") >= 3 then response.write("
  • Options: Edit
  • ") end if response.write("
") 'display comment response.write(SQL_decode(arrCommentsData(4, intCommentsLoop))) response.write("
") 'increment counter intCommentsLoop = intCommentsLoop + 1 loop end if 'check user is logged in if session("FB_UserID") <> "" then 'grab users details for form submission set rsDetails = server.createobject("adodb.recordset") sqlDetails = "SELECT User_Name, User_Email, User_Profile_Website FROM FB_Users WHERE User_ID = "& session("FB_UserID") &";" rsDetails.open sqlDetails, adoConn if not (rsDetails.bof or rsDetails.eof) then intDetailsCount = rsDetails.recordcount arrDetailsData = rsDetails.getrows() else intDetailsCount = 0 end if rsDetails.close set rsDetails = nothing 'increment query count intQuery = intQuery + 1 end if 'check if comments require registration if intBlogCommentRegistration = 1 then 'check if the user is logged in if session("FB_UserID") <> "" then 'build form container response.write("
") 'display form header response.write("

Leave a comment

") 'build comment submission form response.write("
") response.write("

") response.write("Please complete the form below to submit a comment on this article. A valid email address is required to submit a comment though it will not be displayed on the site.") response.write("

") response.write("

") response.write("HTML has been disabled but if you wish to add any hyprlinks or text formating you can use any of the following codes: [B]bold text[/B], [I]italic text[/I], [U]underlined text[/U], [S]strike through text[/S], [URL]http://www.yourlink.com[/URL], [URL=http//www.yourlink.com]your text[/URL]") response.write("

") response.write("

") response.write(" ") response.write("

") response.write("

") response.write(" ") response.write("

") response.write("

") response.write(" ") response.write("

") response.write("

") response.write("") response.write("

") response.write("") response.write("") response.write("") response.write("
") response.write("
") else 'build form container response.write("
") 'display form header response.write("

Leave a comment

") 'display registered members only message response.write("

") response.write("Commenting is restricted to registered users only. Please register or login now to submit a comment.") response.write("

") response.write("
") end if else 'build form container response.write("
") 'display form header response.write("

Leave a comment

") 'build comment submission form response.write("
") response.write("

") response.write("Please complete the form below to submit a comment on this article. A valid email address is required to submit a comment though it will not be displayed on the site.") response.write("

") response.write("

") response.write("HTML has been disabled but if you wish to add any hyprlinks or text formating you can use any of the following codes: [B]bold text[/B], [I]italic text[/I], [U]underlined text[/U], [S]strike through text[/S], [URL]http://www.yourlink.com[/URL], [URL=http//www.yourlink.com]your text[/URL]") response.write("

") response.write("

") if session("FB_UserID") <> "" then response.write(" ") else response.write(" ") end if response.write("

") response.write("

") if session("FB_UserID") <> "" then response.write(" ") else response.write(" ") end if response.write("

") response.write("

") if session("FB_UserID") <> "" then response.write(" ") else response.write(" ") end if response.write("

") response.write("

") response.write("") response.write("

") response.write("") response.write("") response.write("") response.write("
") response.write("
") end if response.write("
") end if else 'check whether any articles have been returned if intArticlesCount = 0 then 'display no articles header response.write("

No recent articles

") 'check whether a category has been specified if intCategory <> 0 then 'display no articles message response.write("

") response.write("There have been no articles posted to the "& strBlogTitle &" blog in the category that you have specified, please come back later.") response.write("

") else 'display no articles message response.write("

") response.write("There have been no articles posted to the "& strBlogTitle &" blog, please come back later.") response.write("

") end if else 'initialise counter intArticlesLoop = 0 'loop through current articles do until intArticlesLoop = intArticlesCount 'draw article container response.write("
") 'display article title response.write("

"& SQL_decode(arrArticlesData(1, intArticlesLoop)) &"

") 'display article details response.write("") 'check whether the article has an exceprt if arrArticlesData(2, intArticlesLoop) <> "" then 'display article exceprt response.write(SQL_decode(arrArticlesData(2, intArticlesLoop))) 'display full atricle link response.write("

") response.write("Read all of "& SQL_decode(arrArticlesData(1, intArticlesLoop)) &"") response.write("

") else 'display full article response.write(SQL_decode(arrArticlesData(3, intArticlesLoop))) 'check for images and whether the gallery is enabled if (isnull(arrArticlesData(6, intArticlesLoop)) = false and arrArticlesData(6, intArticlesLoop) <> "") and intBlogGalleryEnabled = 1 then 'display thumbnail gallery call display_thumbs(SQL_decode(arrArticlesData(6, intArticlesLoop))) end if end if response.write("
") 'increment counter intArticlesLoop = intArticlesLoop + 1 loop end if end if %>
[an error occurred while processing this directive]

Basecamp project management and collaboration