<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Movable Tips</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/" />
    <link rel="self" type="application/atom+xml" href="http://www.movabletips.com/atom.xml" />
    <id>tag:www.movabletips.com,2009-12-09://2</id>
    <updated>2012-05-17T22:25:06Z</updated>
    <subtitle>Tips, tricks and hints for all your Movable Type needs, shared by Maarten Schenk</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 5.13-en</generator>

<entry>
    <title>Movable Type 5.14 Released</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/05/movable-type-514-released.html" />
    <id>tag:www.movabletips.com,2012://2.3270</id>

    <published>2012-05-16T12:33:52Z</published>
    <updated>2012-05-17T22:25:06Z</updated>

    <summary><![CDATA[Six Apart announced the release of Movable Type 5.14 earlier today.&nbsp; Release notes are here.&nbsp; Apparently this is just a bugfix release without any new features or security updates, so upgrading is not mandatory.&nbsp; Still, the list of bugs fixed...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Movable Type News" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="514" label="5.14" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype514" label="movable type 5.14" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="release" label="release" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[Six Apart <a href="http://www.movabletype.org/2012/05/movable_type_514.html">announced the release of Movable Type 5.14</a> earlier today.&nbsp; <a href="http://www.movabletype.org/documentation/appendices/release-notes/movable-type-514.html">Release notes are here</a>.&nbsp; Apparently this is just a bugfix release without any new features or security updates, so upgrading is not mandatory.&nbsp; Still, the list of bugs fixed is enough to fill a screen, so it might be worth the effort! ]]>
        
    </content>
</entry>

<entry>
    <title>Searching, Commenting or Public Entry Submission Slow in Movable Type?</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/04/searching-commenting-or-public-entry-submission-slow-in-movable-type.html" />
    <id>tag:www.movabletips.com,2012://2.2059</id>

    <published>2012-04-23T14:05:10Z</published>
    <updated>2012-04-23T14:35:11Z</updated>

    <summary><![CDATA[I recently came across two Movable Type installations where the owners were complaining about the slowness of searching, commenting and submitting public entries. &nbsp;In such cases, often the server load is suspected, or maybe the database is the bottleneck. &nbsp;However,...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Optimization" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="commenting" label="commenting" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="improve" label="improve" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="optimization" label="optimization" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="optimize" label="optimize" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="optimizing" label="optimizing" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="posting" label="posting" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="publicentry" label="public entry" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="search" label="search" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="searching" label="searching" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="speed" label="speed" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="speedup" label="speedup" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[I recently came across two Movable Type installations where the owners were complaining about the slowness of searching, commenting and submitting public entries. &nbsp;In such cases, often the server load is suspected, or maybe the database is the bottleneck. &nbsp;However, in both cases a different culprit turned out to be slowing things down...]]>
        <![CDATA[<b>Non-optimized templates</b><div><br /></div><div>That's right... &nbsp;Depending on how Movable Type is configured, you will see a 'thank you' message after submitting an entry or a comment, and this message is rendered on-the-fly by the CGI script you are submitting to. &nbsp;When searching the search results page is also rendered on-the fly.</div><div><br /></div><div>Now, the basic contents of either the 'thank you' message or the search results are quite simple: a few lines of text, or a few summarized entries. &nbsp;In theory, this shouldn't take too long to render, and in practice it doesn't.</div><div><br /></div><div>But what if these pages contain the same sidebar (for example) that you are using on the rest of your website? &nbsp;This might contain a list of all your archives, the most recent comments, some RSS feeds, a tag cloud and lots and lots of other things.</div><div><br /></div><div>On the rest of the website, this is no problem: the sidebar and its content are generated at publishing time, so it just sits there, ready to be served. &nbsp;But in the 'dynamically' rendered comment/entry reply or search template all of this content has to be rendered 'on-the-fly', and all this adds seconds (sometimes even minutes) to the waiting time.</div><div><br /></div><div><b>How to fix this?</b></div><div><br /></div><div>The basic way to fix this is to set up caching and server side includes for the parts of the template that are slowing things down. &nbsp;Alternatively, you can remove these parts (do comment submitters really need to see the tag cloud and the archive list etc. again?)</div><div><br /></div><div>The basic steps to do this are identical to what you would do to optimize your templates for normal publishing, <a href="http://www.movabletips.com/2010/03/optimizing-movable-types-standard-templates-for-speed-part-2.html">as described here</a>. &nbsp;But this time, you need to do it for your system templates instead of your entry/archive/index templates.</div><div><br /></div><div><img alt="system templates.jpg" src="http://www.movabletips.com/system%20templates.jpg" width="580" height="378" class="mt-image-none" /></div>]]>
    </content>
</entry>

<entry>
    <title>FacebookShareCount Plugin for Movable Type Released</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/04/facebooksharecount-plugin-for-movable-type-released.html" />
    <id>tag:www.movabletips.com,2012://2.1978</id>

    <published>2012-04-03T21:01:07Z</published>
    <updated>2012-04-03T21:12:34Z</updated>

    <summary><![CDATA[I just released a new plugin called FacebookShareCount. &nbsp;Using Facebook's API it pulls in the number of shares each of your entries has received on Facebook, and adds this information to your Movable Type installation. &nbsp;You can then display this...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="facebook" label="Facebook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="facebooksharecount" label="facebooksharecount" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="like" label="like" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="likes" label="likes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="movable type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt4x" label="MT4.x" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt5x" label="MT5.x" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugin" label="plugin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugins" label="plugins" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="share" label="share" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="shares" label="shares" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[I just released a new plugin called <a href="http://www.yesitcan.be/facebooksharecount_plugin_for_movable_type.html">FacebookShareCount</a>. &nbsp;Using Facebook's API it pulls in the number of shares each of your entries has received on Facebook, and adds this information to your Movable Type installation. &nbsp;You can then display this info in the backend of your MT installation (if you are using MT5) via the listing framework, or sort entries with it in published templates.]]>
        <![CDATA[You can enable the plugin on a blog-by-blog basis. &nbsp;Note that the plugin uses the periodic tasks framework to pull in this information every hour for each of your entries, so if you have a very large blog it might slow down things a bit.<div><br /></div><div>Some screenshots:</div><div><br /></div><div><a href="http://www.movabletips.com/assets_c/2012/04/FBShares-430.html" onclick="window.open('http://www.movabletips.com/assets_c/2012/04/FBShares-430.html','popup','width=1706,height=289,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.movabletips.com/assets_c/2012/04/FBShares-thumb-600x101-430.jpg" width="600" height="101" alt="FBShares.jpg" class="mt-image-none" /></a></div><div><br /></div><div><i>Entry listing screen with Facebook Shares field enabled</i></div><div><br /></div><div><a href="http://www.movabletips.com/assets_c/2012/04/FBSharesSettings-433.html" onclick="window.open('http://www.movabletips.com/assets_c/2012/04/FBSharesSettings-433.html','popup','width=997,height=211,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.movabletips.com/assets_c/2012/04/FBSharesSettings-thumb-600x126-433.jpg" width="600" height="126" alt="FBSharesSettings.jpg" class="mt-image-none" /></a></div><div><br /></div><div><i>Settings screen for the plugin</i></div><div><i><br /></i></div><div>Comments on this plugin? &nbsp;Let me know!</div>]]>
    </content>
</entry>

<entry>
    <title>Bug + Solution: Movable Type 4.x Custom Fields Empty on Edit Profile Screen</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/03/bug-solution-movable-type-4x-custom-fields-empty-on-edit-profile-screen.html" />
    <id>tag:www.movabletips.com,2012://2.1901</id>

    <published>2012-03-22T13:46:28Z</published>
    <updated>2012-03-22T13:56:07Z</updated>

    <summary><![CDATA[Two of my clients recently encountered this issue, so I thought I'd mention it here along with the fix. &nbsp;In some versions of Movable Type (4.38 was the one my clients used) there exists a bug on the 'Edit Profile'...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tricks and Workarounds" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="4x" label="4.x" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bug" label="bug" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="customfields" label="custom fields" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="editprofile" label="edit profile" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="empty" label="empty" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="endevver" label="endevver" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="patch" label="patch" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugin" label="plugin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="profile" label="profile" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[Two of my clients recently encountered this issue, so I thought I'd mention it here along with the fix. &nbsp;In some versions of Movable Type (4.38 was the one my clients used) there exists <a href="https://movabletype.fogbugz.com/default.asp?103714">a bug</a> on the 'Edit Profile' screen you can reach by clicking your own username in the top right of the screen. &nbsp;Any custom fields for users appear to be empty on your own profile.]]>
        <![CDATA[In reality, the data is still in the database (you can still see it if your blog publishes a public version of your profile that has the custom field data in it). &nbsp;But the danger is that if you save your profile via the 'Edit Profile' screen in MT's backend and you leave the custom fields empty, your data will be overwritten with the contents of the 'empty' fields.<div><br /></div><div>Fortunately there is a solution: simply download and install this plugin from Endevver:&nbsp;<a href="https://github.com/endevver/mt-patch-user-profile-cf">https://github.com/endevver/mt-patch-user-profile-cf</a></div><div><br /></div><div>After that, edit your mt-config.cgi file and add a line like this:</div><div><pre style="margin-top: 15px; margin-bottom: 15px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; "><code style="border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; line-height: normal; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; ">UserProfileCFPatchEnabled 4.38</code></pre></div><div>Note: increment the version number in that line to match your version, and keep doing this if you upgrade Movable Type to keep the plugin working if the issue is not fixed in future versions of MT in the 4.x series.&nbsp;</div>]]>
    </content>
</entry>

<entry>
    <title>Tom Keating Releases (forked) PostOffice 2.0 plugin for Movable Type</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/03/tom-keating-releases-forked-postoffice-20-plugin-for-movable-type.html" />
    <id>tag:www.movabletips.com,2012://2.1874</id>

    <published>2012-03-20T11:03:21Z</published>
    <updated>2012-03-20T11:08:03Z</updated>

    <summary><![CDATA[Blogger Tom Keating of TMCNet has released his own fork of the PostOffice plugin for Movable Type that allows users to send in their blog entries via email. &nbsp;His version sports quite a number of improvements over the older version,...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="email" label="email" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="fork" label="fork" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugin" label="plugin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="postoffice" label="PostOffice" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tmcnet" label="TMCNet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tomkeating" label="Tom Keating" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[Blogger <a href="http://blog.tmcnet.com/blog/tom-keating/">Tom Keating of TMCNet</a> has <a href="http://blog.tmcnet.com/blog/tom-keating/movabletype/post-office-20-plugin-for-movable-type.asp?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+voipgadgets+%28VoIP+%26+Gadgets+Blog%29">released his own fork of the PostOffice plugin for Movable Type</a> that allows users to send in their blog entries via email. &nbsp;His version sports quite a number of improvements over the older version, check it out...]]>
        <![CDATA[Here is a list of the features:<div><br /></div><div><ul style="margin-bottom: 20px; margin-left: 1.5em; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-position: initial; font-family: Arial, Helvetica, sans-serif; line-height: 20px; "><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Images are now imported into MT Asset Management database, so they can be used in a slideshow, search results, etc. {Note: PostOffice v1.1 added this feature too}</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Videos are also now imported into MT Asset Management database.</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Both images and videos are now stored in /images/YYYY/MM dated folders instead of a single directory like PostOffice 1.0 &amp; 1.1.</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Ability for each blogger to set a maximum image width so they don't 'blow' out their blog layout with an image that is too wide.</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Images are resized automatically if larger than maximum width</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Detect html or text email format and set the line breaks for the entry automatically. {Credit: Alex Teslik<a href="http://www.acatysmoof.com/" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); ">www.acatysmoof.com</a>}</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Process message parts in a single loop (instead of two loops as in 1.1) while still replacing cid and loc links with the correct asset. The structure allows for future modifications, such as the automatic embedding of videos, audio files, etc. {Credit: Alex Teslik&nbsp;<a href="http://www.acatysmoof.com/" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); ">www.acatysmoof.com</a>}</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Auto-rotate email images based on EXIF tags. Originally I was running this cron job to auto-rotate all images based on EXIF data:<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />/usr/bin/jhead -autorot -ft /var/www/html/blog/tom-keating/images/*<br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " />But the code above has to process every image each time even if it has been rotated already. Now I can rotate images with PostOffice using Image::ExifTool. This allows iPhone and iPad users to mail images to their blog and have them appear correctly. The EXIF tag is updated after rotation so that Mobile Safari and some other browsers do not rotate the image again based on the EXIF orientation tag.</li><li style="vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 12px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Disabled plus style email addressing used by PostOffice 1.0 and 1.1, which expects email addresses using the format emailaddress+{blogid}@domain.com, i.e. tomkeating+5@tmcnet.com. However, since&nbsp;<strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-image: initial; font-weight: bold; ">most email servers</strong>DO NOT support plus-style addressing, this was preventing me from getting this plugin to work with Exchange Server 2010. I commented out the code, so you can re-enable it if you wish, though I suspect most will prefer it disabled.</li></ul></div>]]>
    </content>
</entry>

<entry>
    <title>Movable Type Nikon Jpeg Image Upload Issue</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/03/movable-type-nikon-jpeg-image-upload-issue.html" />
    <id>tag:www.movabletips.com,2012://2.1861</id>

    <published>2012-03-19T10:19:40Z</published>
    <updated>2012-05-10T03:09:49Z</updated>

    <summary><![CDATA[Recently I ran into an obscure issue with image uploads on a Movable Type installation of one of my clients. &nbsp;Several users had been complaining about photos being uploaded into the entry editor not showing up as (thumbnailed) images, but...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Tricks and Workarounds" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="asset" label="asset" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bug" label="bug" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="downloadlink" label="download link" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="entry" label="entry" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="error" label="error" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="image" label="image" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="imagemagick" label="Image::Magick" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="imagesize" label="Image::Size" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="imagemagick" label="imagemagick" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="movable type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nikon" label="nikon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="patch" label="patch" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="photo" label="photo" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="thumbnail" label="thumbnail" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[Recently I ran into an obscure issue with image uploads on a Movable Type installation of one of my clients. &nbsp;Several users had been complaining about photos being uploaded into the entry editor not showing up as (thumbnailed) images, but as direct download links. &nbsp;When later trying to insert the same image in a different entry, the image would ony show up as a file, not as a (thumbnailable) image. &nbsp;All these images appeared to have been taken with recent Nikon-brand cameras.]]>
        <![CDATA[I tested uploading the image on MT4 and on MT5, and in both cases went to check out the listing for it in the asset manager ("Manage &gt; Assets" under MT4, "Assets &gt; Manage" under MT5). &nbsp;When clicking the item in question, it revealed that the file has been saved as an 'Asset' instead of an 'Image' (which is what it should normally have been for an image file).<div><br /></div><div>Some digging in MT's code turned up that during the upload process a check was being made on the file to determine the dimensions, and that this check was failing. &nbsp;For this reason, Movable Type then decided that the file wasn't a real image and just treated it like an unknown file.</div><div><br /></div><div>The check was made in the lib/MT/Image.pm file (both in MT4 and MT5) and it involved trying to find out the image dimensions by using the Image::Size perl module (which comes pre-loaded with Movable Type). &nbsp;For this particular image, this module was returning the error message "<span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">JPEG marker not found". &nbsp;</span>Even when upgrading Image::Size to the most recent version the error remained.</div><div><br /></div><div>I was able to come up with a solution though. &nbsp;I noticed that I could manipulate the image using imagemagick on my server's command line. &nbsp;So obviously imagemagick was able to read the file. &nbsp;Since imagemagick is also capable of determining the height and width of an image, and I had the Image::Magick perl module already installed on my server anyway, I tried the following.</div><div><br /></div><div>In lib/MT/Image.pm there is a line that reads:</div><div><br /></div><div><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; my ( $w, $h, $id ) = Image::Size::imgsize($fh);</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><br />Directly below this line I inserted following code:</div><div><br /></div><div><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; unless ($w + $h){</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require Image::Magick;</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; seek($fh, 0, 0);</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $image = Image::Magick-&gt;new;</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $image-&gt;Read(file=&gt;$fh);</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $h = $image-&gt;Get('height');</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $w = $image-&gt;Get('width');&nbsp;&nbsp;</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $id = "";</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; seek($fh, 0, 0);</span><br style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; " /><span style="color: rgb(0, 0, 0); font-family: Verdana, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; ">&nbsp; &nbsp; }</span>
</div><div><br /></div><div>What this does is simply check for height and width using the Image::Magick perl module if they are returned as zero or none existent by Image::Size. &nbsp;For some reason Image::Magick didn't have any problem with the images in question. &nbsp;Of course, this does require that you have both imagemagick and Image::Magick on your server.</div><div><br /></div><div>I also <a href="https://movabletype.fogbugz.com/default.asp?107633#574920">reported the issue</a> to Six Apart, obviously.</div>]]>
    </content>
</entry>

<entry>
    <title>&quot;Invalid image file format&quot; Error in Movable Type</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/03/invalid-image-file-format-error-in-movable-type.html" />
    <id>tag:www.movabletips.com,2012://2.1859</id>

    <published>2012-03-13T11:04:26Z</published>
    <updated>2012-03-13T11:16:52Z</updated>

    <summary>I recently encountered a bug in Movable Type where uploading a certain image failed with the message &quot;Saving (filename) failed: Invalid image file format&quot;. Some digging led me to the file lib/MT/Image.pm where the uploaded image was failing a check....</summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Error Messages" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Security" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tricks and Workarounds" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bug" label="bug" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="image" label="image" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="images" label="images" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="invalidfile" label="invalid file" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="invalidimageformat" label="invalid image format" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="patch" label="patch" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="upload" label="upload" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[I recently encountered a bug in Movable Type where uploading a certain image failed with the message "Saving (filename) failed: Invalid image file format".  Some digging led me to the file lib/MT/Image.pm where the uploaded image was failing a check. &nbsp;This was in MT4, but some older versions of MT5 can also have this happening. &nbsp;So, what is going on?]]>
        <![CDATA[The check was added recently to protect against a vulnerability where HTML files disguised as images would be uploaded by hackers (this is dangerous because the hackers can then put all kinds of nasty scripts in your website to steal cookies etc.). &nbsp;The check looked for HTML tags in the first 1024 bytes of the uploaded file, and sure enough, the particular image I was trying to upload had the sequence &lt;a in it (which was perfectly valid and OK for an image file like a .gif, .jpg or .jpeg).<div><br /></div><div>Some further digging revealed that this bug&nbsp;<a href="https://movabletype.fogbugz.com/default.asp?103602">had already been addressed by Six Apart</a> in MT5.13, but it is still present in older versions and in MT4.</div><div><br /></div><div>If this bug is causing you trouble, either update to the latest version of MT5.x, or edit following lines in lib/MT/Image.pm</div><div><br /></div><div><table cellpadding="0" cellspacing="0" width="100%" style="border-style: initial; border-color: initial; font: inherit; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; line-height: 14px; background-color: rgb(248, 248, 255); "><tbody style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><tr data-position="4" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><td id="L0L90" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">90</td><td id="L0R89" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">&nbsp;</td><td width="100%" style="border-style: initial; border-color: initial; font: inherit; background-color: rgb(255, 255, 204); "><b class="add-bubble" remote="/movabletype/movabletype/commit_comment/form?commit_id=3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd&amp;path=lib%2FMT%2FImage.pm&amp;position=4&amp;line=90" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: -31px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; font-weight: bold; position: absolute; left: 0px; width: 30px; height: 14px; background-image: url(https://a248.e.akamai.net/assets.github.com/images/modules/comments/add_bubble.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; cursor: pointer; opacity: 1; -webkit-transition-property: opacity; -webkit-transition-duration: 0.1s; -webkit-transition-timing-function: linear; -webkit-transition-delay: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></b><pre style="margin-bottom: 0px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; line-height: 1.4; "><div class="gd" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font: inherit; color: rgb(0, 0, 0); ">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;$data&nbsp;=~&nbsp;m/&lt;(HTML|SCRIPT|TITLE|BODY|HEAD|PLAINTEXT|TABLE|IMG<span class="x" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font: inherit; background-color: rgb(255, 170, 170); ">|PRE|A</span>)/i&nbsp;)&nbsp;||</div></pre></td></tr><tr data-position="5" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><td id="L0L90" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">&nbsp;</td><td id="L0R90" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">90</td><td width="100%" style="border-style: initial; border-color: initial; font: inherit; "><b class="add-bubble" remote="/movabletype/movabletype/commit_comment/form?commit_id=3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd&amp;path=lib%2FMT%2FImage.pm&amp;position=5&amp;line=90" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: -31px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; font-weight: bold; position: absolute; left: 0px; width: 30px; height: 14px; background-image: url(https://a248.e.akamai.net/assets.github.com/images/modules/comments/add_bubble.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; cursor: pointer; opacity: 0; -webkit-transition-property: opacity; -webkit-transition-duration: 0.1s; -webkit-transition-timing-function: linear; -webkit-transition-delay: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></b><pre style="margin-bottom: 0px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; line-height: 1.4; "><div class="gi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 12px; font: inherit; color: rgb(0, 0, 0); background-color: rgb(221, 255, 221); ">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;$data&nbsp;=~&nbsp;m/&lt;(HTML|SCRIPT|TITLE|BODY|HEAD|PLAINTEXT|TABLE|IMG<span class="x" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font: inherit; background-color: rgb(170, 255, 170); ">&nbsp;|PRE|A&nbsp;</span>)/i&nbsp;)&nbsp;||</div></pre></td></tr><tr data-position="6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><td id="L0L91" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">91</td><td id="L0R91" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">91</td><td width="100%" style="border-style: initial; border-color: initial; font: inherit; "><b class="add-bubble" remote="/movabletype/movabletype/commit_comment/form?commit_id=3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd&amp;path=lib%2FMT%2FImage.pm&amp;position=6&amp;line=91" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: -31px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; font-weight: bold; position: absolute; left: 0px; width: 30px; height: 14px; background-image: url(https://a248.e.akamai.net/assets.github.com/images/modules/comments/add_bubble.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; cursor: pointer; opacity: 0; -webkit-transition-property: opacity; -webkit-transition-duration: 0.1s; -webkit-transition-timing-function: linear; -webkit-transition-delay: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></b><pre style="margin-bottom: 0px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; line-height: 1.4; "><div class="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 12px; font: inherit; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;$data&nbsp;=~&nbsp;m/text\/html/i&nbsp;)&nbsp;||</div></pre></td></tr><tr data-position="7" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><td id="L0L92" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">92</td><td id="L0R91" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">&nbsp;</td><td width="100%" style="border-style: initial; border-color: initial; font: inherit; "><b class="add-bubble" remote="/movabletype/movabletype/commit_comment/form?commit_id=3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd&amp;path=lib%2FMT%2FImage.pm&amp;position=7&amp;line=92" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: -31px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; font-weight: bold; position: absolute; left: 0px; width: 30px; height: 14px; background-image: url(https://a248.e.akamai.net/assets.github.com/images/modules/comments/add_bubble.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; cursor: pointer; opacity: 0; -webkit-transition-property: opacity; -webkit-transition-duration: 0.1s; -webkit-transition-timing-function: linear; -webkit-transition-delay: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></b><pre style="margin-bottom: 0px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; line-height: 1.4; "><div class="gd" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 12px; font: inherit; color: rgb(0, 0, 0); background-color: rgb(255, 221, 221); ">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;$data&nbsp;=~&nbsp;m/^\s*&lt;(FRAMESET|IFRAME|LINK|BASE|STYLE|DIV|P|FONT|APPLET)/i&nbsp;)&nbsp;||</div></pre></td></tr><tr data-position="8" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><td id="L0L93" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">93</td><td id="L0R91" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">&nbsp;</td><td width="100%" style="border-style: initial; border-color: initial; font: inherit; "><b class="add-bubble" remote="/movabletype/movabletype/commit_comment/form?commit_id=3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd&amp;path=lib%2FMT%2FImage.pm&amp;position=8&amp;line=93" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: -31px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; font-weight: bold; position: absolute; left: 0px; width: 30px; height: 14px; background-image: url(https://a248.e.akamai.net/assets.github.com/images/modules/comments/add_bubble.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; cursor: pointer; opacity: 0; -webkit-transition-property: opacity; -webkit-transition-duration: 0.1s; -webkit-transition-timing-function: linear; -webkit-transition-delay: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></b><pre style="margin-bottom: 0px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; line-height: 1.4; "><div class="gd" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 12px; font: inherit; color: rgb(0, 0, 0); background-color: rgb(255, 221, 221); ">-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;$data&nbsp;=~&nbsp;m/^\s*&lt;(APPLET|META|CENTER|FORM|ISINDEX|H[123456]|B|BR)/i&nbsp;)</div></pre></td></tr><tr data-position="9" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><td id="L0L93" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">&nbsp;</td><td id="L0R92" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">92</td><td width="100%" style="border-style: initial; border-color: initial; font: inherit; "><b class="add-bubble" remote="/movabletype/movabletype/commit_comment/form?commit_id=3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd&amp;path=lib%2FMT%2FImage.pm&amp;position=9&amp;line=92" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: -31px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; font-weight: bold; position: absolute; left: 0px; width: 30px; height: 14px; background-image: url(https://a248.e.akamai.net/assets.github.com/images/modules/comments/add_bubble.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; cursor: pointer; opacity: 0; -webkit-transition-property: opacity; -webkit-transition-duration: 0.1s; -webkit-transition-timing-function: linear; -webkit-transition-delay: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></b><pre style="margin-bottom: 0px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; line-height: 1.4; "><div class="gi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 12px; font: inherit; color: rgb(0, 0, 0); background-color: rgb(221, 255, 221); ">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;$data&nbsp;=~&nbsp;m/^\s*&lt;(FRAMESET|IFRAME|LINK|BASE|STYLE|DIV|FONT|APPLET)/i&nbsp;)&nbsp;||</div></pre></td></tr><tr data-position="10" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; "><td id="L0L93" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">&nbsp;</td><td id="L0R93" class="line_numbers linkable-line-number" style="padding-right: 0.5em; padding-left: 0.5em; border-right-width: 1px; border-style: initial; border-color: initial; font: inherit; cursor: pointer; background-color: rgb(236, 236, 236); color: rgb(170, 170, 170); text-align: right; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; -webkit-user-select: none; ">93</td><td width="100%" style="border-style: initial; border-color: initial; font: inherit; "><b class="add-bubble" remote="/movabletype/movabletype/commit_comment/form?commit_id=3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd&amp;path=lib%2FMT%2FImage.pm&amp;position=10&amp;line=93" style="margin-top: 3px; margin-right: 0px; margin-bottom: 0px; margin-left: -31px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 10px; font: inherit; font-weight: bold; position: absolute; left: 0px; width: 30px; height: 14px; background-image: url(https://a248.e.akamai.net/assets.github.com/images/modules/comments/add_bubble.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; cursor: pointer; opacity: 0; -webkit-transition-property: opacity; -webkit-transition-duration: 0.1s; -webkit-transition-timing-function: linear; -webkit-transition-delay: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "></b><pre style="margin-bottom: 0px; border-style: initial; border-color: initial; font: inherit; font-family: 'Bitstream Vera Sans Mono', 'Courier New', monospace; line-height: 1.4; "><div class="gi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; font-size: 12px; font: inherit; color: rgb(0, 0, 0); background-color: rgb(221, 255, 221); ">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(&nbsp;$data&nbsp;=~&nbsp;m/^\s*&lt;(APPLET|META|CENTER|FORM|ISINDEX|H[123456]|BR)/i&nbsp;)</div></pre></td></tr></tbody></table></div><div><br /></div><div>Source:&nbsp;<a href="https://github.com/movabletype/movabletype/commit/3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd#lib/MT/Image.pm">https://github.com/movabletype/movabletype/commit/3b18da6f7e1cd4adb3ad0a5ca7fafee1eb03d5dd#lib/MT/Image.pm</a></div>]]>
    </content>
</entry>

<entry>
    <title>Six Apart Releases Movable Type 5.13, 5.07, and 4.38 Security Updates</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/02/six-apart-releases-movable-type-513-507-and-438-security-updates.html" />
    <id>tag:www.movabletips.com,2012://2.1798</id>

    <published>2012-02-22T09:14:19Z</published>
    <updated>2012-02-22T12:47:07Z</updated>

    <summary><![CDATA[The official announcement is here. &nbsp;The upgrade is mandatory if you want to keep up with security fixes. &nbsp;Note: it looks like this update is not just a simple drop-in-and-run-the-upgrader affair, but there are changes to several javascript and other...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Movable Type News" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Security" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="438" label="4.38" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="507" label="5.07" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="513" label="5.13" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="fixes" label="fixes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="javascript" label="javascript" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mandatory" label="mandatory" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="security" label="security" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="templates" label="templates" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="upgrade" label="upgrade" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[The official announcement is <a href="http://www.movabletype.org/2012/02/movable_type_513_507_and_438_security_updates.html">here</a>. &nbsp;The upgrade is mandatory if you want to keep up with security fixes. &nbsp;Note: it looks like this update is not just a simple drop-in-and-run-the-upgrader affair, but there are<a href="http://www.movabletype.org/documentation/upgrade/template-changes-in-movable-type-513-507-and-438.html"> changes to several javascript and other templates</a> as well. &nbsp;If you are (mostly) using the default templates this should be quite easy to deal with by refreshing the templates in question. &nbsp;If you are using customized versions of these templates it looks like you need to do some manual editing to avoid comments etc. breaking on the new version.]]>
        <![CDATA[Some notable fixes and additions:<div><ul><li>Stronger password encryption options (in older versions, Movable Type only looked at the first eight characters of the password when logging in)</li><li>More options for setting password guidelines (minimum lenght, must contain letters, numbers...)</li><li>Better protection against brute force attempts with automatic lockout of accounts if too many wrong login attempts are made</li><li>More protection against uploading of malicious files by users</li></ul></div>]]>
    </content>
</entry>

<entry>
    <title>Fixing Movable Type Error: &quot;Can&apos;t call method &apos;label&apos; on an undefined value&quot;</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/02/fixing-movable-type-error-cant-call-method-label-on-an-undefined-value.html" />
    <id>tag:www.movabletips.com,2012://2.1793</id>

    <published>2012-02-20T13:54:37Z</published>
    <updated>2012-02-20T14:17:32Z</updated>

    <summary>If you ever see the error message &quot;Can&apos;t call method &apos;label&apos; on an undefined value&quot; in Movable Type while publishing one or more entries, here is what the problem (probably) is and a solution....</summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Error Messages" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cantcallmethod" label="can&apos;t call method" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="categories" label="categories" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="category" label="category" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="error" label="error" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="errormessages" label="error messages" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="label" label="label" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt_placement" label="mt_placement" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="placement" label="placement" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sql" label="sql" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        If you ever see the error message &quot;Can&apos;t call method &apos;label&apos; on an undefined value&quot; in Movable Type while publishing one or more entries, here is what the problem (probably) is and a solution.
        <![CDATA[<b>What is going on?</b><div>While publishing entries, Movable Type is loading them one by one from the database, along with all relevant information about them. &nbsp;One of the things Movable Type tries to load is the categories the entry belongs to. &nbsp;This is done by first loading &nbsp;the so-called 'Placement Records' that refer to the entry. &nbsp;Basically these are just snippets of information saying: "Entry X of blog Y belongs in category Z". &nbsp;Once the placement records for an entry have been loaded, Movable Type tries to get more information about the categories, basically by looking up "Category Z" in this case and fetching all available information about it.</div><div><br /></div><div><b>Why the error?</b></div><div>Internally, categories all have a number in Movable Type, and it is by this number that the placement records and category information identify the category. &nbsp;When publishing an entry in a specific category, one of the first things that Movable Type needs to know is the 'label' of the category, i.e. the textual representation of the category name (for example: 'Sports', or 'Current affairs'...).</div><div><br /></div><div>But what happens if there is a placement record saying an entry belongs to a category, say represented by the number 123, but there is no record of a category with number 123 in the system? &nbsp;When Movable Type tries to load the label, an error occurs:&nbsp;"Can't call method 'label' on an undefined value". &nbsp;The 'undefined value' in this case is the category information that was not found, and the 'label' is what Movable Type was trying to read from it.</div><div><br /></div><div><b>How to fix?</b></div><div>If you get this error, it means the database table containing the placement records has somehow gotten out of whack: there are now one (or more) records assigning entries to categories that don't exist (anymore). &nbsp;This can happen when you have just deleted or renamed one or more categories and the process was not fully completed somehow,</div><div><br /></div><div>The only way to fix it is by directly editing your database. &nbsp;You should not attempt this if you are not familiar with SQL commands/databases, and especially not if you haven't made a backup first.</div><div><br /></div><div>First, run this query to find out which placement records point to non-existent categories:</div><div><br /></div><div><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">SELECT</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_punct" style="color: fuchsia; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">*</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><br style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); " /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">FROM</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_quote syntax_quote_backtick" style="color: rgb(0, 128, 0); white-space: pre; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">`mt_placement`</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><br style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); " /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">LEFT</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">JOIN</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">mt_category</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">ON</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_punct syntax_punct_bracket_open_round" style="color: fuchsia; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">(</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">placement_category_id</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_punct" style="color: fuchsia; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">=</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">category_id</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_punct syntax_punct_bracket_close_round" style="color: fuchsia; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">)</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><br style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); " /><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">WHERE</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">category_id</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">IS</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">NULL;</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span>
</div><div><br /></div><div>If this returns one or more lines, you have placement records pointing to categories that don't occur in the mt_categories table. &nbsp;By looking at the blog_id and entry_id columns in the results you can identify the entries that have a publishing problem. &nbsp;If it looks like the entries that are mentioned are indeed the ones giving you trouble, proceed with this query:</div><div><br /></div><div><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">DELETE</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">mt_placement</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">FROM</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_quote syntax_quote_backtick" style="color: rgb(0, 128, 0); white-space: pre; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">`mt_placement`</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">LEFT</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">JOIN</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">mt_category</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">ON</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_punct syntax_punct_bracket_open_round" style="color: fuchsia; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">(</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">placement_category_id</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_punct" style="color: fuchsia; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">=</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">category_id</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_punct syntax_punct_bracket_close_round" style="color: fuchsia; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">)</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">WHERE</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_identifier" style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">category_id</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">IS</span><span style="color: rgb(0, 0, 0); font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">&nbsp;</span><span class="syntax_alpha syntax_alpha_reservedWord" style="color: rgb(153, 0, 153); text-transform: uppercase; font-weight: bold; font-family: sans-serif; font-size: 10px; text-align: -webkit-left; background-color: rgb(229, 229, 229); ">NULL</span>
</div><div><br /></div><div>This removes the offending records, and publishing should now work again.</div>]]>
    </content>
</entry>

<entry>
    <title>Displaying YouTube or Vimeo Thumbnails in Movable Type</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/01/displaying-youtube-or-vimeo-thumbnails-in-movable-type.html" />
    <id>tag:www.movabletips.com,2012://2.1744</id>

    <published>2012-01-05T15:57:08Z</published>
    <updated>2012-01-30T09:34:24Z</updated>

    <summary>On a recent project I had a Movable Type blog with entries containing embedded videos hosted on YouTube and Vimeo, and I needed a way to get a thumbnail image for each video so they could be displayed somewhere else...</summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tricks and Workarounds" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="embed" label="embed" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iframe" label="iframe" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="template" label="template" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="thumbnail" label="thumbnail" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="thumbnails" label="thumbnails" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="trick" label="trick" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="video" label="video" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vimeo" label="Vimeo" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="youtube" label="YouTube" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[On a recent project I had a Movable Type blog with entries containing embedded videos hosted on YouTube and Vimeo, and I needed a way to get a thumbnail image for each video so they could be displayed somewhere else on the site. &nbsp;Here is my solution...]]>
        <![CDATA[<div><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; "><div style="color: rgb(51, 51, 51); font-family: arial, helvetica, hirakakupro-w3, osaka, 'ms pgothic', sans-serif; line-height: normal; white-space: normal; ">This bit of template code can be included in an &lt;mt:entries&gt; loop or in the body of any entry.</div><br class="Apple-interchange-newline" /></span></div><div><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:var name="thumbnailurl" value=""&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:var name="thumbfound" value=""&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><font color="#aa7700" face="monospace"><span style="line-height: 16px; white-space: nowrap;"><br /></span></font><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:if tag="entrybody" like="http\:\/\/www\.youtube\.com\/embed\/"&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:entrybody regex_replace="/.*http\:\/\/www\.youtube\.com\/embed\/(.+?).\s.*/s","$1" setvar="youtubeid"&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:setvarblock name="thumbnailurl"&gt;</span><span class="xml-text" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">http://img.youtube.com/vi/</span><span class="js-operator" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;</span><span class="js-variable" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">mt</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">:</span><span class="js-keyword" style="color: rgb(119, 0, 136); font-family: monospace; line-height: 16px; white-space: nowrap; ">var&nbsp;</span><span class="js-variable" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">name</span><span class="js-operator" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">=</span><span class="js-string" style="color: rgb(170, 34, 34); font-family: monospace; line-height: 16px; white-space: nowrap; ">"youtubeid"</span><span class="js-operator" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">&gt;</span><span class="js-string" style="color: rgb(170, 34, 34); font-family: monospace; line-height: 16px; white-space: nowrap; ">/0.jpg&lt;/</span><span class="js-variable" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">mt</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">:</span><span class="js-variable" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">setvarblock</span><span class="js-operator" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;/mt:if&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:if tag="entrybody" like="http\:\/\/vimeo\.com"&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">script</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="js-keyword" style="color: rgb(119, 0, 136); font-family: monospace; line-height: 16px; white-space: nowrap; ">function&nbsp;</span><span class="js-variable" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">showThumb</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">(</span><span class="js-variabledef" style="color: rgb(0, 0, 255); font-family: monospace; line-height: 16px; white-space: nowrap; ">data</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">)</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">{</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="whitespace" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">&nbsp; &nbsp;&nbsp;</span><span class="js-variable" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">document</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">.</span><span class="js-property" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">getElementById</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">(</span><span class="js-string" style="color: rgb(170, 34, 34); font-family: monospace; line-height: 16px; white-space: nowrap; ">'thumb-&lt;mt:entryid&gt;'</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">)</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">.</span><span class="js-property" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">src&nbsp;</span><span class="js-operator" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">=&nbsp;</span><span class="js-localvariable" style="color: rgb(0, 68, 153); font-family: monospace; line-height: 16px; white-space: nowrap; ">data</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">[</span><span class="js-atom" style="color: rgb(34, 136, 17); font-family: monospace; line-height: 16px; white-space: nowrap; ">0</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">]</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">.</span><span class="js-property" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">thumbnail_medium</span><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="js-punctuation" style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; ">}</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">script</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:entrybody regex_replace="/.*http\:\/\/vimeo\.com\/(\d+).*/s","$1" setvar="vimeoid"&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">script&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); font-family: monospace; line-height: 16px; white-space: nowrap; ">type</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); font-family: monospace; line-height: 16px; white-space: nowrap; ">"text/javascript"&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); font-family: monospace; line-height: 16px; white-space: nowrap; ">src</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); font-family: monospace; line-height: 16px; white-space: nowrap; ">"http://vimeo.com/api/v2/video/&lt;mt:var name="</span><span class="xml-attname" style="color: rgb(0, 0, 255); font-family: monospace; line-height: 16px; white-space: nowrap; ">vimeoid</span><span class="xml-attribute xml-error" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">"&gt;.json?callback=showThumb"</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&gt;</span></div><div><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">script</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;/mt:if&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;mt:if name="thumbfound"&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">img&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); font-family: monospace; line-height: 16px; white-space: nowrap; ">src</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); font-family: monospace; line-height: 16px; white-space: nowrap; ">"&lt;mt:var name="</span><span class="xml-attname" style="color: rgb(0, 0, 255); font-family: monospace; line-height: 16px; white-space: nowrap; ">thumbnailurl</span><span class="xml-attribute xml-error" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">"&gt;"&nbsp;</span><span class="xml-name xml-error" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">id</span><span class="xml-punctuation xml-error" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">=</span><span class="xml-attribute xml-error" style="color: rgb(170, 0, 187); font-family: monospace; line-height: 16px; white-space: nowrap; ">"thumb-&lt;mt:entryid&gt;"</span><span class="xml-punctuation" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">&gt;</span><br style="color: rgb(102, 102, 102); font-family: monospace; line-height: 16px; white-space: nowrap; " /><span class="mt-tag" style="color: rgb(170, 119, 0); font-family: monospace; line-height: 16px; white-space: nowrap; ">&lt;/mt:if&gt;</span><span class="xml-text" style="color: black; font-family: monospace; line-height: 16px; white-space: nowrap; ">​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​</span>
</div><div><br /></div><div>The first lines simply reset some variables, nothing special there.</div><div><br /></div><div>The next block uses some regular expression magic to get the ID of an embedded YouTube video (if the post contains one) and attaches it to a fixed URL at YouTube which then magically becomes a link to the correct thumbnail. &nbsp;Quite easy actually.</div><div><br /></div><div>For Vimeo, things are a bit more complex: thumbnails have no fixed URL structure, so you have to use Vimeo's API to get it. &nbsp;Fortunately they provide a handy javascript version of their API. &nbsp;In order to use it we first define a little function called 'ShowThumb' that will receive some 'data', and one of the bits of data it will receive is the URL of the thumbnail. &nbsp;We use that to change the 'src' attribute of an element on the page with the id 'thumb-xyz', where xyz is the ID of the entry. &nbsp;Next we call the Vimeo API, which calls the showThumb function we just defined and provides it with the correct data.</div><div><br /></div><div>In the end, if we found a video embed, we show an image with the correct 'src' set (if it is a YouTube video) or with the right id so the showThumb function can set it (for Vimeo).</div><div><br /></div><div>And that is all there is to it, really :-)</div><div><br /></div>]]>
    </content>
</entry>

<entry>
    <title>Dan Wolfgang Releases Spectacular &apos;Patrick&apos; Theme for Movable Type</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/01/dan-wolfgang-releases-spectacular-patrick-theme-for-movable-type.html" />
    <id>tag:www.movabletips.com,2012://2.1742</id>

    <published>2012-01-05T10:57:19Z</published>
    <updated>2012-01-05T11:34:41Z</updated>

    <summary><![CDATA[Dan from eatdrinksleepmovabletype.com has released&nbsp;a new theme for Movable Type and Melody called&nbsp;'Patrick'. &nbsp;It sports an impressive 13 settings screens that let you change everything, from colours, columns, labels, headers and footers, but also if (and how) to display Facebook...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Melody" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Templates" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="danwolfgang" label="Dan Wolfgang" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="eatdrinksleepmovabletype" label="eatdrinksleepmovabletype" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="melody" label="Melody" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="patrick" label="Patrick" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugin" label="plugin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugins" label="plugins" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="template" label="template" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="theme" label="theme" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[Dan from <a href="http://eatdrinksleepmovabletype.com">eatdrinksleepmovabletype.com</a> has <a href="http://eatdrinksleepmovabletype.com/plugins/theme_patrick/">released</a>&nbsp;a new theme for Movable Type and Melody called&nbsp;<a href="https://github.com/danwolfgang/melody-theme-patrick">'Patrick'</a>. &nbsp;It sports an impressive 13 settings screens that let you change everything, from colours, columns, labels, headers and footers, but also if (and how) to display Facebook comments, Twitter integration, highlighted entries, and much, much more.]]>
        <![CDATA[<div>It quite reminds me of TypePad's design editor, but with more features. &nbsp;Looks like this theme is a great way to quickly set up an unique design without needing to bother too much with template code, HTML or CSS. &nbsp;Sounds great for novice users. &nbsp;On the other hand, I think installing all the prerequisites might take some time, especially for novice users. &nbsp;But once you have it up and running on your installation, looks like you can just bang out one completely different blog after another without breaking a sweat. &nbsp;Cool!</div><div><br /></div>The theme is compatible with Melody and Movable Type 4.x (if you install a number of plugins). &nbsp;It can be downloaded <a href="https://github.com/danwolfgang/melody-theme-patrick">here</a>.]]>
    </content>
</entry>

<entry>
    <title>Best wishes for 2012!</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2012/01/best-wishes-for-2012.html" />
    <id>tag:www.movabletips.com,2012://2.1740</id>

    <published>2012-01-05T10:51:18Z</published>
    <updated>2012-01-05T10:55:15Z</updated>

    <summary>Among my resolutions for the new year: be more active in updating this site again......</summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        Among my resolutions for the new year: be more active in updating this site again...
        
    </content>
</entry>

<entry>
    <title>FacebookCommenters Plugin Broken, but Fix will be in MT5.13/4.38</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2011/11/facebookcommenters-plugin-broken-but-fix-will-be-in-mt513438.html" />
    <id>tag:www.movabletips.com,2011://2.1683</id>

    <published>2011-11-10T10:11:14Z</published>
    <updated>2012-01-25T04:33:55Z</updated>

    <summary><![CDATA[The error "Error saving plugin settings: Could not register story template with Facebook: Unknown method" has been popping up more and more among users of the FacebookCommenters plugin for Movable Type. &nbsp;The cause is a change to the API at...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Movable Type News" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Plugins" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Tricks and Workarounds" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="438" label="4.38" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="513" label="5.13" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="facebook" label="Facebook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="facebookcommenters" label="FacebookCommenters" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugin" label="plugin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugins" label="plugins" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[The error "<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Arial, Verdana, sans-serif; font-size: 12px; line-height: 16px; ">Error saving plugin settings: Could not register story template with Facebook: Unknown method" has been <a href="http://forums.movabletype.org/2011/11/does-facebook-connect-work-with-mt-437.html">popping up more and more</a> among users of the FacebookCommenters plugin for Movable Type. &nbsp;The cause is a change to the API at Facebook. &nbsp;Six Apart is aware of the issue (check the <a href="https://movabletype.fogbugz.com/default.asp?106683#568050">Fogbugz ticket here</a> if you have access) and a fix has been committed but not released yet. &nbsp; I have been told the updated version of FacebookCommenters will be bundled with the upcoming Movable Type 5.13/4.38 release.</span>]]>
        
    </content>
</entry>

<entry>
    <title>New Ebook about Movable Type</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2011/10/new-ebook-about-movable-type.html" />
    <id>tag:www.movabletips.com,2011://2.1673</id>

    <published>2011-10-31T09:36:37Z</published>
    <updated>2012-04-10T01:45:15Z</updated>

    <summary><![CDATA[I recently came across the blog of Sebastian Kleine, a German PHP coder. &nbsp;He wrote he recently had to use Movable Type for a work-related project, but couldn't find any good (recent) introductory books so he decided to write one...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Movable Type News" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="amazon" label="Amazon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="documentation" label="documentation" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ebook" label="ebook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="introduction" label="introduction" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="manual" label="manual" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sebastiankleine" label="Sebastian Kleine" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[I recently came across <a href="http://blog.sebastiankleine.de">the blog of Sebastian Kleine</a>, a German PHP coder. &nbsp;He wrote<a href="http://blog.sebastiankleine.de/archives/106-Ebook-about-Movable-Type.html"> he recently had to use Movable Type for a work-related project</a>, but couldn't find any good (recent) introductory books so he decided to write one himself. &nbsp;The result is <a href="http://www.amazon.de/gp/product/B005VTB090/ref=as_li_tf_tl?ie=UTF8&amp;tag=kleineweb-21&amp;linkCode=as2&amp;camp=1638&amp;creative=6742&amp;creativeASIN=B005VTB090">an ebook available from Amazon, titled 'Blogging with Movable Type'</a>. &nbsp;I haven't read it myself, but he describes it as:]]>
        <![CDATA[<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; ">This ebook is a must have introduction to the blogging system Movable Type. It covers the basic topics starting with an introduction to what Movable Type is. It also handles the installation and configuration process. You can learn about how to create static pages and blog entries. It also gives hints about categorization and tagging and how to upload images and other files and add them to your blog entry.</span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; "><br /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; ">Another important topic is themes, design and templates. This ebook describes the basics and shows how to customize and improve your own theme. It also explains the different ways of publishing your content.</span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; "><br /></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: verdana, arial, helvetica, sans-serif; font-size: small; ">This ebook is no complete reference, but gives a good introduction to Movable Type.</span></div></blockquote><div><br /></div><div>It sure sounds like it could be a good introduction for beginners, and people who need more information can always check the (free) manual at&nbsp;<a href="http://www.movabletype.org/documentation/">http://www.movabletype.org/documentation/</a>&nbsp;later.</div>]]>
    </content>
</entry>

<entry>
    <title>One Decade of Movable Type</title>
    <link rel="alternate" type="text/html" href="http://www.movabletips.com/2011/10/one-decade-of-movable-type.html" />
    <id>tag:www.movabletips.com,2011://2.1633</id>

    <published>2011-10-10T18:40:46Z</published>
    <updated>2011-11-23T12:40:55Z</updated>

    <summary><![CDATA[I missed it because I was abroad, but last saturday was Movable Type's 10th birthday. &nbsp;To celebrate, Six Apart has posted some stats about the recent development activity and a picture of a lovely birthday cake. &nbsp;Happy birthday MT! &nbsp;You...]]></summary>
    <author>
        <name>Maarten Schenk</name>
        <uri>http://www.movabletips.com</uri>
    </author>
    
        <category term="Movable Type News" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="10years" label="10 years" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="anniversary" label="Anniversary" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype51" label="movable type 5.1" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sixapart" label="Six Apart" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.movabletips.com/">
        <![CDATA[I missed it because I was abroad, but last saturday was Movable Type's 10th birthday. &nbsp;To celebrate, Six Apart has posted <a href="http://www.movabletype.org/2011/10/status_of_movable_type_development.html">some stats about the recent development activity and a picture of a lovely birthday cake</a>. &nbsp;Happy birthday MT! &nbsp;You certainly changed my life.]]>
        <![CDATA[On october 8th 2001, I was still working at <a href="http://www.skynet.be">Skynet</a> (a Belgian ISP/portal site) and had just discovered what blogs were in the aftermath of 9/11. &nbsp;This lead to my proposal to the CEO some time later that Skynet should have a blogging service, which became <a href="http://www.skynetblogs.be">skynetblogs.be</a>, the first Dutch language blogging service in Belgium. &nbsp;This in turn lead to me meeting <a href="http://loiclemeur.com/english/">Loic Le Meur</a>, who hired me at Six Apart Europe to do support on TypePad (which is heavily related to MT) in Europe, and later on work on MT projects &amp; support as well. &nbsp;During that time I worked for many clients who had diverse MT installations, and I'm happy to say that I still work for many of them since starting my own MT services company <a href="http://www.yesitcan.be">YesItCan.be</a> in early 2010.<div><br /></div><div>I wish MT the best for the future, and I'm looking forward to many more versions!</div>]]>
    </content>
</entry>

</feed>

