June 14, 2006

Minxlets June 14 Edition

New stuff today:

The SQL query manager I mentioned before is in. You'll see at the bottom of the page a line like

47 queries taking 0.06 seconds, 157 records returned.
Which shows you the number of SQL queries sent, the elapsed time spent performing the queries, and the total number of records retrieve. I'd like to reduce the number of queries... In fact, I'm not sure how it even gets to 47. Unfortunately, if you're displaying comments inline, Minx needs to issue a separate query for each post to fetch those comments. It seems to perform reasonably well anyway; once the data is cached, the time for those 47 queries drops to 10 milliseconds.

Ah, I've worked out where the 47 queries comes from:

1 query to read the blog record.
1 query to read the site record (which is something I've added to the standard MT datbase; it holds extra settings for Minx/MT).
1 query to load the default templates.
1 query to load the blog templates.
1 query to validate the user, if he/she has an active login.
1 query to load the entries for the page.
20 queries to count the comments.
20 queries to load the comments.

Uh... that's 46. I have no idea what the other one is. But I can definitely reduce that number.

Macros

Like templates for your posts! You can define a macro such as - say - {DWL}, and whenever you write {DWL} in a post, it gets turned into <a name="DWL" title="Don't write letters!">DWL</a>, which looks like this:

DWL
(Mouse over it to see the popup description.)

Macros also support field expansion, so you can define your {DWL} to be something like "Don't write letters $1", and then when you use it in your post, you can have something like {DWL "and this time I mean it!"}. The parameters that you put in your post get substituted into the macro, and expanded version replaces the macro call in your post.

With me so far?

Cool.

Well, macros can do more than that: They can also pull template tags right into the text of your post. If you define {comments} as "This post has $1 comments", and then write in your post {comments [post.comments]}, the correct value will get plucked from the database and put right into your post, wherever you want it.

Currently, the actual macro text doesn't get template parsed, but that would be an easy to do if I decide it would be a sane thing to do. There's such a thing as making a system too flexible.

Simpler Stuff

If that broke your head, then never fear, there are some nice simple things in today's release as well. New magic tags:

[quote:random template]
[quote:cycle template opt_time]
[image:random template]
[image:cycle template opt_time]

[quote:random] pulls a random quote out of a selection stored in a template, one quote to a line. You can't have a line break inside a quote, but you can format it with HTML however you want. I've put one of these on the demo version of Munuviana, though I've forgotten what most of our tag lines were.

[image:random] does the same thing with images. Just put the <img src="blah blah"> tags in the template, one to a line. Great if you have a set of rotating banners (and I know some of you do). No PHP or Javascript hacking required!

[quote:cycle] cycles through a list of quotes, changing by default every hour. opt_time optionally changes this to however many seconds you want.

[image:cycle] does the same thing for a list of images.

I think that's all right now. I'm still working on the forms processing module, and unfortunately I just got a big distraction dropped on me so the pace of development will slow down until next Tuesday. There's still lots more goodies to come, though, and I'll try to keep releasing an update every day with at least one new thing.

Update: Oops. I edited the program on my notebook, uploaded it to the staging area for testing, got it working, put it in the live area - and then, instead of copying the new live version to mu notebook, I copied the version on my notebook over the live version, wiping out an hour and a half of debugging.

Of course, I had a backup. I always have a backup. Sometimes I manage to really screw up and overwrite my backup too, but not this time.

Posted by Pixy Misa at June 14, 2006 08:27 AM | TrackBack
Comments
#1

Best thing about the internet... I'll be on the road this weekend and I'll still be able to check in for Minx updates. :) (unless of course my laptop dies... but let's not ask for trouble).

Posted by Teresa at June 14, 2006 10:46 PM
Live Comment Preview
Post a comment









Remember personal info?