<%@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" response.ContentType="text/xml" %> <% 'dimension variables dim rsArticle, sqlArticle, intArticleCount, arrArticleData, intArticlesLoop dim intCategory '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 'set sql query string based on database type select case strDatabase case "MSSQL" 'specify category if required if intCategory = 0 then sqlArticle = "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 = 0 ORDER BY Article_Posted DESC;" else sqlArticle = "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 = 0 ORDER BY Article_Posted DESC;" end if case "MySQL" 'specify category if required if intCategory = 0 then sqlArticle = "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 = 0 ORDER BY Article_Posted DESC LIMIT "& intBlogArticleLimit &";" else sqlArticle = "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 = 0 ORDER BY Article_Posted DESC LIMIT "& intBlogArticleLimit &";" end if end select 'grab specified range of articles set rsArticle = server.createobject("adodb.recordset") rsArticle.cursorlocation = 3 rsArticle.open sqlArticle, adoConn if not (rsArticle.bof or rsArticle.eof) then arrArticleData = rsArticle.getrows(intBlogArticleLimit) intArticleCount = ubound(arrArticleData, 2) + 1 else intArticleCount = 0 end if rsArticle.close set rsArticle = nothing 'build xml header response.write("") response.write("") response.write("") response.write(""& strBlogTitle &"") response.write(""& strBlogLocation &"") response.write(""& strBlogDescription &"") response.write("") response.write("Powered by: Forest Blog Copyright 2005 Host Forest") 'loop through all selected articles intArticlesLoop = 0 'loop through articles and generate XML feed do until intArticlesLoop = intArticleCount response.write("") response.write(""& SQL_decode(arrArticleData(1, intArticlesLoop)) &"") response.write("") response.write(" "" then response.write(SQL_decode(arrArticleData(2, intArticlesLoop))) else response.write(SQL_decode(arrArticleData(3, intArticlesLoop))) end if response.write("]]>") response.write("") response.write(""& strBlogLocation &"/default.asp?Display="& arrArticleData(0, intArticlesLoop) &"") response.write(""& web_time(arrArticleData(4, intArticlesLoop), strBlogTimeFormat, "Full") &"") response.write("") 'increment counter intArticlesLoop = intArticlesLoop + 1 loop 'add xml footer response.write("") response.write("") 'close database connection adoConn.close set adoConn = nothing %>