My Blog MkII

Monday, 5th June 2006 at 11:01 1 comment

If anyone who happens to read this hasn't already had a look at the About page, at least read the first couple of paragraphs because then this next bit will make a load more sense. As you will know, having read the aforementioned page, I am going to be creating my own blog from scratch, and i thought I'd note down how I plan to do it, for both my benefit as writing things like this out always makes it clearer and it adds another post to my rather empty blog, and anyone else's who is considering doing the same.

I first decided I'd like to do this not because I couldn't find a blogging app. that would do what I wanted (wordpress stands out amongst others), but because I wanted to write my own as a learning/development exercise. It does also of course mean that I'm able to get the blog to behave how I feel it should, assuming I'm good enough to code in the features I want.

The first article I read on the subject of creating your own blog was this one on msdn. I'd also decided that I was going to write it using Microsoft Visual Web Developer 2005 Express Edition (VWD for short) in C# (that's C-Sharp) and store everything in a MS SQL 2005 database. Both of the above are free, and form part of the excellent (and free if you download before November-ish) "express edition" collection of Microsoft development apps.

One of the deciding factors for me was the range of asp.Net 2.0 controls that would be really useful for creating a blog, which I've listed below with notes about where I think they'll be useful.

  • Data repeater – Listing posts on the home page and for search results, as well as for listing comments below each post.
  • Calendar – Search for posts by date.
  • SiteMapPath – Show the user which category the currently viewed article is in, so the users can instantly search for similar articles.
  • SiteMap – Automatically produce a sitemap, as i plan to extend this site from being just a blog to containing links to a store of code and other stuff I've written.
  • Treeview – Display categories in a hierachial fashion, in much the same way as my current theme does if you look at the panel to the right.
  • Users, Logins & Profiles – Makes it easier to manage the users of the site, if i decide to add other users in the future.
  • Master Pages & Themes – An easy way to manage the look and feel of the whole site, incorporating CSS for html & skins for ASP controls.

I terms of data design, i was thinking of initially using as few a tables as possible, then adding to them in time.

Here's how I plan to store posts:

Field Information
ID Unique integer for every comment
Title A string that will appear in the title of the
webpage and on the post lists
Category A keyword that describes the content of the post
Summary A couple of lines (say 200 chars max)that is
displayed in the post lists
Post The actual post.

I don't really know how to store the posts (as in the atual content) at present, but I'm thinking of storing it in xml form at a later date, and maybe as plain text html to begin with.

I'll stor comments in a similar way:

Field Information
ID Unique integer for every post
PostID The ID of the post that the
Name The name of the comentator(?)
Site The web address of the comentator's
website
Comment The actual comment.

I plan to add another couple fo tables in the future, including one for users, so the comments table will only have a UserID field, not a name or site (and then maybe use ID "0" for anonymous/unregistered users), and add an author field to the Posts table. I'll also add a table for categories as it would be a pain to hard code them in everytime i write an unusual post

Anyhow, that's about all I've really had chance to think about so far, but the idea's getting there.

Advertisements

Entry filed under: ASP.Net, Blog, Coding, Computers.

The little green button The end of the world???

1 Comment Add your own

  • 1. Nick  |  Tuesday, 1st January 2008 at 04:55

    I wrote my own blogging system a couple of months ago, but I used PHP and MySQL (I try to avoid any Microsoft products if I can).

    It was much easier than I thought it would be, and in the end I only used one script of 126 lines, which includes the snippets of HTML that the PHP stitches together to produce the page.

    A nice little bit of .htaccess magic means the user has no idea, and each article appears to be on an individual page.

    I reckon once you start on it you will knock out the required code in no time! 🙂

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Flickr Photos

More Photos

%d bloggers like this: