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.





Andrea MicheloniSep 16, 2007 at 00:56:38
[Link]
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 IngramSep 16, 2007 at 12:33:22
[Link]
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 MicheloniSep 17, 2007 at 05:56:15
[Link]
No, I mean having multiple tags for every post, but just one category..

Tyler IngramSep 17, 2007 at 06:47:08
[Link]
Oh ok.. I guess I am using my categories more like tag huh?

Скачать рефератJan 31, 2008 at 04:49:01
[Link]
I have problem with my blog

Tyler IngramJan 31, 2008 at 06:19:00
[Link]
What problem are you having with your blog?

Скачать рефератFeb 05, 2008 at 03:15:21
[Link]
Thanks for your helpihg, I think it is ok now!