All opinions expressed are those of the authors and not necessarily those of OSNews.com, our sponsors,
or our affiliates.

I've really struggled with the challenge of implementing tags efficiently. Basically, I wanted to preserve the basic tag rule: as many tags as you like per post. But if I do that, I need another table in the database. However, to do this, I need an additional query for each story. Since Small Axe loads in just FOUR queries on the main page, this was a HUGE hit. It went up to 24 queries, albeit 24 simple, basic, efficient, FAST queries.
So I wrote it to use a single query, and guess what I found? The implementation sucked. It was slow. It was dirty. It meant editing tags was a precise business. And searching was lame. So, I rewrote tagging (while preserving links, etc) and - boom! - fast. Yes, it added a query for every story on the front page, but dammit, it works, it's clean, it's easy to read, and best of all, I'm going to implement some flickr-style tag editing on the backend. So, that's cool.
I guess we'll see what happens in the next week or two.
Comments

The "Galaxy" code I wrote for
OSGalaxy has now been ported over to
the OSNews Staff Blog section, and there's a crappy bug. When an RSS feed has more than one category (a legal setup), Magpie concatenates them into one word.
So, I've written an elementary, temporary workaround for the multiple categories problem with Magpie. Essentially, rather than concatonating the categories, this script will use only the last entry in the RSS/Atom feed. It's pretty basic, but it's tested on PHP4 and PHP5 and it doesn't change much code.
To use it, just save this file as rss_parse.inc and replace it in your magpie install. It's based off of 0.7a, which is from the latest release of Magpie at this time, 0.72. You can find the code
at http://firsttube.com/s/rss_parse.inc.phps.
Comments