Something I didn't think about until I started adding in a "list all entries tagged with X" view... in the absence of a join table mediating between entries and tags, the SQL to retrieve a subset of entries with a specific tag is:
SELECT * FROM entries WHERE tags LIKE '%my tag%'
Having to resort to a 'LIKE' comparison usually means really sloppy, and often unsafe, design. In this instance, it means that clicking through a link connected to the tag "cat" will also catch all entries tagged "catheter", "b...
(...more)
The trivial part of the tag-support revision was, well, trivial: Add a "tags" column in the entries table. Add an input field and fix the SQL accordingly in the Create / Update phases of the post form. Pretty up the entry-view template and that was that.
The not-so-trivial part is to manage the tags table "on the fly". Say we're creating a new entry, and the tags table is empty. We explode() and trim() the tags field, and find 3 tags: "fitness", "mileage" and "web design". We SELECT COUNT(*) FROM tags W...
(...more)
I was supposed to settle on a project name, but none of the things I came up with are making me excited, so I'm just going to keep thinking about this blog engine as "my-as-yet-unnamed-blog-engine-and-by-the-way-I-hate-the-word-blog".
But that doesn't have to mean stalled feature development. For my next trick I want to build in a "tag" feature. I think the easy approach will be to explode() the comma-separated "tags" list on entry submission, looping through to add any novel terms to the tags table. Th...
(...more)
●
a few last thoughts pre-blog-engine-1.0
posted: Sat 2011-08-06 02:26:39
tags:
unnamed blog project
I got my grip on template-based web app design techniques mostly from building my "snippets" mini-app. Reorganizing the whole website to let me juggle "snippets", and its simpler clone, "projects", in preparation for shifting the site's focus to the "blog engine" not-so-mini app, was good practice too.
What I really didn't expect was to end up with a "controller" module. I'm not all that thrilled with it, but now that it's done I'm not sure how I'd go about refactoring to remove it. If the thing I'm cal...
(...more)
3.3mi in ~52.5 minutes (down 1.5m), full lap at 4.8mph on lap 2, 3 more half-lap bursts, one peaking at 4.9mph (up .2). Around lap 10 or 12, I pushed too early into jog mode, and after only about a quarter-lap I knew a half-lap would leave me gasping and overheating, so I dropped back to a 4.1mph power-walk pace rather than collapse all the way back to my mid-range 3.7mph pace.
I would have liked to say to the second how long that 3.3mi took, but as I was nearig the "finish line" somebody's unattended 6...
(...more)