Some minor sk.log modifications.
I decided the other day that I didn’t have nearly enough ‘deep linking‘ so in order to attempt to rectify that I’ve added ‘related’ links on each post page. For ages I wasn’t sure how to do this, until I bit the bullet and did a Google search and found out that — lo and behold — MySQL will pretty much do it for me using FULLTEXT. How useful!
So now we’ve got:
SELECT i.itemID, i.itemName, p.postLink
FROM `itemxref` i JOIN `log_posts` p
ON i.itemID = p.itemID
WHERE MATCH( i.itemText ) AGAINST ( ‘_______’ )
AND i.itemModule = ‘/post’
— ORDER BY RAND()
LIMIT 0, 3;
The ‘against’ criteria is actually the post’s tags, so naturally this will only show up on posts that (yanno) have tags; most of the old ones don’t, though I’m slowly trying to go through (all seven years of) the archives and add them. For a while I also tried ORDER BY RAND() mostly just because it’s fun, however it was interfering with MySQL’s relevance ranking on MATCH queries so that’s now gone.
Other small changes include:
- Some miscellaneous encoding stuff has been cleaned up. Because everyone loves neat code.
- As well as related links, posts now have a ‘plug list’ of commentors. I’m not really sure what the point of this is, but it seems popular so I decided it would be worth writing into the sk.log code.
- I’ve added a few microformats here and there, because I like that sort of thing.
- There is now an Atom 0.3 feed (finally). It will optionally take the same username and hash options as the RSS 2.0 feed for the syndication of hidden posts, but it does not take the
fullargument; Atom has in-build support for summaries versus fulltext, so I’ve used that instead. I’ve also decided I like Atom a lot more than RSS. - The links list in the bottom navigation block is now randomised.
Thrilling stuff!
And finally, I joined NaBloPoMo. Be afraid, be very afraid…
1038 days ago
102 comments