Archive for the ‘Movable Type’ Category

Wording based on time

Wednesday, November 27th, 2002

Would you like to have a different saying below your post based on what time it was posted instead of (or in addition to) the date? A poster on the MT forums did, so I cooked up this little script yesterday.

<?
//set the beginning time for each time section - keep the quotes in there
$earlymorn = strtotime(”4:30am”);
$midmorn = strtotime(”9:00am”);
$lunch = strtotime(”11:30am”);
$afternoon = strtotime(”1:00pm”);
$evening = strtotime(”5:00pm”);
$bedtime = strtotime(”9:00pm”);

//This date format is for MT2.5 and above
$t = strtotime(”<$MTEntryDate format=”%X”$>”);

//Modify the messages as necessary - note that the middle of the night one should be in there twice.
if ($t <= $earlymorn) { echo “Past Your Bedtime”; }
elseif ($t <= $midmorn) { echo “Early Morning”; }
elseif ($t <= $lunch) { echo “Mid-Morning”; }
elseif ($t <= $afternoon) { echo “Lunch time”; }
elseif ($t <= $evening) { echo “Afternoon”; }
elseif ($t <= $bedtime) { echo “Evening”; }
else echo “Past your bedtime”;
?>

Enjoy! :)

Add “Listening To” & other fields to your entries

Wednesday, November 20th, 2002

This is a hack that reminds me a lot of “LiveJournal” blogs, and I know many MT users long for it.

So, Scott has made the hack. This one is not for the faint of heart, but it looks very snazzy when you are finished.

Read Scott’s Tutorial here.
BTW, you must be using the mySQL database flava of MoveableType to use this tweak.

6 months of archives

Tuesday, November 19th, 2002

Heather asked me if it were possible to make your archives listing only show the last 6 months one way, and then the rest another way.

She wanted the last 6 months of archives to display like:

November 2002
02 Nov 19: post title
02 Nov 02: post title

October 2002
02 Oct 30: post title…

and then the rest of the archives just in month format like this:

April 2002
March 2002

At first I would have said to do something with <MTArchiveList archive_type-”monthly” offset=”6″> but it that “offset” attribute doesn’t seem to get applied like that (it only offsets specific ENTRIES, not archive types). So I made a very (kind of scary) script to do exactly what she wanted. There may be some shortcuts I’ve overlooked, so please let me know if you think there’s an easier way.
(more…)

More on the MT Comment Spamming

Thursday, October 31st, 2002

I wanted to be sure to note two sites here that also have good information on the MT Comment Spammers:
:: Burningbird’s Comment Spam Quick-Fix
:: Dive into Mark’s Club vs Lojack Solutions

next/previous category archive

Tuesday, October 29th, 2002

Thanks to Lynda and Jenn there is a way to navigate between next and previous entries only within a category. But there has been many requests on the forums for a way to go between the category archives with next and previous like the date-based archives have.

This script will show the linked title of the previous and next categories, alphabetically, on each category archive page.
(more…)

collapsing archive list

Saturday, October 26th, 2002

Is your Monthly Archive list getting kinda long in your sidebar? Would you like to be able to show and hide it easily, with a few of the months still showing? Someone on the MTForums asked about this today, and I figured it out and thought I’d share it here.

The javascript for expanding/collapsing is a modification on Aaron’s original tutorial and Jenn’s version of it over here. I changed the variable names, so it shouldn’t conflict with either of those options if you already have them installed.
(more…)

category posts in columns

Tuesday, October 22nd, 2002

Someone asked about this on the MT forums, and I really liked how the answer turned out, so I thought I’d add it over here.

Some weblogs have a specific set of categories and would like to divide up the index page in columns to help segragate the posts. One such blog is BlogCritics. Other news-format blogs could be easily enhanced this way too.
(more…)

Index page Trackback Autodiscovery

Tuesday, October 15th, 2002

When Movable Type came out with version 2.2, it added a feature for showing the way information on blogs linked together called Trackback. This added a whole great new set of options to the blogging software. With the new version 2.5, Trackback is enhanced by an auto-discovery tool. Auto discovery allows you to link to a permalink from a post and it automatically detects the trackback URL and sends a ping. This made pinging a bit more intuative, and allowed for much easier multiple pings.

In configuring Picture Yourself, I wanted an easy way for using pings, without needing to attach the incoming pings to just a random picture that was on the main page, with the normal MTEntryTrackbackData code. It made sense to use a Category-based Trackback ping, so I made a category set to accept pings, and put that in a popup window. Still not easy enough for the user, because they’d have to copy the URL out of the popup window and paste it in the URLs to ping box.

So I posted on the MTForums and Phil came up with a great solution (and even went beyond that and made an MTCategoryTrackbackData tag)! His solution allowed anyone to post a link to PictureYourself in their post, and that automatically would discover the ping URL for that category. I enhanced this a bit to work well on traditional blogs.
(more…)

Individual Entry and Trackback

Monday, October 14th, 2002

A lot of people using Skins on their blogs want all of the elements of their journal site to have skins on them. This made a lot of people use Individual Archives as popups so that they could be skinned, too. Unfortunately, with the advent of Trackback in MT2.2, there wasn’t a good work-around to skin that window because only the trackback listing template and index template were updated upon receiving a ping. And rebuilding every time a ping comes in is a bit tedious of an option, so a lot of people just went with the trackback popups even though it couldn’t be skinned.

For people using the MySQL backend and PHP for their files, there is an option now!
(more…)

sanitize plugin

Thursday, October 3rd, 2002

Worried about people posting malicious code in your comments, but still want the functionality of HTML enabled comments?? You might want to check out the MT Sanitize Plugin. It “allows you to clean HTML and other markup that might exist in an comment entry.” It will let you list the acceptable HTML that you allow in your comments, and then it filters out the rest. Smart!
To run MT Plugins, you need to be using MT2.21 or higher.