Go to content Go to navigation Go to search

Tread lightly on the things of earth

Mike’s weblog about computing, politics, and faith (a progressive view)

Moving day

Tread lightly is now a MovableType weblog at a new permanent location.

Please follow me to this new location by updating your bookmarks/blogroll/newsfeed:

Tread lightly on the things of earth (MT edition)

Content here won’t be updated further but will remain accessible as my 2002 Radio blog archive, searchable from new location.

Thanks!

<!— imported into MT from 2002 Radio entry via RE on 2003-12-10 —>

Compact blogroll popup menu

I want to display a blogroll, and I want it to be compact. (Because I'm bringing forward a long, long list of Radio subscriptions that would overwhelm my left sidebar.)

Phil Ringnalda generously provides the code to display one's blo.gs blogroll favorites in a popup menu (via PHP and JavaScript). The ultimate in compactness, eh? Thanks, Phil!

BTW, Phil's blogroll.php (actually, its output) validates as XHTML 1.0 Transitional after making the following modifications:

Encompass the emitted javascript with an HTML comment:
L81C44: add "<!--" before the "/n"
L87C11: add "-->" before "</script>"

and of course
L90C100: change "<br>" to "<br />"

[Populating popup menu in progress . . . ]

(Runner-up is blogrolling.com's service as used by Horst, for example, on the Aardvark main page. Note the effortless identification by asterisk which blogs have recently updated. Quite cool as well.)

2003-01-02 update: Similarly, why not conserve vertical sidebar space further by implementing popup (aka dropdown) menus for recent entries and archives as well as for blogroll? I first saw this done at Kung Fu Grippe, and in its page source I see Merlin credits Pete for the dropdown menu code. Thanks very much, Pete!

Roasting coffee at home, umm, umm, good

I noted back in April my interest in the Kuro5hin story, A coder’s guide to coffee, much of which was news to me. Well, Christmas Day I learned what fresh, home-roasted coffee tastes like …

read more...

Building Image::Magick in Mac OS X Jaguar with Perl 5.8.0

I’m trying to get my head around Brad’s MTEmbedImage plugin, and it requires ImageMagick and the Image::Magick perl module. (Context: Mac OS X 10.2.3, Perl 5.8.0 built this way). But Image::Magick won’t install from CPAN, and perlmagick-pm in fink is out of date. Randal provides the necessary steps to build Image::Magick (03 Nov 2002) . . . read more...

Realizations: MTInclude plus PHP instead of SSI

Realizations as a result of implementing a direct SQL include instead of SSI for, in this case, rightcontent photos:

  • I could have used an <$MTInclude file="photolog.txt" $> all along instead of including via SSI (verified). Difference: MTInclude includes only at page rebuild; SSI includes at every page load. How much does this difference matter?
  • Not using SSI means I can embed PHP if I want (can't do both) [Richy notes an .htaccess command to force PHP parsing of .html files]

Richy also made me aware of Sebastian's Validable plugin and Erik's overLIB (its documentation; provide Link Back if I use it), both of which I've installed locally and at webhost.

2003-01-29 update: PHP includes at every page load, just as SSI does. This is obvious to me now, but wasn't when I originally wrote this entry.

SSI include syntax:
<!--#include virtual="file.html"-->

PHP include syntax:
<?php include ("file.html"); ?>
(more at PHP Include Tutorial)

Solution to MT SQL plugin DBI error

In trying to use Brad Choate’s cool SQL Plugin, I got this error on rebuilding this site:

Can't get DBI::st=HASH(0x81240ec)->{NAME_hash}: unrecognised<br /> attribute at /path/to/extlib/bradchoate/sql.pm line 132.

A comment clue from Chris at the bottom of the SQL Plugin page leads to a solution: “I traced the problem to an old version of perl-DBI (prior to 1.2.0 - when NAME_hash was introduced afai can tell).”

If you have a shell account, you can implement Chris’s hint above this way:

mkdir ~/lib
wget http://cpan.org/authors/id/T/TI/TIMB/DBI-1.32.tar.gz
tar xzvf DBI-1.32.tar.gz
cd DBI-1.32
perl Makefile.PL LIB=~/lib PREFIX=~/lib
make
make install

Then specify the new DBI to MT by inserting a ‘use lib’ in front of the ‘use DBI’ in /path/to/mt/lib/MT/ObjectDriver/DBI/mysql.pm:

# MWJ 20021224: use newer DBI 1.32 in ~/lib
use lib qw(/home/mwjames/lib/i386-linux);
use DBI;

2003-02-17 update: In MT v2.6, the file in which to insert the ‘use lib’ is /path/to/mt/lib/MT/ObjectDriver/DBI.pm.

Using SQL to populate rightcontent photos

Now generating main page rightcontent at each posting/manual rebuild via the following SQL select (uses Brad’s SQL Plugin) instead of including a static file via SSI (idea from Mark).

(Blog id 2 below is my photolog blog, which before wrote out the photolog.txt static file included in main index via SSI according to Jeremy’s instructions. Entry status = 2 for published posts, rather than draft ones (entry_status=1).

The unfiltered attribute is needed to select another blog’s posts because, as Brad documents, “normally, entries that don’t belong to the active blog or don’t have a ‘Published’ status are excluded automatically.”)

<MTSQLEntries unfiltered="1" query="select entry_id from mt_entry where entry_blog_id=2 and entry_status=2 order by rand() limit 15" <a name="<$MTEntryID pad="1"$>"></a> <span class="preview"> <a href="<$MTEntryLink$>" title="<$MTEntryTitle$>"><$MTEntryExcerpt$></a> </span>

</MTSQLEntries>

2002-12-31 update: Added title attribute to hyperlink’s <a> tag above, which results in photolog entry’s title displaying during hover over photo. Cool!

Open content licensing considerations

Creative Commons 'You may use my work' logoI’m deciding which sharing-oriented licensing I want to use for the content I create at this site. I’m aware of the Creative Commons licenses (as seen at markpasc.org and Vertical Hold, for examples) and the OpenContent license (as seen at b.cognosco, for example). Are there others?

The Creative Commons animation (requires Flash) is quite compelling.

I recognized Creative Commons as useful back in May 2002 when I mistook some weblog design content as sharable when its author hadn’t in fact given permission. (I quickly heeded the author’s wishes.) Now that I’m getting better at creating my own stuff, I want to be sure my intentions as a work’s author are clear — and in most cases those intentions will be to share freely. I intensely dislike hoarding creative output, as I consider creativeness a gift — an unearned gift — in the first place. (As you are given, so freely give.)

[thinking triggered via Mark]