About this Blog
This is a blog created initially just for me to practice PHP & SQL in, it was later greatley expanded as a project for my
MIS424 class at WWU in 2009.
This blog doesn't use WordPress or any similar technology, instead it was created by me from the bottom up. I did use other people's code for some of the parts including:
A CAPTCHA made by ReCaptcha for the comments page.
Facebook's API for both the comments and main blog posts page.
The blog posts 'like' button is made simply using an iFrame
The comments page has a 'connect to facebook' button which connects the user to their facebook account to write a comment. All I have made this do though is put the users first name from facebook as the 'poster'. I beleive I am also required to disclaim that their first name is stored in my database independent of Facebook by Facebook's terms of use.
I will explain here breifly how the page is setup and works.
The Main Page
The posts and comments are all stored in a MySQL database, on the main page the posts are drawn
from the database and displayed depending on what parameters the user entered in. The parameters include: the post's date, its category or its postID.
The Menu
There is a php include file that contains the lefthand menu as well as alot of the code that would be redundant to put on multiple pages. In the left hand menu
There is a category cloud that selects all the categories used in any of the previous posts and sizes the font according to how many times that category has been used, clicking on a category will
show all previous posts under that category.
Below that is simply a list of dates that a blog post has been made on, drawn dynamically from the database. Clicking on any date will take you to blog posts made on that date.
The Comment System
The comments system is a HTML form that uses SQL & PHP to write the information inputed into the comment database, but not before being confirmed by the CAPTCHA. The user can either enter a name or select 'connect with facebook' to use their Facebook name.
Once in the database the main page reads how many comments exist for any paticular post and displays the number of comments below the post. Clicking on that link will display a list off previous comments made on that post underneath the post itself.
All HTML tags are stripped out of comments.
Writing a Post
Writing a blog post is done on a seperate page located
here, there is no link to the page on the main page except for obviously right here in the About the Blog page.
Here you enter the title and the main content of the blog in addition to a password. The password required is hardcoded in. If the password fails the page is redirected back to the page and lets you know the password was incorrect but retains the content of the forms through cookies and querystring.
If the password is correct the post will be written to the database and redirected to the main page of the blog.
HTML tags are stripped out of the title but are left in the post itself, HTML line breaks are subsituted with the br tag before the post is put in the database.
Other Nonsense
There is a bit of JavaScript that randomly generates a title to the page.
There is a bit of PHP that makes the words in the upper right hand corner turn into a 'picture' of Tommie Frazier on Saturdays.