Twitter RSS Feed Flickr Photostream Facebook Fan Page

Things I Am Working On For My Blog Script

Written By Tyler Ingram on Sep 14, 2007

I have been looking at ways to adding categories to my blog similar to the way that WordPress does it and I have finally figured it out. After thinking a little bit more on the functionality I have figured out the only way for me to do it efficiently is the way that WordPress does it which is use another table that links the blog post id to the category id. This allows me to have multiple categories for each post as well as easily count up the amount of posts within a particular category.

This is a work in progress as I still have to create the script that will display the posts within the category if you select it from the left side part of my blog. But it is coming along nicely; I will just have to set aside some time to finish it up.

Another thing that I changed on my blog is the way the archives are listed on the left side of the site. Before I was displaying all the months that passed since I created my blog and it was going a bit much so I decided to shorten it to show only the last 6 months and their post count. I took roughly 25 lines of code and was able to cut it down to 5 lines of code. Is that efficient or what? I love it when I can take multiple lines of code and condense them.


 7 Responses to "Things I Am Working On For My Blog Script"

  • Andrea Micheloni

    Actually I would have created a table `categories` for the categories, adding a `categoryid` field to your posts’s table.
    (So having one category per article).
    Then I’d have made the tables `tags` and `post2tag` to work like what you’ve done.

    In other words: one category, more tags. IMHO, obviously…

  • Tyler Ingram

    Oh so you mean mutliple tags would fit a particular category?

    So like under a category web development, you might have the tags of: PHP, HTML, XHTML, Javascript etc?

  • Andrea Micheloni

    No, I mean having multiple tags for every post, but just one category..

  • Tyler Ingram

    Oh ok.. I guess I am using my categories more like tag huh?

  • I have problem with my blog

  • Tyler Ingram

    What problem are you having with your blog?

  • Thanks for your helpihg, I think it is ok now!

Both comments and pings are currently closed.
If you still wish to comment please feel free to use my Contact Page