Testing PHP in entries

Just testing MT to see if it will allow me to do code in entries.

Inspired by a thread on the MovableType support forum, I want to see if I can display a text string as an image inside a blog entry.

It works! Well, it used to work until something broke on the server…

Nothing terribly complicated, but the ability to use PHP inside a blog entry does have some interesting potential.

For those of you interested in seeing what I did, I just embedded the following in my entry

$text = date("F j, Y, g:i a");
echo "<p>Today's date: $text</p>\n";
// Set the image size based on the font size and text
$font = 8;
$width  = ImageFontWidth($font) * strlen($text);
$height = ImageFontHeight($font);
// Create the image object
$im = imagecreate($width,$height);
// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// write the string at the top left
imagestring($im, 5, 0, 0, $text, $textcolor);
// output the image
// write the image to a file
// Change /path/to/image/dir/ to whatever path you're using
if (is_writable("/path/to/image/dir/")) {  // Check to see if the directory is writable
imagepng($im,"test.png",75);
echo "<p>Today's date as an image: <img src=\"test.png\"  height=\"$height\" width=\"$width\" /></p>\n";
}
else echo "<p>Don't have permission to write to the current directory</p>\n";
imagedestroy($im);

MT 3.0 ready for alpha testing soon

Looks like SixApart is ready to start alpha testing MovableType 3.0 soon. I’ll probably wait for beta testing to start, seeing as how there isn’t much activity on this blog to warrant being on the bleeding edge. But ifyou’re interested, drop them a line.

MT 2.66 released

Just saw that MovableType released a new version, MT 2.66. Looks like it’s mostly to deal with the comment spam problem. Hopefully this will help keep comment spam manageble until 3.0 comes out.

MT style sheets

Oooh, now here’s a promising site. Movable Style is a collection of different style sheets that can be used to customize the look of a Movable Type blog. There are the default styles, and a few interesting looking ones. I’ll have to keep an eye on this one.

New MT version

Looks like while I was away, MovableType 2.65 was released. Since it contains a fix for a security issue, it’s probably a good time to upgrade (or have your host provider upgrade)