<% language="vbscript"%> <% ' DO NOT ALTER BELOW THIS LINE ' **************************** Passwordchecker() Sub displaypage() Select Case request("action") Case "addentry" addentry Case "editcss" editcss Case "editentry" editentry Case "deleteentry" removeentry Case "viewsummary" showentries Case "updatedetails" updatedetails Case "help" showhelp Case "smileys" smileymanager Case Else welcomeform End Select End Sub sub welcomeform() topadtable %>

Welcome to 'Blogopedia'

This Blog/News application has been designed to be very easy to use, but if you are experiencing problems - please take a visit to http://www.blogopedia.co.uk/.

To stay upto date with the latest 'Blogopedia' Version, please joing the 'Blogopedia' mailing list, by clicking here.

To get started, click on one of the admin options from below <% adminform bottomadtable End Sub sub showentries() topadtable Response.write "

Summary of entries

" Response.write "" Response.write "" blogfile = Server.MapPath("myblogindex.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news=objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing filenames=Split(news, "**") numrecords = Ubound(filenames) for i = 1 to numrecords bloginfo=split(filenames(i), "%%%") Response.Write "" Next Response.write "
DateTitleSummaryLengthFilename
" & FormatDateTime(bloginfo(1), formdate) & "" & bloginfo(2) & "" & bloginfo(3) & "" & bloginfo(4) & "" & bloginfo(5) & "
" adminform bottomadtable End Sub sub welcomeform() topadtable %>

Welcome to 'Blogopedia'

The 'Blogopedia' Blogging application has been designed to be very easy to use.
If you are experiencing problems - please visit to http://www.blogopedia.co.uk/.

To stay upto date with the latest 'Blogopedia' Version, please joing the 'Blogopedia' mailing list, by clicking here.

To get started, click on one of the admin options from below <% adminform bottomadtable End Sub sub showhelp() topadtable Response.write "

'Blogopedia' help

" Response.write "" %>

Setting up the include
In order to include the blog into your page, you'll need to do one of the following:

'Blogopedia' has been designed to be really easy to use - just upload the files to your webserver and it will work, but there are a few things that can go wrong:

'Blogopedia' operates without using a database making it accessible to all, but this does mean that it generates a fair few text files. Each individual blog is stored in it's own text file. The script is very easy to upgrade to make use of a database though, and once again if you email me confirmation of a donation to dotdragnet, I'll happily send you a version that uses a SQLServer or Access backend instead of text files. Note that you should not delete any of the text files generated by the script directly, but should use the delete functionality within the script itself. This way the entry in the index file will be removed as well - preventing future errors.

NOTE: this script creates files to store your blogs - do not delete any file beginning myblog... I recommed you install this script into it's own directory so you can keep all the files organised in one place.

If you are continuing to experience difficulties please do not send email to either the author, 'Blogopedia' or dotdragnet. Emails requesting support will be ignored. For personalised help, please visit the support pages at http://www.blogopedia.co.uk.

<% Response.write "" adminform bottomadtable End Sub Sub adminform() %>

Admin Options

<% displaylogout() End sub Sub removeentry() topadtable If request("idnumber")="" Then %>

Delete an entry

Enter the id number of the record to delete:
<% Else Response.write "

Delete an entry

" idnumber=Request("idnumber") blogfile = Server.MapPath("myblogindex.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing userrecord=Split(news, "**") numrecords = Ubound(userrecord) flag=0 finalstr="" for i = 1 to numrecords counter=Split(userrecord(i), "%%%") If counter(0)=idnumber Then ' Remove file from system - must have permissions set to allow this.... killfile = Server.MapPath("myblog" & counter( 0 ) & ".txt") 'killfile = Server.MapPath(counter(5)) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") objFSO.DeleteFile(killfile) flag=1 Else finalstr=finalstr & "**" & userrecord(i) End If Next finalstr=Trim(finalstr) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(blogfile) objTextFile.WriteLine finalstr objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing If flag=1 Then Response.Write "This entry has been deleted." Else Response.Write "Error: an error has occured because the entry could not be found, or the corresponding file was not present." End If Response.Write "" End If adminform bottomadtable End Sub Sub updatedetails() topadtable If request("password")="" Then %>

Change Admin details

Make changes below as required to customise 'Blogopedia' to your liking.

Password:

Choose your locality (effects the date/time display)

Choose a date/time display

Number of records to show per page:

Show summary only, with click through to see actual blog (if no is chosen title, time and post will be displayed by default)

<% Else prefs=Server.MapPath("blog_prefs.asp") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(prefs) sitename=Replace(Request.Form("sitename"), """", "'") objTextFile.WriteLine "<" & chr(37) objTextFile.WriteLine "session.lcid=" & request("lcid") objTextFile.WriteLine "lcid=" & request("lcid") objTextFile.WriteLine "formdate=" & request("formdate") objTextFile.WriteLine "scriptname=Request.ServerVariables(" & chr(34) & "script_name" & chr(34) & ")" objTextFile.WriteLine "password = " & chr(34) & request.form("password") & chr(34) objTextFile.WriteLine "usesummary = " & chr(34) & request.form("usesummary") & chr(34) objTextFile.WriteLine "recordsperpage = " & request.form("recordsperpage") objTextFile.WriteLine chr(37) & ">" objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing %>

Change Admin details

All changes have been made <% End If adminform bottomadtable End Sub Sub addentry() topadtable If request("title")="" Then %>

Add an entry

Complete the details below to add your new entry.

Title:

Summary:

Entry text:

<% Else blogfile = Server.MapPath("myblogindex.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing userrecord=Split(news, "**") counter=Split(userrecord(1), "%%%") thecount=Cint(counter(0))+1 thefile=Server.MapPath("myblog" & thecount & ".txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(thefile) entry=blogencode(request("entry")) title=blogencode(request("title")) summary=blogencode(request("summary")) objTextFile.WriteLine title & "%%%" & now() & "%%%" & summary & "%%%" & entry objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing news="**" & thecount & "%%%" & now() & "%%%" & title & "%%%" & summary & "%%%" & len(entry) & "%%%" & "myblog" & thecount & ".txt" & news Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(blogfile) objTextFile.WriteLine news objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing %>

Add an entry

Your new entry has been added <% End If adminform bottomadtable End Sub Sub editentry() topadtable If request("title")="" Then blogfile = Server.MapPath("myblog" & request("idnumber") & ".txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing userrecord=Split(news, "%%%") title=blogdecode(userrecord(0)) thetime=userrecord(1) summary=blogdecode(userrecord(2)) theentry=blogdecode(userrecord(3)) %>

Edit an entry

Complete the details below to add your new entry

"> Title:

Summary:

Entry text:

<% Else thefile=Server.MapPath("myblog" & request("idnumber") & ".txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(thefile) entry=blogencode(request("entry")) title=blogencode(request("title")) summary=blogencode(request("summary")) objTextFile.WriteLine title & "%%%" & request("thetime") & "%%%" & summary & "%%%" & entry & "%%%" objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing blogfile = Server.MapPath("myblogindex.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing userrecord=Split(news, "**") For i=1 to ubound(userrecord) counter=Split(userrecord(i), "%%%") If counter(0)=request("idnumber") then finalstr=finalstr & "**" & request("idnumber") & "%%%" & request("thetime") & "%%%" & title & "%%%" & summary & "%%%" & len(entry) & "%%%" & "myblog" & request("idnumber") & ".txt" else finalstr=finalstr & "**" & userrecord(i) End If Next Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(blogfile) objTextFile.WriteLine finalstr objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing %>

Edit an entry

Your entry has been updated <% End If adminform bottomadtable End Sub Sub editcss() topadtable If request("body")="" Then blogfile = Server.MapPath("easyblog.css") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing %>

Edit 'Blogopedia' CSS

Edit the CSS sheet below, then click save to make changes

<% Else thefile=Server.MapPath("easyblog.css") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(thefile) objTextFile.WriteLine request("body") objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing %>

Edit 'Blogopedia' CSS

Your cascading style sheet has been updated <% End If adminform bottomadtable End Sub Sub smileymanager() topadtable Select Case request("method") Case "new" ' add a record blogfile = Server.MapPath("smileys.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing finalstr=news & "**" & request("id") & "%%%" & request("code") & "%%%" & request("url") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(blogfile) objTextFile.WriteLine finalstr objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing %>

Add a new Smiley

Your new smiley was added <% showsmileyedit Case "edit" ' edit a record blogfile = Server.MapPath("smileys.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing smileycount=Split(news, "**") For i=1 to Ubound(smileycount) breakout=split(smileycount(i), "%%%") If breakout(0)=request("id") Then finalstr=finalstr & "**" & request("id") & "%%%" & request("code") & "%%%" & request("url") Else finalstr=finalstr & "**" & smileycount(i) End If Next Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(blogfile) objTextFile.WriteLine finalstr objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing %>

Edit Smiley

The selected smiley was updated. <% showsmileyedit Case "delete" ' delete a record blogfile = Server.MapPath("smileys.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing smileycount=Split(news, "**") For i=1 to Ubound(smileycount) breakout=split(smileycount(i), "%%%") If breakout(0)=request("id") Then ' Do nothing - we're deleting it! Else finalstr=finalstr & "**" & smileycount(i) End If Next Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.CreateTextFile(blogfile) objTextFile.WriteLine finalstr objTextFile.Close Set objTextFile = Nothing Set objFSO = Nothing %>

Delete Smiley

The selected smiley was deleted. No further instances with that code will be converted, but any existing entries will continue to point at the image you specified <% showsmileyedit Case Else %>

'Blogopedia' Smiley Manager

Edit below, add or delete smiley code.
(when you allocate the code ;) to a graphic, all instances of ";)" in your blogs will be replaced with that image)


Edit existing smileys

CodeImage   <% showsmileyedit End Select adminform bottomadtable End Sub Sub showsmileyedit() blogfile = Server.MapPath("smileys.txt") Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objCountFile = objFSO.OpenTextFile(blogfile, 1, True) news = objCountFile.ReadAll objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing smileycount=Split(news, "**") For i=1 to Ubound(smileycount) breakout=split(smileycount(i), "%%%") counter=breakout(0) %>
<% Next %> <% End Sub %>