<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Mcavity</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/" />
    <link rel="self" type="application/atom+xml" href="http://www.mcavity.com/atom.xml" />
    <id>tag:www.mcavity.com,2010-04-07://7</id>
    <updated>2010-07-11T16:16:50Z</updated>
    <subtitle>Ramblings in MovableType and elsewhere</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.34-en</generator>

<entry>
    <title>Variable Interpolation</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/configuration/variable_interpolation.php" />
    <id>tag:www.mcavity.com,2010://7.51</id>

    <published>2010-07-11T14:35:38Z</published>
    <updated>2010-07-11T16:16:50Z</updated>

    <summary>A thing of beauty, this thing called Variable Interpolation</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="configuration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="blogs" label="blogs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt4" label="MT4" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="multiblog" label="multiblog" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="variableinterpolation" label="variable interpolation" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="variables" label="variables" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="websites" label="websites" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p><a href="http://www.movabletype.org/" title="Movable Type">MovableType</a> has this incredibly beautiful thing called <a href="http://www.movabletype.org/documentation/designer/variable-interpolation.html" title="Everything you always wanted to know about variable interpolation but didn't know where to look">variable interpolation</a>. As I understand it, what this means is that you can define a <a href="http://www.movabletype.org/documentation/appendices/tags/var.html" title="Variable tags">variable</a> somewhere and then reference it at another place altogether. You can even use it to supply a value for a <a href="http://www.movabletype.org/documentation/appendices/modifiers/" title="template tag modifiers">template tag modifier</a>, another variable, or a value for a template tag if the tag takes one.</p>
]]>
        <![CDATA[<p>Let&#8217;s look at an example, used on this <a href="http://www.mcavity.com/" title="Mcavity.com">very site</a>, its siblings and <a href="http://www.gautampatel.com/" title="Gautam Patel home page">parent</a>. Here&#8217;s the set up, all on a single box at the same webhost. A single MT installation. There&#8217;s the parent site, <a href="http://www.gautampatel.com/" title="Gautam Patel home page">gautampatel.com</a>. Beneath that there are four existing blogs, including <a href="http://www.mcavity.com/" title="Mcavity.com">this one</a>, and more are planned. The parent site has no entries of its own; it only pulls content from the subsidiary blogs. Each sub-blog has its own distinctive URL, too, a full-fledged domain name correctly mapped. </p>

<p>Thus:</p>

<p><center>
<img src="http://www.mcavity.com/pics/VarI-BlogStructure.png" width="350" border="0"/></a>
</center></p>

<p>Each blog, including the parent is individually styled. The styles of the sub-blogs do not reflect on the parent blog.</p>

<p>Evidently, each blog has its own URL, path and blogid. I need to identify all of these separately and then cobble all the ids together, separated by commas, so I can use <a href="http://www.movabletype.org/documentation/appendices/tags/multiblog.html" title="Multiblog">Multiblog</a> and <a href="http://www.movabletype.org/documentation/appendices/tags/template-tag-types.html#search" title="Search">Search</a> effectively.</p>

<p>Up in the parent blog, I create a template module called <strong>System Head</strong>. It looks <a href='#sysheadcode' class='lightview' title="The Sys Head :: Code :: topclose: true">like this</a>.       </p>

<div id="sysheadcode" style="display:none;">
<pre><code>
&lt;mt:multiblog include_blogs=&quot;all&quot;&gt;
&lt;mt:if tag=&quot;blogname&quot; like=&quot;(Gautam)&quot;&gt;
    &lt;mt:blogid setvar=&quot;GPID&quot;&gt;
    &lt;mt:blogname setvar=&quot;GPName&quot;&gt;
    &lt;mt:blogurl setvar=&quot;GPURL&quot;&gt;
&lt;mt:elseif tag=&quot;blogname&quot; like=&quot;(Bibliophage)&quot;&gt;
    &lt;mt:blogid setvar=&quot;BibID&quot;&gt;
    &lt;mt:blogname setvar=&quot;BibName&quot;&gt;
&lt;mt:elseif tag=&quot;blogname&quot; like=&quot;(Chronicles)&quot;&gt;
    &lt;mt:blogid setvar=&quot;COWTID&quot;&gt;
    &lt;mt:blogname setvar=&quot;COWTName&quot;&gt;
&lt;mt:elseif tag=&quot;blogname&quot; like=&quot;(Mcavity)&quot;&gt;
    &lt;mt:blogid setvar=&quot;McavityID&quot;&gt;
    &lt;mt:blogname setvar=&quot;McavityName&quot;&gt;
&lt;mt:elseif tag=&quot;blogname&quot; like=&quot;(Prisoner)&quot;&gt;
    &lt;mt:blogid setvar=&quot;PoAID&quot;&gt;
    &lt;mt:blogname setvar=&quot;PoAName&quot;&gt;
&lt;mt:elseif tag=&quot;blogname&quot; like=&quot;(Silva)&quot;&gt;
    &lt;mt:blogid setvar=&quot;SilvaID&quot;&gt;
    &lt;mt:blogname setvar=&quot;SilvaName&quot;&gt;
&lt;/mt:if&gt;
&lt;/mt:multiblog&gt;
&lt;mt:Blogs exclude_blogs=&quot;$GPID&quot;&gt;
    &lt;mt:setvarblock name=&quot;ThisID&quot;&gt;&lt;mt:blogid&gt;&lt;/mt:setvarblock&gt;
    &lt;mt:Var name=&quot;btpush&quot; function=&quot;push&quot; value=&quot;$ThisID&quot;&gt;
&lt;/mt:blogs&gt;
&lt;mt:setvarblock name=&quot;bti&quot;&gt;&lt;mt:Loop name=&quot;btpush&quot; glue=&quot;,&quot;&gt;&lt;mt:Var name=&quot;__value__&quot;&gt;&lt;/mt:Loop&gt;&lt;/mt:setvarblock&gt;
&lt;mt:setvarblock name=&quot;allsearch&quot;&gt;&lt;mt:Loop name=&quot;btpush&quot; glue=&quot;,&quot;&gt;&lt;mt:Var name=&quot;__value__&quot;&gt;&lt;/mt:Loop&gt;&lt;/mt:setvarblock&gt;
&lt;mt:setvarblock name=&quot;allblogs&quot;&gt;&lt;mt:var name=&quot;bti&quot;&gt;&lt;/mt:setvarblock&gt;

</code></pre>
</div>

<p>Here&#8217;s a line-by-line explanation:</p>

<pre><code>    &lt;mt:multiblog include_blogs="all"&gt;
</code></pre>

<p>This sets the <a href="http://www.movabletype.org/documentation/appendices/tags/multiblog.html" title="Multiblog">Multiblog</a> block to look at <em>all</em> the blogs in the system.</p>

<pre><code>    &lt;mt:if tag="blogname" like="(Gautam)"&gt;
</code></pre>

<p>This uses a <a href="http://www.movabletype.org/documentation/appendices/tags/template-tag-types.html#logic" title="Logic Tags">logic tag</a>, <a href="http://www.movabletype.org/documentation/appendices/tags/if.html" title="MT:if">if</a>, and, as Multiblog cycles through the blogs, the logic tag tests whether a certain condition is true using a simple <a href="http://www.movabletype.org/documentation/appendices/tags/if.html" title="MT:if">regular expression</a>.</p>

<p>Next, if the condition is true, use the <a href="http://www.movabletype.org/documentation/appendices/tags/setvar.html" title="SetVar tag">setvar</a> tag to set a bunch of variables: the blogid, the blogname, the blogurl. There&#8217;s an easier way of doing this in one go, using <a href="http://www.movabletype.org/documentation/appendices/tags/setvars.html" title="Setvars tag"><setvars></a>; I&#8217;ve just stuck with this.</p>

<pre><code>        &lt;mt:blogid setvar="GPID"&gt;
        &lt;mt:blogname setvar="GPName"&gt;
        &lt;mt:blogurl setvar="GPURL"&gt;
</code></pre>

<p>Then you repeat the condition test and setting of variables for all blogs in the system.            </p>

<pre><code>    &lt;mt:elseif tag="blogname" like="(Bibliophage)"&gt;
        &lt;mt:blogid setvar="BibID"&gt;
        &lt;mt:blogname setvar="BibName"&gt;
    &lt;mt:elseif tag="blogname" like="(Chronicles)"&gt;
        &lt;mt:blogid setvar="COWTID"&gt;
        &lt;mt:blogname setvar="COWTName"&gt;
    &lt;mt:elseif tag="blogname" like="(Mcavity)"&gt;
        &lt;mt:blogid setvar="McavityID"&gt;
        &lt;mt:blogname setvar="McavityName"&gt;
    ... etc  
    &lt;/mt:if&gt;
</code></pre>

<p>Now, for the search and other things, I want a listing of all blogs <em>except</em> the parent blog. So I do this.</p>

<pre><code>    &lt;mt:Blogs exclude_blogs="$GPID"&gt;
        &lt;mt:setvarblock name="ThisID"&gt;&lt;mt:blogid&gt;&lt;/mt:setvarblock&gt;
        &lt;mt:Var name="btpush" function="push" value="$ThisID"&gt;
    &lt;/mt:blogs&gt;
</code></pre>

<p>Note the <a href="http://www.movabletype.org/documentation/designer/variable-interpolation.html" title="Everything you always wanted to know about variable interpolation but didn't know where to look">variable interpolation</a>. I used <code>$GPID</code> to pull the blogid of the parent blog from the variable I set earlier, and I excluded that. By the way, as far as I know, <a href="http://www.movabletype.org/documentation/appendices/tags/blogs.html" title="MT:Blogs tag"><code>&lt;mt:blogs&gt;</code></a> is the same thing as <code>&lt;mt:multiblog&gt;</code>. </p>

<p>I also used <a href="http://www.movabletype.org/documentation/appendices/tags/setvarblock.html" title="Setvarblock"><code>&lt;mt:setvarblock&gt;</code></a> here because I was doing this that the <code>&lt;setvar&gt;</code> tag cannot do; I was pulling a value from another tag. </p>

<p><strong>Note</strong>: Be careful using <code>&lt;mt:setvarblock&gt;</code>. You should have everything between the opening and closing tags in one line, because otherwise it inserts linefeeds (naturally; it&#8217;s doing a <em>block</em>). Alternatively, you can use the <code>strip_linefeeds="1"</code> modifier, so:</p>

<pre><code>    &lt;mt:setvarblock name="ThisID" strip_linefeeds="1"&gt;
</code></pre>

<p>What this block does is that it loops through all the blogs in the system <em>except</em> the parent blog, pulls their blogids, and stashes them in an array (that&#8217;s the <code>function=&amp;quot;push&amp;quot;</code> thing you see there. Again, note the variable interpolation. </p>

<p>Here&#8217;s the fun part. I now call that array, using the <a href="http://www.movabletype.org/documentation/appendices/tags/loop.html" title="MT:loop"><code>&lt;mt:loop&gt;</code></a> tag, get the values for each item in the array and stock them into another array.</p>

<pre><code>    &lt;mt:setvarblock name="bti"&gt;
        &lt;mt:Loop name="btpush" glue=","&gt;     
            &lt;mt:Var name="__value__"&gt;
        &lt;/mt:Loop&gt;
    &lt;/mt:setvarblock&gt;
</code></pre>

<p>The next lines are a redundancy. Just laziness.</p>

<pre><code>    &lt;mt:setvarblock name="allsearch"&gt;
        &lt;mt:Loop name="btpush" glue=","&gt;       
            &lt;mt:Var name="__value__"&gt;
        &lt;/mt:Loop&gt;
    &lt;/mt:setvarblock&gt;        
    &lt;mt:setvarblock name="allblogs"&gt;
        &lt;mt:var name="bti"&gt;
    &lt;/mt:setvarblock&gt;
</code></pre>

<p>Now I need to use all or any of these variable anywhere in the system. So what I do is that I link the <strong>System Head</strong> template module to a file on my system. Something like <code>mod_syshead.mtml</code> or whatever. Then, in the each sub-blog, I recreate a copy of the System Head module (pointing it to the file&#8217;s original location; I don&#8217;t make multiple copies of these files); and then add a line to the top of the <strong>HTML Head</strong> template module &#8212; it has to be right at the top, by the way &#8212; invoking the <strong>System Head</strong> template module.</p>

<p>So in the Mcavity sub-blog, the <strong>HTML Head</strong> template module has this line at the very top:</p>

<pre><code>    &lt;mt:include module="System Head"&gt;
</code></pre>

<p>That way each sub-blog operates with the same set of variables. And I can use these variables to identify which blogs should be searched, or to use a variable like <code>GPURL</code> to reference a location under the parent website, like so:</p>

<pre><code>    &lt;mt:var name="GPURL"&gt;/images/mynicepic.jpg
</code></pre>

<p>Whew! Long explanation for something so seemingly trivial, but it&#8217;s not really. It&#8217;s logically true but also dense, and without MT&#8217;s marvellous <a href="http://www.movabletype.org/documentation/designer/variable-interpolation.html" title="Everything you always wanted to know about variable interpolation but didn't know where to look">variable interpolation</a>, <a href="http://www.movabletype.org/documentation/appendices/tags/template-tag-types.html#logic" title="Logic Tags">logic</a> and array functions it would have been a nightmare.</p>

<p>Here&#8217;s the beauty and power of MT: It allows you to do so much, so elegantly and quickly with just a little patience and thought. </p>

<p>Tip of the hat to whoever thought of this.</p>
]]>
    </content>
</entry>

<entry>
    <title>Forum Non Convenience</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/services/forum_non_convenience.php" />
    <id>tag:www.mcavity.com,2010://7.50</id>

    <published>2010-07-11T09:24:01Z</published>
    <updated>2010-07-11T12:17:05Z</updated>

    <summary>The MT forums are arguably the worst community resource on the blogosphere</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="Services" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="forums" label="forums" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="movabletype" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt" label="MT" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>I&#8217;ve said this <a href="http://www.mcavity.com/versions/so_long_mt5_sorry_it_didnt_work_out.php" title="So Long, MT5. Sorry it didn't work out">before</a>, and I&#8217;m not the only one: the <a href="http://forums.movabletype.org/" title="MT Forums">MT Forums</a> is the clunkiest, most bizarre, user-unfriendly community service conceivable. To call it a &#8216;service&#8217; is to give it credit it does little to earn. </p>
]]>
        <![CDATA[<p>First of all, sometimes it uses <a href="http://daringfireball.net/projects/markdown/" title="Markdown">Markdown</a>. Sometimes it doesn&#8217;t. It&#8217;s not easy to figure out how to do links. It&#8217;s even tougher to figure out how to push out code (use Markdown; indent by eight spaces or more; but do you convert the <code>&lt;</code> and <code>&gt;</code> into <code>&amp;lt;</code>s and <code>&amp;gt;</code>s or not? Who knows?). There&#8217;s no preview for an originating post or new topic &#8212; take your chances, chum. </p>

<p>The search is ridiculous. Enter a term and you get a long, long list. At the bottom there&#8217;s an indication of more pages. There aren&#8217;t any. You can&#8217;t search by author. You can&#8217;t filter by date. There&#8217;s no concept of anyone moderating the forums or putting things where they should be so everything is everywhere.</p>

<p>It gets worse. Hit archives and you get a listing &#8212; <em>by date</em>. Duh? WTF? Who the heck is going to trawl through years of monthly archives to find something you need?</p>

<p>Oh, yes. There&#8217;s no <a href="http://forums.movabletype.org/2010/03/can-someone-enable-typepad-antispam-on-the-forums.html" title="Spam on the forums">spam control</a>. None. Zip. Zilch. <em>De nada</em>. But there is an excuse, oops, explanation. Something about people using real accounts and therefore being trusted commenters by default. Here&#8217;s the thing about defaults: they can be changed. Anything else?</p>

<p>How do you edit a previous post, something that&#8217;s easily done on anything run on <a href="http://www.phpBB.com/" title="phpBB forum platform">phpBB</a>? You can&#8217;t. You have to <a href="http://www.movabletype.org/cgi-bin/mt/mt.cgi" title="Login and post, edit">log in</a>. Then you have the pleasure of scrolling through and endless list (use the filters). You can also write a new entry here &#8212; so you don&#8217;t actually have to go the forums to post. What?</p>

<p>And it&#8217;s populated by some of the rudest people around, people whose approach is to say something like &#8220;Well buddy, nobody held a gun to your head, and besides we&#8217;re doing this <em>free</em> so show a little appreciation and bugger off&#8221; or things like that.</p>

<p>Hello? I came here looking for help. What do I find? A frustrating interface that, in and of itself, tells me that I&#8217;m insignificant and my worries, concerns and questions more so. </p>

<p>To call that a service or a forum is to do violence to the language.</p>
]]>
    </content>
</entry>

<entry>
    <title>Death by Calendar: The Irrelevance of Date-Based Blogs</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/design/death_by_calendar_the_irrelevance_of_date-based_blogs.php" />
    <id>tag:www.mcavity.com,2010://7.49</id>

    <published>2010-07-11T04:12:09Z</published>
    <updated>2010-07-11T17:45:30Z</updated>

    <summary>When designing blogs, date-based entries are no longer relevant (if ever they were). Content matters; not when it was written</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="Design" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="blogs" label="blogs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="calendars" label="calendars" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dates" label="dates" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="design" label="design" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="entries" label="entries" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>The historical fascination with &#8220;date-based&#8221; entries continues to invade all blog systems and software and many CMS platforms. Even today, every version of <a href="http://www.movabletype.com/" title="Movable Type download">MT</a> has provisioning for calendars and archives by date. </p>
]]>
        <![CDATA[<p>This is just stupid. <em>Content</em> matters, not when it was written. The traditional view of blogs as personal online diaries is outdated. It is also fundamentally wrong. </p>

<p>If a blog is intended for a readership beyond the author himself, then it stands to reason that listing archives of blog entries by date is wholly illogical. A visitor to a blog does not know <em>when</em> the author wrote something. It makes no difference whether a particular subject was addressed in 2009 or 1995, or on what date of what month. Readers are interested in the subjects or topics being addressed. Category listings make sense; so do tag clouds, keyword listing and even alphabetical listings. And, of course, the search box is essential.</p>

<p>Many blogs continue to list date-listings in their archives. This is utterly useless. It is unthinking, uncaring and shows no respect for the reader or the visitor. Who cares if you wrote 200 blog posts in December of 2007? <em>What</em> did you write about? How do I find that?</p>

<p>The worthies at <a href="http://www.movabletype.com/" title="Movable Type download">MT</a> say that <em>entries</em> are date-based and <em>pages</em> are not. <em>Entries</em> have categories, <em>pages</em> have folders. This is a distinction without a difference. It is the kind of thing engineers push out because they&#8217;re not expected to think about design or usability or end-user convenience.</p>

<p>When you create a blog with entries and categories, the categories show up as &#8212; guess what &#8212; <em>folders</em> on your server drive. Page folders, ditto, naturally. So what&#8217;s the difference? Only this: entries <strong>default</strong> to that mindless date-based listing, while pages do not. </p>

<p>Then there&#8217;s this bit of nonsense: pages are static, stuff like an <strong>About</strong> or <strong>Contact</strong> pages, material that doesn&#8217;t change. Entries don&#8217;t much change either. You post one, then you move on. You might reference back to the previous one, but you certainly don&#8217;t keep changing an earlier post. </p>

<p>In <a href="http://www.movabletype.com/" title="Movable Type download">MT</a> there is no longer any justification for date-based archives. It&#8217;s one thing to have it there as an option; it&#8217;s quite an another to have it as a default archive mapping. </p>

<p><a href="http://www.wordpress.com/" title="Wordpress.com blogs">Wordpress.com</a>, in its free version, is a great service, but for this: <em>it will not permit you to change the default mapping</em>. Entries should be listed by</p>

<pre><code>    %category%/%postname%
</code></pre>

<p>or whatever syntax WP uses. Instead, WP forces entries to be listed by year/month/date. Get real, people: the date, month and year are <em>irrelevant</em>. Entirely.</p>

<p>If you&#8217;re at all serious about your blog, do this first: kill all date-based archives. Nobody&#8217;s interested.</p>
]]>
    </content>
</entry>

<entry>
    <title>So long, MT5. Sorry it didn&apos;t work out</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/versions/so_long_mt5_sorry_it_didnt_work_out.php" />
    <id>tag:www.mcavity.com,2010://7.48</id>

    <published>2010-07-10T14:35:38Z</published>
    <updated>2010-07-11T12:37:20Z</updated>

    <summary>After months of struggle, a wistful farewell to MT5</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="Versions" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="beausmith" label="Beau Smith" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blogs" label="blogs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blogscom" label="blogs.com" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="danwolfgang" label="Dan Wolfgang" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="junkaneko" label="Jun Kaneko" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="Movable Type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt5" label="MT5" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="multiblog" label="multiblog" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugins" label="plugins" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sixapart" label="Six Apart" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="urls" label="URLs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="websites" label="websites" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>These things are never easy, but you can&#8217;t delay them indefinitely. For months I&#8217;ve struggled with <a href="http://www.movabletype.com/download/" title="MT5 download">MT5</a>. It works just fine &#8212; up to a point. If it&#8217;s just the basics you want, and if you&#8217;re happy to live without almost every bell and whistle, and if you can wrap your head around the completely rejigged workflow and architecture, go ahead.</p>
]]>
        <![CDATA[<p>But I love my bells and whistles, every one of them, some more than others. More: I need some of these plugins and hacks and I&#8217;m so dependent on them that they have now become the first point of reference when I check another CMS. Does it have anything like <a href="http://eatdrinksleepmovabletype.com/plugins/better_file_uploader/" title="Dan Wolfgang's Better File Uploader">Dan Wolfgang&#8217;s Better File Uploader</a>? The <a href="http://plugins.movalog.com/asset-handler/" title="Asset Handler">Asset Handler</a>? <a href="http://github.com/byrnereese/mt-plugin-imagecropper" title="Byrne Rees's Image Cropper">Image Cropper</a>? How does it deal with <a href="http://daringfireball.net/projects/markdown/" title="Markdown text filter">Markdown</a>? Can I use <a href="http://michelf.com/projects/php-markdown/extra/" title="Michel Fortin's PHP Markdown Extra">PHP Markdown Extra</a>? <a href="http://www.nonplus.net/software/mt/MTCollate.htm" title="Plugin MTCollate">Collate entries</a>, <a href="http://www.staggernation.com/mtplugins/DateTags/" title="Date Tags plugin from Staggernation">compare dates</a>?</p>

<p>It&#8217;s the reason I&#8217;ve stayed away from shifting to <a href="http://www.wordpress.org/" title="Wordpress">WordPress</a> or <a href="http://www.expressionengine.com/" title="Expression Engine">ExpressionEngine</a>. I love the <a href="http://www.movabletype.org/documentation/designer/templating-language-overview.html" title="MT Templating Language">MT templating language</a>; it&#8217;s intuitive, reasonably easy, and very flexible. Its great power comes from its native <a href="http://www.movabletype.org/documentation/appendices/tags/template-tag-types.html#logic" title="MT Logic Tags">logic</a> and <a href="http://www.movabletype.org/documentation/appendices/tags/var.html" title="Variable tags">variable</a> <a href="http://www.movabletype.org/documentation/appendices/tags/" title="MT Template Tags">template tags</a>, most especially that near-magical thing called <a href="http://www.movabletype.org/documentation/designer/variable-interpolation.html" title="Everything you always wanted to know about variable interpolation but didn't know where to look">variable interpolation</a>.</p>

<p><a href="http://www.movabletype.com/download/" title="MT5 download">MT5</a> was a dream. I was entranced by its paradigm: simple, elegant, logical, centred around the <a href="http://www.movabletype.org/documentation/appendices/tags/multiblog.html" title="MTMultiblog">MultiBlog</a> principle of collecting stuff from different places and displaying them in one top-level overarching container unit. Therefore: the Website with its pages but no entries and, below that, Blogs with pages or entries; and the Website pulling content from blogs. </p>

<p>The dream shattered. It <a href="http://www.movabletype.org/2010/01/mt5.html" title="MT5 January 2010 release">released very late, in January 2010</a> after months of waiting. The documentation was horrendous. Particularly <a href="http://forums.movabletype.org/2010/03/mt5-documentation-1.html" title="About the MT5 documentation">acrimonious posts</a> on the <a href="http://forums.movabletype.org/" title="MT Forums">forums</a> (arguably the single most ungainly, ill-designed and user-unfriendly such resources anywhere) resulted in the documentation being updated. </p>

<p>In all this time, <a href="http://www.sixapart.com/" title="Six Apart">SA USA</a> seemed to have abandoned its constituency altogether: us. Only Japan seemed to flourish. I can&#8217;t read Japanese. I shouldn&#8217;t be expected to. And only <a href="http://www.movabletype.org/members/jkaneko" title="Jun Kaneko">Jun Kuneko</a> from Japan came through again and again.</p>

<p>A word about <a href="http://www.movabletype.org/members/jkaneko" title="Jun Kaneko">Jun</a>. The gentlest and kindest of men with the most exquisite good manners, he &#8212; and he alone &#8212; took all the harsh words (and there were many, on <a href="http://www.sixapart.com/mailman/listinfo/pronet" title="MT Pronet">ProNet</a>, on the <a href="http://forums.movabletype.org/" title="MT Forums">forums</a>) and responded. Not reacted. Responded. As in came through with documentation updates, patient explanations, detailed expositions, often in the face of a serious language barrier. <a href="http://www.sixapart.com/" title="Six Apart">SA</a> needs to acknowledge the worth of this money and put him very high in the organisation. With him, <a href="http://www.movabletype.org/" title="Movable Type">MT</a> is in safe hands. </p>

<p>And there&#8217;s the beleaguered <a href="http://beau.vox.com/" title="Beau Smith Vox blog">Beau Smith</a>, man with more interests, hobbies, occupations and passions than could possible fit into the largest NorthFace pack. In the face of the nearly incessant drubbing <a href="http://www.movabletype.com/download/" title="MT5 download">MT5</a> got, Beau kept his cool and stood by the product. Over on <a href="http://bugs.movabletype.org/" title="FogBugz">FogBugz</a>, some of his questions in the beta-days of <a href="http://www.movabletype.com/download/" title="MT5 download">MT5</a> showed his profound concern for the end-user. Besides, by all accounts, he&#8217;s a master chef.</p>

<p>On his <a href="http://beausmith.com/" title="Beau Smith's site">site</a>, Beau describes <a href="http://www.sixapart.com/" title="Six Apart">SA</a> as &#8220;awesome&#8221;. That&#8217;s now became an escape word, something that you use when you can&#8217;t, or don&#8217;t want to, more precisely say what it is you like or admire about the object of the term. SA isn&#8217;t awesome, not by a long shot. There was a time when SA seemed actually to care about its users. That&#8217;s simply not true of English-speaking users any more for any version of <a href="http://www.movabletype.org/" title="Movable Type">MT</a>. SA has shifted its attention to <a href="http://www.typepad.com/" title="Typepad">TypePad</a> and other products. MT fell by the wayside. I have no doubt that someone &#8212; and I have a fairly good idea who &#8212; is going to wade in with a tiresome tirade about how good and fine SA is. Stuff it. Look at the posts on ProNet over the past year. People have been saying that no one seems to be listening and at least one, possibly two, of the SA team, once agreed on <a href="http://www.sixapart.com/mailman/listinfo/pronet" title="MT Pronet">Pronet</a> that SA should listen and interact more with the community. That has not happened. SA&#8217;s own <a href="http://www.sixapart.com/" title="Six Apart">website</a> is incredibly ugly. <a href="http://www.blogs.com/" title="Blogs.com">Blogs.com</a> is even worse. Both seem tired, jaded, bored. The forums, as I said, are so clunky it&#8217;s unbelievable &#8212; a worse plug for the product is hard to imagine. And then there&#8217;s that continuing confusion between <a href="http://www.movabletype.org" title="MT.org">MT-org</a> and <a href="http://www.movabletype.com" title="MT.com">MT-com</a> and which has what and why, and the plugins are somewhere else. In the early days MT had the best documentation in the business, stuff you could download, beautifully indexed and cross-linked. Now it&#8217;s all over the place. You won&#8217;t find the documentation on <a href="http://www.movabletype.org/documentation/designer/variable-interpolation.html" title="Everything you always wanted to know about variable interpolation but didn't know where to look">variable interpolation</a> in, or even linked in, the documentation on <a href="http://www.movabletype.org/documentation/appendices/tags/var.html" title="Variable tags">variable tags</a>. Sometimes it&#8217;s in a comment. The real stuff is on <a href="http://www.movabletype.org/documentation/designer/variable-interpolation.html" title="Everything you always wanted to know about variable interpolation but didn't know where to look">another page</a> altogether. Why? And there&#8217;s all kinds of hidden stuff, too, including <a href="http://www.movabletype.org/documentation/appendices/tags/categorycount.html" title="Count modifiers">modifiers for counts</a> (which got documented very late in the day after <strong>Mihai Boscaru</strong> and I pointed to them) and more. What does this say about usability? Worse: what does it say about approach and attitude?</p>

<p>I was once a great apologist for MT5. I loved its logic. I admired what it was trying to do. I loved the elegance and simplicity with which content could be pulled from different sources and reshaped, repackaged and re-presented. </p>

<p>But intentions, however good and noble, don&#8217;t make a great product. MT5 sucks. Big time. Every single valuable <a href="http://www.movabletype.org/2010/02/mt434.html" title="MT4">MT4</a> plugin is borked on MT5 &#8212; at least all those that matter to me. Dan explained in an email and later on a <a href="http://forums.movabletype.org/2010/03/sayonara-mt5-also-adieu-farewell-and-rip.html" title="Dan W on the lack of consultation">forum post</a> that plugin developers had been taken into confidence about the changes being made in the code during the shift to MT5. Often the plugins needs only small tweaks to get by: I managed to get Dan&#8217;s <a href="http://forums.movabletype.org/2010/04/better-file-uploader-and-mt5.html" title="miserable BFU hack for MT5">BFU running on MT5</a> with just a small change but it took hours of time; time I could have better spent elsewhere; time Dan wasn&#8217;t willing to invest (and rightly so); and it only ever ran in a crippled fashion. </p>

<p>Other plugins I had to toss altogether: notably the <a href="http://plugins.movalog.com/asset-handler/" title="Asset Handler">Asset Handler</a>, which can be a life-saver if you&#8217;re running a parallel <a href="http://www.xampp.com/" title="Xampp">Xampp</a> install, and <a href="http://github.com/byrnereese/mt-plugin-imagecropper" title="Byrne Rees's Image Cropper">Image Cropper</a>. To be fair, lots of the legacy plugins did work, but the ones that didn&#8217;t made it a frustrating experience.</p>

<p>What finally did it was this: MT5 is totally rigid and inflexible in its URL structure between the so-called &#8220;website&#8221; and subsidiary blogs. The blogs cannot have their own independent URLs. You cannot change that setting. An <a href="http://bugs.movabletype.org/default.asp?pgx=EV&amp;ixBug=102201&amp;search=2&amp;searchFor=MT5+URL&amp;bIgnoreMax=&amp;=#474805" title="Exchange on FogBugz: Website feature limits or eliminates functionality or simplicity found in MT4">exchange on FogBugz</a> points to this, and says it should have been thought of, but it never was. </p>

<p>Here&#8217;s what I mean: the principal site here is <a href="http://www.gautampatel.com/" title="Gautam Patel">gautampatel.com</a>. Hierarchically below that, but on the same <a href="http://www.bluehost.com/" title="Bluehost.com">Bluehost</a> box, are my blogs, each in its own directory/folder. This one, <a href="http://www.mcavity.com" title="Mcavity.com">mcavity</a>, is one such. Each of these blogs has its own domain name, correctly mapped to the Bluehost nameservers. Thus:</p>

<pre><code>    www.mcavity.com
</code></pre>

<p>is the same as </p>

<pre><code>    www.gautampatel.com/mcavity/.
</code></pre>

<p>On MT5, I cannot use the blog&#8217;s own URL. Everything has to go to through www.gautampatel.com, and every entry here has to be </p>

<pre><code>    www.gautampatel.com/mcavity/category/entry.php
</code></pre>

<p>That&#8217;s just ridiculous. I want a system where I can post to any of my other blogs, have them appear under their own URLs, but it also reflects automatically on the main website, which correctly links back to the post on the sub-blog. </p>

<p>I moved back to MT4. It wasn&#8217;t easy. MT5&#8217;s multiblogging system and its new <a href="http://www.movabletype.org/documentation/appendices/tags/template-tag-types.html#websites" title="Website-specific template tags for MT5">website-specific template tags</a> make it a snap to identify sub-blogs and pull content. In MT4, everything is a blog, so you have to correctly identify each blog by its id and carefully map the URLs and blog names to those ids when you&#8217;re referencing them elsewhere. </p>

<p>Thank god for <a href="http://www.movabletype.org/documentation/designer/variable-interpolation.html" title="Everything you always wanted to know about variable interpolation but didn't know where to look">variable interpolation</a> and the <a href="http://www.movabletype.org/documentation/appendices/tags/var.html#function" title="MT variable template array functions">array functions</a>. I managed to work out a system where from the main faux-website (faux because it&#8217;s actually an MT4 blog disguised as an MT5 &#8216;website&#8217;), I can do a search across all subsidiary blogs. I&#8217;ll push that bit of code out separately; I believe it should be of interest. </p>

<p>So sayonara <a href="http://www.movabletype.com/download/" title="MT5 download">MT5</a>. It was good knowing you, but I guess this is the end of the road for us. I&#8217;m staying with my first love. </p>
]]>
    </content>
</entry>

<entry>
    <title>Sorting Categories in Movable Type: Three Solutions</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/template_recipes/sorting_categories_in_movable_type_three_solutions.php" />
    <id>tag:www.gautampatel.com,2007:/mcavity//7.37</id>

    <published>2007-06-14T09:30:12Z</published>
    <updated>2010-04-16T03:27:40Z</updated>

    <summary>Three workarounds to custom-ordering of category lists in Movable Type.</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="template recipes" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="arvindsatyanarayan" label="Arvind Satyanarayan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bradchoate" label="Brad Choate" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="categories" label="categories" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="movabletype" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movalog" label="Movalog" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt" label="MT" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mtmacro" label="MT-Macro" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="recipe" label="recipe" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="regex" label="regex" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>If you want to sort your categories in some customized order &#8212; i.e., not alphabetically, which is the MT default &#8212; there are some solutions. I&#8217;ve tracked down three different solutions. </p>

<p>(Note that I am now running MT 3.35, and I&#8217;m not sure Solution #3 below works in anything below version 3.3x.)</p>

<ol>
<li>Use the <a href="#Option1" title="Option 1">RegEx Plugin</a>;</li>
<li>Use the <a href="#Option2" title="Option 2">CustomFields Plugin</a>;</li>
<li>Use category <a href="#Option3" title="Option 3">basenames</a>.</li>
</ol>
]]>
        <![CDATA[<h4><strong>Option 1 : Use the <a href="http://www.bradchoate.com/downloads/mtregex-1_61.zip" title="Reg-Ex plugin download from Brad Choate&#8217;s site">RegEx</a> Plugin</strong>    <a name="Option1"></a></h4>

<p>Here&#8217;s what you do:</p>

<ol>
<li>Grab the plugin (<a href="http://www.bradchoate.com/downloads/mtregex-1_61.zip" title="Reg-Ex plugin download from Brad Choate&#8217;s site">here</a>), and install it. If that link is broken, I&#8217;ve got the same thing locally, <a href="http://www.mcavity.com/files/mtregex-1_61.zip" title="Reg-Ex plugin download at Mcavity">here</a>.</li>
<li>Rename your categories <strong>1FirstCat</strong>, <strong>2SecondCat</strong>, <strong>3ThirdCat</strong>. Note that you can also do <strong>01FirstCat</strong>, 02SecondCat, etc. This may actually be preferrable, given the way these things are sorted if you have more than 10 categories. In that situation, the sequence will be 1, 10, 2, 3 &#8230;; while, with the double-digit numbering, it goes correctly 01, 02, 03.</li>
<li><p>Somewhere in your code, add this:</p>

<pre><code>&lt;MTAddRegex name="RemoveSortNumber"&gt;
    s|^([\d\.]*\s*)||   
&lt;/MTAddRegex&gt;
</code></pre></li>
<li><p>Now, when you use the &lt;MTCategories&gt; tag, add the following argument:  </p>

<pre><code>&lt;$MTCategoryLabel regex="RemoveSortNumber"$&gt;
</code></pre></li>
<li><p>Basically, this is stripping digits from the start of the line.</p></li>
</ol>

<p><strong>Pros</strong></p>

<ul>
<li>Easy to implement</li>
<li>Requires minimal &#8216;treatment&#8217; of categories</li>
</ul>

<p><strong>Cons</strong></p>

<ul>
<li>Does <strong>not</strong> work with dynamic publishing &#8212; returns a smarty error.</li>
<li>You have to know your way around regular expressions to modify the code.</li>
</ul>

<p>Note that much the same thing can be done with the superb <a href="http://www.bradchoate.com/weblog/2002/08/12/mtmacros" title="MT Macros">MT-Macros</a> plugin. That&#8217;s really a three-and-halfth solution, because, as I see it, it&#8217;s only a refinement of the RegEx solution.</p>

<h4><strong>Option 2 : Use Arvind Satyanarayan&#8217;s <a href="http://plugins.movalog.com/customfields/" title="Custom Fields Plugin">CustomFields</a> Plugin</strong>    <a name="Option2"></a></h4>

<ol>
<li>Grab the plugin (<a href="http://plugins.movalog.com/customfields/" title="Custom Fields Plugin">here</a>), and install it. Use the latest release, 2.0 RC1. <em>This will not work with the earlier release</em>.</li>
<li>Add a custom <em>category</em> field. Call it something like <strong>CategoryNum</strong> or some such. Check the <em>required</em> box &#8212; this prevents creation of a category without filling in a category number. The category type should be a single line text field so that you can add categories easily later.</li>
<li>I&#8217;m not going to get into how you get the custom fields to appear &#8212; Arvind&#8217;s documentation is exemplary, and bears close study.</li>
<li>Note this, though: the custom category fields do <em>not</em> change the entry editing screen, but the <em>category creation</em> screens.</li>
<li>Now when you create a category you should see a box at the bottom with your custom category. Give it a number (something like <strong>01</strong>, <strong>02</strong>, etc), in the sequence in which you want your categories to appear.</li>
<li><p>Now here&#8217;s the trick. Over at his own <a href="http://plugins.movalog.com/forums" title="Plugin Forums at Movalog">plugin forums</a> at <a href="http://www.movalog.com/" title="Movalog">Movalog</a>, there&#8217;s a <a href="http://plugins.movalog.com/forums/viewtopic.php?id=581" title="Sorting categories thread at Custom Fields Forum">thread</a> where Arvind tells of an <em>undocumented</em> sort feature in Version 2.0RC1 of <a href="http://plugins.movalog.com/customfields/" title="Custom Fields Plugin">CustomFields</a>. You can add an argument to the MTCategories tag and force a sort by a custom field. Here&#8217;s what Arvind says:</p>

<blockquote>
  <p>this is a new feature (that I haven&#8217;t publiciszed or documented at all for lack of time) introduced with v2.0. To resort by a custom field (called &#8220;Foo Bar&#8221;), the following syntax is used (on MTEntries,  MTCategories or MTEntries):</p>
</blockquote>

<pre><code>       sort_by="CUSTOMFIELD:Foo Bar"
            sort_order="ascend|descend"
</code></pre>

<blockquote>
  <p>So supposing you wanted to resort categories by the Foo Bar field in descending order:</p>
</blockquote>

<pre><code>       &lt;MTCategories sort_by="CUSTOMFIELD:Foo Bar"   
            sort_order="descend"&gt;
</code></pre></li>
<li><p>So in our case, with the CustomField <strong>CategoryNum</strong>, the code would be:</p>

<pre><code>    &lt;ol&gt;
        &lt;MTCategories sort_by=
           "CUSTOMFIELD:CategoryNum"&amp;
             sort_order="ascend" 
             show_empty="1"&gt;
            &lt;li&gt;
                &lt;b&gt;&lt;$MTCategoryLabel$&gt;&lt;/b&gt;
                &lt;$MTCategoryDescription$&gt;
            &lt;/li&gt;
        &lt;/MTCategories&gt;
    &lt;/ol&gt;
</code></pre></li>
<li><p>Essentially, all you are doing is sorting by the custom field, and then displaying as normal.</p></li>
</ol>

<p>Pretty nifty.</p>

<p><strong>Pros</strong></p>

<ul>
<li>Very easy, flexible, endless possibilities</li>
<li>Doesn&#8217;t require processing of a string.</li>
<li>Demands no special knowledge of reg-ex syntax.</li>
</ul>

<p><strong>Cons</strong></p>

<ul>
<li>None that I can tell, but it <em>is</em> a Release Candidate and &#8212; so the discussions on the <a href="http://plugins.movalog.com/forums" title="Plugin Forums at Movalog">plugin forums</a> say &#8212; sometimes quirky. I&#8217;ve had no problems whatever.</li>
</ul>

<h4><strong>Option 3 : Use the category &lt;basename&gt; to sort</strong> <a name="Option3"></a></h4>

<p>This one&#8217;s sort of homegrown. Here&#8217;s what you do.</p>

<ol>
<li>Name your categories as in <a href="#Option1" title="Option 1">Option 1</a> above, <strong>01FirstCat</strong>, <strong>02SecondCat</strong>, etc.</li>
<li>In the category editing screen, unlock the category basename field. It will default to the category label and has the numbers you&#8217;ve just given them (if you&#8217;re starting from scratch, that is; otherwise skip this step, the basename won&#8217;t change).</li>
<li>Strip the numbers from the basename and lock the field.</li>
<li>Remember to change your archive file path specifiers and mappings in the Settings - Publishing - Archive Maps so that your category archives are built with the basename rather than the label.</li>
<li><p>Now, instead of using the &lt;MTCategoryLabel&gt; tag, you use the &lt;MTCategoryBasename&gt; tag, passing it through any formatting filters (for upper/lower case, etc). For example:</p>

<pre><code>    &lt;ol&gt;
        &lt;MTCategories show_empty="1"&gt;
            &lt;li&gt;
                &lt;a href=&lt;$MTCategoryArchiveLink$&gt;"&gt;
                &lt;$MTCategoryBasename$&gt;
                &lt;/a&gt;&lt;br /&gt;
                &lt;Does this work?&gt;&lt;/li&gt;
        &lt;/MTCategories&gt;
    &lt;/ol&gt;
</code></pre></li>
<li><p>Basically, you&#8217;ve swapped the category label and the category basename. Now MT sorts categories by the <em>label</em>, in the numbered sequence you&#8217;ve set up, but uses the basename of each category for display.</p></li>
</ol>

<p><strong>Pros</strong></p>

<ul>
<li>Simple and basic. Requires no plugins, downloads, installations</li>
<li>Publishing-mode neutral; it makes no difference whether your pages are static or dynamic. MT is just being forced to read another field altogether.</li>
</ul>

<p><strong>Cons</strong></p>

<ul>
<li>Inherently limited and restrictive &#8212; it forces you to a given syntax in your basenames and labels. The basename can&#8217;t have spaces, just underscores and numbers. So if you have a multi-word category label (&quot;01 My Favourite Things&quot;) the basename, after stripping the numbers, would be <code>my_favourite_things</code>. That&#8217;s really ugly. So you&#8217;d have to either limit yourself to one word categories, or run <a href="http://www.bradchoate.com/weblog/2002/08/12/mtmacros" title="MT Macros">MT-Macros</a> or <a href="http://www.bradchoate.com/downloads/mtregex-1_61.zip" title="Reg-Ex plugin download from Brad Choate&#8217;s site">the Regex</a> plugin to get rid of the underscores.</li>
<li>Requires fiddling the archive mapping and file path specifiers.</li>
<li>Horrendously inelegant as a solution.</li>
</ul>

<p>My choice? <a href="#Option2" title="Option 2">Option 2</a>, without a doubt. Arvind rules!</p>
]]>
    </content>
</entry>

<entry>
    <title>Recipe for Upgrading MT</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/installation/recipe_for_upgrading_mt.php" />
    <id>tag:www.gautampatel.com,2007:/mcavity//7.36</id>

    <published>2007-06-10T16:22:53Z</published>
    <updated>2010-04-16T03:27:40Z</updated>

    <summary>A reasonably easy, Sunday-dinner type recipe for upgrading MT installations</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="installation" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="7zip" label="7-zip" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bluehost" label="Bluehost" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cpanel" label="Cpanel" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="movable type" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mt" label="MT" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="recipe" label="recipe" 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" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>After years of doing it donkey-style, I finally figured the easiest and fastest way to upgrade <a href="http://www.sixapart.com/movabletype/"" title="Movable Type home page">MovableType</a>. I was moving from Version 3.33 to 3.35, so all references are to that. Here&#8217;s my very own Martha Stewart style upgrade recipe &#8230;</p>
]]>
        <![CDATA[<p><strong>Preparation Time: 5-10 minutes; Cooking time: 5 minutes, or depends on you. Serves as many as you like.</strong></p>

<h4><strong>Ingredients</strong></h4>

<ol>
<li><p>One working <strong>control panel</strong> to access your site (my host, <a href="http://www.bluehost.com" title="Bluehost -- Affordable web hosting">Bluehost</a> gives me the popular <a href="http://www.cpanel.net/" title="Cpanel">CPanel</a>, so I&#8217;m presuming you have that).</p></li>
<li><p>A download of the latest <a href="http://www.sixapart.com/movabletype/"" title="Movable Type home page">MT</a> version to which you want to upgrade.</p></li>
<li><p>A good zipping/compressing utility, one that creates <strong>tarballs</strong> (.tar) and <strong>gzip</strong> (.gz) files. You&#8217;re going to need a <strong>.tar.gz</strong> file. I&#8217;m sure this works just as well with a .zip file; I&#8217;ve just never tried it. I recommend <a href="http://www.7-zip.org/" title="7-zip">7-zip</a> &#8212; fast, creates much smaller files, does both .tar and .gz, and, of course, <em>free</em>.</p></li>
<li><p>The usual utensils &#8212; computer, hard disk, mouse, keyboard, live internet connection.</p></li>
</ol>

<h4><strong>Method</strong></h4>

<ol>
<li><p><strong>Download the tarball</strong> &#8212; the <strong>.tar.gz</strong> file from <a href="http://www.sixapart.com" title="SixApart">SixApart</a>.</p></li>
<li><p><strong>Unpack it on your local drive</strong> (use what you like, I just use <a href="http://www.7-zip.org/" title="7-zip">7-zip</a> throughout). It will create a folder called <strong>MT-n.nn-ll</strong> where <strong>n.nn</strong> is the <em>version number</em> (like <strong>3.35</strong>), and <strong>ll</strong> is the <em>language code</em> (<strong>en</strong> for English).</p></li>
<li><p><strong>Rename this folder to mt</strong> (lower case), if mt is the name of the folder that contains your installation. If you&#8217;ve installed mt to the <strong>cgi-bin</strong>, then rename this folder to <strong>cgi-bin</strong>. <strong>This is important</strong>: remember to organize things <em>so that you have a folder called mt</em> and all the other folders and files of the installation below that. </p></li>
<li><p><strong>Rename any files</strong> you&#8217;ve customized or edited in that the newly-renamed <strong>mt</strong> or <strong>cgi-bin</strong> folder that you&#8217;ve customized or edited. Specifically, these could be any standard files or, more likely, the default search templates. Rename them to anything you like, <em>or they&#8217;ll over write your existing files</em>. </p>

<p><strong>Example</strong>: if you have a customized version of <strong>default.tmpl</strong> (the default search template in the <code>search_templates</code> folder), then, in the newly downloaded-unpacked-renamed folder (created as above), you need to rename <strong>default.tmpl</strong> to something like <strong>default-335-tmpl</strong>, so that it doesn&#8217;t over-write your custom version. <em>Do this for all your customized files</em>.</p></li>
<li><p><strong>Zip it up.</strong> Pack up the new installation set that you have on your local drive (the one with the renamed folder and files) to create a <strong>.tar.gz</strong> file. I recommend you use the free utility <a href="http://www.7-zip.org/" title="7-zip">7-zip</a>. If you <em>are</em> using <a href="http://www.7-zip.org/" title="7-zip">7-zip</a>, see <a href="http://www.mcavity.com/archives/blogging/recipe_for_upgr.php#topping" title="The Topping">below</a> for instructions on how to make this .tar.gz file.</p></li>
<li><p><strong>Upload</strong> the newly baked .tar.gz file to a folder immediately <em>above</em> the mt installation on your server. If your mt is installed to <code>/public_html/mt</code>, then put the .tar.gz into <code>/public_html</code>.</p></li>
<li><p><strong>Unpack on the server</strong>. From your <a href="http://www.cpanel.net/" title="Cpanel">CPanel</a>, go to <strong>File Manager</strong>. Go into your <code>public_html</code> directory. Click on the uploaded <strong>.tar.gz</strong> file. In the top right corner, you will see an option for extracting the contents. Click that. Another window opens, showing the extraction from the <strong>.tar.gz.</strong> If you&#8217;ve followed instruction, your new files will go straight into your old mt installation, over-writing any existing files.</p></li>
</ol>

<p>That&#8217;s it, you&#8217;re done! Now just go to your <strong>mt login</strong> page and the upgrade process begins.</p>

<p><strong>Serve hot with a scoop of relief.</strong> </p>

<p>I find this a whole lot simpler than trying to FTP a 10MB installation, which is the size of the extracted mt installation. On an erratic connection, this can take hours. The other alternative, viz., uploading the factory-shipped .tar.gz to your server, extracting it, and then copying over individual files and folders is equally cumbersome.</p>

<p>The beauty of this is that this doesn&#8217;t delete any files. So if you&#8217;ve got other plugins, etc., already installed, they&#8217;ll all remain intact.</p>

<p><a name="topping"></a></p>

<h4><strong>The topping. Creating a .tar.gz file with <a href="http://www.7-zip.org/" title="7-zip">7-zip</a></strong></h4>

<ol>
<li><p>The reason I use <a href="http://www.7-zip.org/" title="7-zip">7-zip</a> is that it gives me the option of doing the .tar.gz in one place. There are others that do this too (<a href="http://www.rarlab.com/" title="WinRAR">WinRAR</a> didn&#8217;t, last I checked; you had to use it with a separate utility like <a href="http://www.simtel.net/product.php?url_fb_product_page=63053" title="WinGZ">WinGZ</a>), but this one&#8217;s free and fast and creates significantly smaller archives.</p></li>
<li><p>First, <em>right-click</em> the <strong>mt</strong> folder (the one you&#8217;ve renamed). In the context menu, select <a href="http://www.7-zip.org/" title="7-zip">7-zip</a>, and add to archive. In the <a href="http://www.7-zip.org/" title="7-zip">7-zip</a> main interface, select <strong>.tar</strong> as the format.</p></li>
<li><p>It will generate a file called <strong>mt.tar</strong>.</p></li>
<li><p>Now <em>right-click</em> <strong>mt.tar</strong> and <em>again</em> select <a href="http://www.7-zip.org/" title="7-zip">7-zip</a> and add to archive. This time select <strong>.gzip</strong> as your format option.</p></li>
<li><p>It generates the <strong>mt.tar.gz</strong> file.</p></li>
<li><p>Basically, you&#8217;ve zipped <em>twice</em>, once to <strong>.tar</strong> and then to <strong>.tar.gz.</strong> You&#8217;ll notice that the 10mb installation is now down to about 2.3 MB, much easier to deal with.</p></li>
</ol>

<p>Hope this helps. <em>Bon apetit</em>!</p>

<p>A copy of this is on the SixApart community <a href="http://forums.sixapart.com/index.php?showtopic=62777" title="Recipe on the SixApart forums">forum</a>.</p>
]]>
    </content>
</entry>

<entry>
    <title>Migrating MovableType</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/installation/migrating_movabletype.php" />
    <id>tag:www.gautampatel.com,2006:/mcavity//7.35</id>

    <published>2006-07-11T14:51:09Z</published>
    <updated>2010-04-16T03:27:40Z</updated>

    <summary>My recipe for rapid migration of a MovableType Version 3.2 installation to another host</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="installation" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="7zip" label="7-Zip" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blogging" label="blogging" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bluehostcom" label="bluehost.com" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cuteftp" label="CuteFTP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="database" label="database" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="migrating" label="migrating" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="movabletype" label="movabletype" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mysql" label="MySQL" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="phpmyadmin" label="PHPMyAdmin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sixapart" label="SixApart" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="textpad" label="TextPad" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="webhosting" label="webhosting" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wingz" label="Win-GZ" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>Recently, I shifted four <a href="http://www.sixapart.com/movabletype/" title="Movable Type home page" target="_blank">MovableType</a> blogs to my present host, <a href="http://www.bluehost.com/" title="Bluehost">Bluehost</a>. These were four separate installations, on a <a href="http://www.sixapart.com/movabletype/faq#what_is_a_license" title="MT Personal Unlimited License">personal unlimited license</a>. The existing databases &#8212; the ones to be moved &#8212; were heavily populated: lots of plugins, customizations, plenty of data, including pictures and long blobs of text. I also had three or four users per blog. </p>

<p>The problem was this: how best to seamlessly migrate the blogs, retaining users, passwords and all customizations, without having to reconfigure <a href="http://www.sixapart.com/movabletype/" title="Movable Type home page" target="_blank">MovableType</a> from scratch?</p>

<p>After some trial-and-error, I figured out a way. I don&#8217;t claim that this is the best, or even the only, way in which to do this, but it worked for me and should work elsewhere, as long as the new host meets certain requirements (listed <a href="http://www.mcavity.com/archives/geekery/migrating_movab.php#assumptions" title="Assumptions">below</a>). Here&#8217;s my recipe for shifting <a href="http://www.sixapart.com/movabletype/" title="Movable Type home page" target="_blank">MovableType</a> to a new host, based on what I did.EOB</p>
]]>
        <![CDATA[<h3>Moving a xMTx installation to another host: the recipe</h3>

<h4>Ingredients</h4>

<p>First, some assumptions:</p>

<p><a name=&#8220;assumptions&#8221;></a></p>

<ol>
<li>That you can access your <a href="http://www.mysql.com/" title="MySQL">MySQL</a> database, and know how to use the export, import, drop, empty and SQL query functions. Very likely this is through <a href="http://www.phpmyadmin.net/" title="PHPMyAdmin">PHPMyAdmin</a></li>
<li>That your target/new host runs the <a href="http://www.cpanel.net/" title="CPanel">CPanel</a> control panel. If you&#8217;re using anything else, I can&#8217;t help you, though the overall instructions may still be useful.</li>
<li>That you&#8217;re <em>already</em> running MT 3.2. This may not work for an upgrade; in fact, it very likely won&#8217;t, because, as far as I know, Version 3.2 uses a different <a href="http://www.mysql.com/" title="MySQL">MySQL</a> table structure from the previous versions.</li>
</ol>

<h4>Separate the eggs: Backup and export your existing database.</h4>

<p><strong>This is critical</strong>. Log in to your existing <a href="http://www.mysql.com/" title="MySQL">MySQL</a> and export the entire MT table. I prefer to do <em>two</em> exports, one each for the data and the table structure. But that&#8217;s only because it&#8217;s easier to upload at the other end. Remember to export with the create tables and inserts ticked on.</p>

<h4>Heat the oven: Upload and install xMTx</h4>

<p>On your new host, upload and install xMTx. For the <strong>upload</strong>, I strongly recommend using the <a href="http://www.cpanel.net/" title="CPanel">Cpanel</a> <em>File Manager</em>. It allows you to upload easily right from your browser, without going through an FTP client, and, more importantly, has a nifty built-in unpacking utility that will unzip/unpack your MT files. Remember also to upload any customizations and plugins you may have made.</p>

<p>What I do is this:</p>

<ol>
<li>Upload the core MT distribution;</li>
<li>Unpack/unzip it;</li>
<li>Upload a tar.gz file of my customizations and plugins (which I generally keep in a separate directory anyway). Unpack them, and, if you&#8217;ve configured the tarball correctly, it will unpack right into the MT folder, over-writing where necessary.</li>
</ol>

<blockquote>
  <p><em>Tip 1</em>:     If you&#8217;re as much a maniac as I am about using <a href="http://www.sixapart.com/pronet/plugins" title="MT Plugins">MT Plugins</a>, then you&#8217;ll soon have realized that it&#8217;s damn near impossible keeping track of what goes where &#8212; the folder hierarchies, the customized files, etc. Besides, I also customize some of the core libraries so that my uploads go to pre-defined directories and all uploads come up with pre-designated code. If I muddle all this with a default MT distribution, I&#8217;m bound to lost track of some file essential to a plugin. So what I do is to keep a separate folder called <strong>mt</strong> on my local machine, and store all the plugins and customizations in that, preserving their required folder structures and placements. Then I create a tarball of this entire folder. Now, when I need to &#8216;customize&#8217; a new MT installation, I have only to upload this folder and unpack it. Since the core distribution is always unpacked to a folder on the root called <strong>mt</strong>, unpacking the customizations-folder from the root (using <a href="http://www.cpanel.net/" title="CPanel">Cpanel</a>) will automatically add the plugins and customizations at their appropriate places.</p>
  
  <p><em>Tip 2</em>: to quickly create tarball files: </p>
  
  <ol>
  <li>Use <a href="http://www.7-zip.org/" title="7-zip freeware zipper">7-zip</a> (freeware) to create a .tar file;</li>
  <li>Run <a href="http://www.7-zip.org/" title="7-zip freeware zipper">7-zip</a> again on the .tar to turn it into a .tar.gz file (you can also use <a href="http://www.crispen.org/src/" title="Win-GZ product page">Win-GZ</a> to turn the .tar into a .tar.gz file. <a href="http://www.simtel.net/product.php?url_fb_product_page=63053" title="Download Win-GZ">Download Win-GZ</a>.)</li>
  </ol>
</blockquote>

<p>I&#8217;m not going to get into the details of the MT installation and initialization procedure, which are well set out in the <a href="http://www.sixapart.com/movabletype/docs/3.2/01_installation_and_upgrade/" title="Installing MovableType &#8212; Documentation">MT documentation</a>. Remember only that <em>before</em> you install xMTx, you <strong>must</strong> create the necessary database, database user, and add the user to the database with full privileges. The <a href="http://www.cpanel.net/" title="CPanel">Cpanel</a> interface is quite intuitive for that. Remember to update your <strong>mt-config.cgi</strong> as <a href="http://www.sixapart.com/movabletype/docs/3.2/01_installation_and_upgrade/#entry-5260" title="Configuring the MT system">documented</a>.</p>

<h4>Blend at high speed: Enter your new xMTx installation</h4>

<p>Okay, now that you&#8217;ve uploaded MT, your customizations and plugins and set all the correct permissions for the various .cgi files and such, <a href="http://www.sixapart.com/movabletype/docs/3.2/01_installation_and_upgrade/#entry-5263" title="Initialize MT">initialize</a> the system. After that, you&#8217;ll log in to the default MT interface using, of course, the default login (<strong>Melody</strong>) and password (<strong>Nelson</strong>). </p>

<p>Okay, you&#8217;re in. First off, create a new user, preferrably using the same login and password you had earlier. Remember to give this new user (you) full access to the default blog, ie, all privileges. Also remember to rename the default blog. Do one rebuild. I don&#8217;t think it&#8217;s strictly necessary, but it doesn&#8217;t harm. Don&#8217;t worry about paths and settings at this stage.</p>

<p>Now <em>log off</em> as Melody Nelson; log in again using the new user you created. Go to the authors page and delete Melody Nelson as a user.</p>

<p>Log off and close this browser window. Onward!</p>

<h4>Add seasoning to taste: Upload additional files</h4>

<p>I forgot to do this, so I&#8217;m making a note of it, though it&#8217;s self-evident. Rememebr to upload all the <em>additional</em> files for your website including:</p>

<ul>
<li>Your css files (<em>important!</em>);</li>
<li>Your template files (<em>important!</em>);</li>
<li>downloadable files, if any;</li>
<li>image and picture files;</li>
<li>and, generally, <em>anything</em> that&#8217;s not stored in your database. </li>
</ul>

<p>You can upload and unpack a zip file of these files, or use an FTP client (I use <a href="http://www.globalscape.com/" title="CuteFTP">CuteFTP</a>).</p>

<h4>Pour into prepared pan: <a href="http://www.mysql.com/" title="MySQL">MySQL</a> and <a href="http://www.phpmyadmin.net/" title="PHPMyAdmin">PHPMyAdmin</a> Adding the table structure</h4>

<p>Here&#8217;s the next nifty bit. Enter your new host&#8217;s <a href="http://www.cpanel.net/" title="CPanel">Cpanel</a> again. Go to the <a href="http://www.mysql.com/" title="MySQL">MySQL</a> page, and from there to the <a href="http://www.phpmyadmin.net/" title="PHPMyAdmin">PHPMyAdmin</a> page. You should be in your database. You may have to select your database if your host allows more than one, from the drop-down list. Select it.</p>

<p>Now select all the tables in the database and <em>drop</em> (read, delete) them. Open up a good text editor &#8212; I use <a href="http://www.textpad.com/" title="Textpad">TextPad</a> &#8212; and open the <a href="http://www.mysql.com/" title="MySQL">MySQL</a> table-structure file you exported from your previous installation. You can upload it directly into your <a href="http://www.mysql.com/" title="MySQL">MySQL</a> database using the import function or, alternatively, use the SQL Query function and copy the entire table into it. Since your export has the <strong>create table</strong> and <strong>insert into</strong> lines in it, this will replicate your entire earlier table structure. </p>

<p>Do <strong>not</strong> repeat with the <em>data</em> export file just yet. You need to edit this file before you upload/insert the data (populate the table).</p>

<p>The critical thing now is to change the paths to your templates in your <strong>exported data file</strong> because it&#8217;s extremely unlikely that your earlier template-paths match the paths on your new host.</p>

<p>For example, earlier path name:</p>

<blockquote>
<pre><code>   /home/net/somehost/domain/html/templates
</code></pre>
</blockquote>

<p>While the new path name might be</p>

<blockquote>
<pre><code>   /home/accountname/public_html/templates
</code></pre>
</blockquote>

<p>Ideally, you should do a search-and-replace for the old path names and substitute them with the new path names in the exported data file.</p>

<p>Done? Fine. Now in <a href="http://www.phpmyadmin.net/" title="PHPMyAdmin">PHPMyAdmin</a>, upload or insert the contents of your freshly-edited exported-data file into <a href="http://www.mysql.com/" title="MySQL">MySQL</a>.</p>

<h4>The topping: full rebuild</h4>

<p>That&#8217;s about it! Try logging in now, with the username and password you used on your previous host &#8212; you should be through without any difficulty. Remember to do one full rebuild.</p>

<h4>Sit back and savour: tuck in!</h4>

<p>All this sounds terribly complicated, but, believe me, it&#8217;s a whole lot simpler than trying to re-configure the xMTx installation from scratch. </p>

<p>Lastly, one important thing to note: do <em>not</em> try and merely shove the exported table/data into the database of the new host. You just won&#8217;t be able to access the xMTx interface, no matter what you do. You <em>have</em> to go through the process of installing and initializing the new xMTx installation, logging in, adding a user and so on, as described above. Frankly, I understand the first bit, but don&#8217;t quite know why it requires you to log in and add a user. But that&#8217;s a small thing, given the huge saving in time and effort. Doing it like this, I was able to move all four installations over to <a href="http://www.bluehost.com/" title="Bluehost">Bluehost</a> in less than 30 minutes. Doing them over would have taken three days.</p>
]]>
    </content>
</entry>

<entry>
    <title>Character Entity References</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/reference/character_entity_references.php" />
    <id>tag:www.gautampatel.com,2006:/mcavity//7.34</id>

    <published>2006-06-27T03:38:08Z</published>
    <updated>2010-04-16T03:27:40Z</updated>

    <summary>Offering a perhaps useful table of entity references</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="reference" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="alistapart" label="a list apart" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cdata" label="cdata" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="characterentityreferences" label="character entity references" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="numericcodes" label="numeric codes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="w3c" label="w3c" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>Over at <a href="http://www.alistapart.com/" title="A List Apart">A List Apart</a>, one of the most delectable and beautifully presented websites for webdesigners, <strong>Peter Sheerin</strong> has a now legendary <a href="http://www.alistapart.com/stories/emen" title="The Trouble With EM &#8217;n EN @ A List Apart">article</a> titled &#8220;The Trouble With EM &#8217;n EN (and Other Shady Characters)&#8221; on typography, typographical styles and character entity references. It&#8217;s a pity his advice isn&#8217;t followed more often throughout the Web. There&#8217;s little doubt that it makes for much easier on-screen reading. Apart from anything else, following his advice renders pages that are much more courteous to the reader. </p>

<p>One of the references in that <a href="http://www.alistapart.com/stories/emen" title="The Trouble With EM &#8217;n EN @ A List Apart">article</a> is to the W3C <a href="http://www.w3.org/TR/html4/sgml/entities.html" title="W3C on character entity references">page</a> on <em>Character Entity References in HTML 4</em>. There is a detailed table there of all character entity references with their HTML codes and CData numeric codes. Unfortunately, the table is difficult to decipher. I&#8217;ve taken that table and re-formatted it for easier reading. Presenting the W3C-based table of Character Entity References&#8230;</p>
]]>
        <![CDATA[<div align="center">
<table border="0" cellpadding="5" cellspacing="0" width="90%" style="border: 1px solid #CCCCCC; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; font-size: 90%; font-family: trebuchet ms, verdana, tahoma, sans-serif; color: #333;font-variant: normal;">
<thead style="letter-spacing: 1px; font-variant: small-caps; font-size: 130%; color: #fff; font-weight: bold;">
<tr>
    <td align="center" valign="top" style="border: 1px solid #999999" bgcolor="#000080">&nbsp;</td>
    <td align="center" valign="top" style="border: 1px solid #999999" bgcolor="#000080">&nbsp;</td>
    <td align="center" valign="top" style="border: 1px solid #999999" bgcolor="#000080">
    html character entity</td>
    <td align="center" valign="top" style="border: 1px solid #999999" bgcolor="#000080" width="89">
    cdata numeric code</td>
    <td align="center" valign="top" style="border: 1px solid #999999" bgcolor="#000080" width="806">
    representation</td>
</tr>
</thead>
<tbody>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&nbsp;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#160;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">nbsp</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">160</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">no-break space = non-breaking space</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&iexcl;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#161;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">iexcl</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">161</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">inverted exclamation mark</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&cent;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#162;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">cent</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">162</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">cent sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&pound;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#163;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">pound</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">163</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">pound sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&curren;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#164;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">curren</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">164</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">currency sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&yen;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#165;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">yen</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">165</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">yen sign = yuan sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&brvbar;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#166;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">brvbar</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">166</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">broken bar = broken vertical bar</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&sect;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#167;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">sect</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">167</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">section sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&uml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#168;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">uml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">168</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">diaeresis = spacing diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&copy;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#169;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">copy</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">169</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">copyright sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ordf;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#170;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ordf</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">170</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">feminine ordinal indicator</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&laquo;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#171;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">laquo</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">171</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">left-pointing double angle quotation mark = left pointing guillemet</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&not;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#172;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">not</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">172</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">not sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&shy;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#173;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">shy</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">173</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">soft hyphen = discretionary hyphen</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&reg;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#174;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">reg</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">174</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">registered sign = registered trade mark sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&macr;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#175;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">macr</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">175</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">macron = spacing macron = overline = APL overbar</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&deg;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#176;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">deg</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">176</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">degree sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&plusmn;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#177;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">plusmn</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">177</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">plus-minus sign = plus-or-minus sign,U+00B1 ISOnum</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&sup2;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#178;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">sup2</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">178</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">superscript two = superscript digit two = squared</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&sup3;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#179;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">sup3</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">179</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">superscript three = superscript digit three = cubed</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&acute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#180;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">acute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">180</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">acute accent = spacing acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&micro;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#181;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">micro</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">181</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">micro sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&para;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#182;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">para</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">182</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">pilcrow sign = paragraph sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&middot;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#183;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">middot</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">183</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">middle dot = Georgian comma = Greek middle dot</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&cedil;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#184;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">cedil</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">184</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">cedilla = spacing cedilla</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&sup1;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#185;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">sup1</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">185</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">superscript one = superscript digit one</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ordm;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#186;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ordm</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">186</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">masculine ordinal indicator</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&raquo;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#187;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">raquo</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">187</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">right-pointing double angle quotation mark = right pointing guillemet</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&frac14;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#188;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">frac14</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">188</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">vulgar fraction one quarter = fraction one quarter</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&frac12;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#189;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">frac12</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">189</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">vulgar fraction one half = fraction one half</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&frac34;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#190;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">frac34</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">190</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">vulgar fraction three quarters = fraction three quarters</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&iquest;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#191;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">iquest</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">191</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">inverted question mark = turned question mark</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Agrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#192;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Agrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">192</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter A with grave = latin capital letter A grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Aacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#193;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Aacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">193</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter A with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Acirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#194;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Acirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">194</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter A with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Atilde;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#195;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Atilde</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">195</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter A with tilde</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Auml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#196;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Auml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">196</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter A with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Aring;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#197;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Aring</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">197</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter A with ring above = latin capital letter A ring</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&AElig;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#198;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">AElig</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">198</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter AE = latin capital ligature AE</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ccedil;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#199;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ccedil</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">199</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter C with cedilla</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Egrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#200;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Egrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">200</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter E with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Eacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#201;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Eacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">201</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter E with acute,U+00C9 ISOlat1</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ecirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#202;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ecirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">202</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter E with circumflex,U+00CA ISOlat1</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Euml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#203;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Euml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">203</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter E with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Igrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#204;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Igrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">204</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter I with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Iacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#205;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Iacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">205</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter I with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Icirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#206;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Icirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">206</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter I with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Iuml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#207;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Iuml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">207</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter I with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ETH;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#208;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ETH</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">208</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter ETH</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ntilde;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#209;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ntilde</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">209</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter N with tilde</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ograve;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#210;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ograve</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">210</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter O with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Oacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#211;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Oacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">211</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter O with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ocirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#212;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ocirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">212</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter O with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Otilde;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#213;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Otilde</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">213</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter O with tilde</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ouml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#214;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ouml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">214</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter O with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&times;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#215;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">times</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">215</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">multiplication sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Oslash;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#216;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Oslash</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">216</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter O with stroke = latin capital letter O slash</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ugrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#217;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ugrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">217</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter U with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Uacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#218;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Uacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">218</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter U with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Ucirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#219;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Ucirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">219</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter U with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Uuml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#220;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Uuml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">220</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter U with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&Yacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#221;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">Yacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">221</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter Y with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&THORN;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#222;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">THORN</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">222</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin capital letter THORN</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&szlig;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#223;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">szlig</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">223</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter sharp s = ess-zed</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&agrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#224;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">agrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">224</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter a with grave = latin small letter a grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&aacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#225;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">aacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">225</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter a with acute,U+00E1 ISOlat1</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&acirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#226;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">acirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">226</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter a with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&atilde;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#227;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">atilde</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">227</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter a with tilde</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&auml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#228;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">auml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">228</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter a with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&aring;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#229;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">aring</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">229</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter a with ring above= latin small letter a ring,U+00E5 ISOlat1</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&aelig;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#230;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">aelig</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">230</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter ae = latin small ligature ae</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ccedil;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#231;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ccedil</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">231</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter c with cedilla</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&egrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#232;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">egrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">232</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter e with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&eacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#233;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">eacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">233</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter e with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ecirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#234;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ecirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">234</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter e with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&euml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#235;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">euml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">235</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter e with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&igrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#236;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">igrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">236</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter i with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&iacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#237;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">iacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">237</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter i with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&icirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#238;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">icirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">238</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter i with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&iuml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#239;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">iuml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">239</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter i with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&eth;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#240;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">eth</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">240</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter eth</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ntilde;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#241;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ntilde</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">241</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter n with tilde</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ograve;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#242;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ograve</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">242</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter o with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&oacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#243;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">oacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">243</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter o with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ocirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#244;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ocirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">244</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter o with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&otilde;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#245;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">otilde</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">245</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter o with tilde</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ouml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#246;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ouml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">246</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter o with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&divide;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#247;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">divide</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">247</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">division sign</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&oslash;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#248;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">oslash</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">248</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter o with stroke</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ugrave;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#249;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ugrave</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">249</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter u with grave</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&uacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#250;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">uacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">250</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter u with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&ucirc;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#251;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">ucirc</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">251</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter u with circumflex</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&uuml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#252;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">uuml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">252</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter u with diaeresis</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&yacute;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#253;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">yacute</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">253</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter y with acute</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&thorn;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#254;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">thorn</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">254</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter thorn</td>
</tr>
<tr>
    <td align="left" valign="top" style="border: 1px solid #999999">&yuml;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">&#255;</td>
    <td align="left" valign="top" style="border: 1px solid #999999">yuml</td>
    <td align="left" valign="top" style="border: 1px solid #999999" width="89">255</td>
    <td align="left" valign="top" width="806" style="border: 1px solid #999999">latin small letter y with diaeresis</td>
</tr>
</tbody>
</table>
</div>

<p><strong>Notes:</strong></p>

<ol>
<li>For HTML Entities, use <strong>ampersand &amp;</strong> and <strong>semicolon ;</strong> before 
  and after the given code. Thus, nbsp should be written <strong>&amp;nbsp;</strong></li>
<li>For numeric data, <em>precede</em> the code with <strong>ampersand &amp;</strong> and 
  <strong>hash/pound #</strong>, and <em>follow</em> it with a <strong>semi-colon ;</strong> <em>Example</em>: 
  <strong>&amp;#249;</strong></li>
</ol>

<p>I hope you find this useful!</p>
]]>
    </content>
</entry>

<entry>
    <title>Movable Type - Related Entries</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/template_recipes/movable_type_-_related_entries.php" />
    <id>tag:www.gautampatel.com,2006:/mcavity//7.33</id>

    <published>2006-01-30T12:29:27Z</published>
    <updated>2010-04-16T03:27:39Z</updated>

    <summary>A workaround for some problems with **Adam Kalsey&apos;s** Related Entries recipe (using MT-SQL).</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="template recipes" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="adamkalsey" label="Adam Kalsey" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bradchoate" label="Brad Choate" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mysqlrelatedentries" label="MySQL related entries" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="plugins" label="plugins" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="templatetagrecipes" label="template tag recipes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="timappnel" label="Tim Appnel" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>I&#8217;ve long been less than fully happy with the ordinary <a href="http://code.appnel.com/mt-relatedentries" title="Related Entries">Related Entries</a> plugin for <a href="http://www.sixapart.com/movabletype/" title="Movable Type home page" target="_blank">MovableType</a>. Originally developed by <strong>Adam Kalsey</strong>, it is now being maintained by <strong>Tim Appnel</strong>. Tim&#8217;s instruction was on the mark &#8212; running MT-Related with keywords slows rebuild times and increases overhead enormously.</p>

<p>Back to Adam. Found he had a brilliant (hardly surprising) <a href="http://kalsey.com/2003/05/related_entries_revisited/" title="Adam Kalsey - Related Entries Revisited">alternative</a> using <strong>Brad Choate&#8217;s</strong> <a href="http://www.bradchoate.com/weblog/2002/07/11/mtsql" title="MTSQL Plugin by Brad Choate">MTSQL</a> plugin (are these guys gods or what?)</p>
]]>
        <![CDATA[<p>Naturally, I ran into trouble. Not being a SQL-ey kind of guy, I pottered around in this briar patch for a bit, and only came away bloodied. Of course I <em>had</em> to decide to crank it up a notch and go for the fancy stuff &#8212; how to suppress the related entries block if there are none; how to set a threshold limit, etc. etc.</p>

<p>Now Adam has a bit on his <a href="http://kalsey.com/2003/05/related_entries_revisited/comments.html" title="Further comments at Adam Kalsey">further comments</a> section on all this, but, somehow, none of it really worked for me. In particular, I couldn&#8217;t get his use of Brad&#8217;s <a href="http://www.bradchoate.com/weblog/2004/10/20/mtifempty" title="MTIfEmpty plugin">MTIfEmpty</a> plugin to work at all.</p>

<p>I found Adam&#8217;s recipe for suppressing display using MTIfNotEmpty, and for using the score &gt; 5 didn&#8217;t work well for me. I kept getting one SQL error after the other. I won&#8217;t bore with you with the details, but here it is as I see it (remember, I am <em>not</em> a sql-ey!):</p>

<blockquote>
  <p>AND SCORE > 5 will never work. It <strong>has</strong> to be HAVING SCORE > 5</p>
</blockquote>

<p>That&#8217;s one thing. The second thing is that using the &lt;MTSQLEntries&gt; tag <em>inside</em> the &lt;MTIfNotEmpty&gt; tag invariably returned an error. I had a hellish time trying to escape all the single and double quotes, the various types of brackets and braces, and really got nowhere.</p>

<p>What then?</p>

<p>Sometimes, as they say, the simplest answer is the best. Here&#8217;s my workaround. It works for me, and should, logically, work for anyone else. I&#8217;m not a programmer or a designer, so don&#8217;t ask me why &#8212; I just did what I thought was logical! </p>

<blockquote>
<code>
&lt;MTIfNotEmpty var="EntryKeywords"&gt;<br />
&lt;MTSQLEntries query="SELECT entry_id, MATCH (entry_keywords, entry_title, entry_excerpt) AGAINST ('[MTEntryKeywords encode_php='q'] [MTEntryTitle encode_php='q']') AS `score` FROM mt_entry WHERE MATCH (entry_keywords, entry_title, entry_excerpt) AGAINST ('[MTEntryKeywords encode_php='q'] [MTEntryTitle encode_php='q']') AND entry_id != '[MTEntryID]' AND entry_blog_id = '[MTBlogID]' HAVING `score` >= '2' ORDER BY score DESC LIMIT 0 , 5"&gt;<br />
&lt;div class="honor3"&gt;&lt;div id="inner"&gt;<br />
&lt;h3&gt;Related Entries&lt;/h3&gt;<br />
&lt;a href="&lt;$MTEntryLink$&gt;"&gt;&lt;$MTEntryTitle$&gt;&lt;/a&gt;&lt;br /&gt;<br />
&lt;/div&gt;&lt;/div&gt;<br />
&lt;/MTSQLEntries&gt;<br />
&lt;/MTIfNotEmpty&gt;
</code>
</blockquote>

<p>What happens is really a two-step check. First it checks if you have any keywords or not; if you don&#8217;t, nothing displays. If you do, then you have to pass the second threshold, of a score greater than (or greater than or equal to, in the above example) a figure that you determine. Once you do this, it works fine. </p>

<p>Note that the correct usage seems to be HAVING SCORE &gt; whatever (you will have to use &amp;gt;). And, of course, you have to get rid of the silly div tags which are from my own little CSS garden!</p>
]]>
    </content>
</entry>

<entry>
    <title>Multiple Blogs on MT</title>
    <link rel="alternate" type="text/html" href="http://www.mcavity.com/configuration/multiple_blogs_on_mt.php" />
    <id>tag:www.gautampatel.com,2003:/mcavity//7.31</id>

    <published>2003-12-02T04:36:29Z</published>
    <updated>2010-04-16T03:27:39Z</updated>

    <summary>Tweaks for PHP scripts on sites running multiple Movable Type blogs</summary>
    <author>
        <name>Gautam Patel</name>
        <uri>http://www.gautampatel.com/</uri>
    </author>
    
        <category term="configuration" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="mtinclude" label="MTInclude" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="multiblog" label="multiblog" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="multipleblogs" label="multiple blogs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mysql" label="MySQL" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="PHP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rebuilding" label="rebuilding" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="serversideincludes" label="server side includes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ssi" label="SSI" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.mcavity.com/">
        <![CDATA[<p>Heaven! Finally managed to get a couple of php scripts working to my satisfaction for my blog suite; <em>suite</em> being the operative word. Of course, it&#8217;s powered by <a href="http://www.movabletype.org/" title= "movable type home page" target="_blank">Movable Type</a> (you mean there&#8217;s anything else? &#8230; more on that anon) and while I really love MT (reasons, too, anon), what I really wanted was much more organisation and hierarchical structuring than just a single blog. </p>

<p>The categories feature didn&#8217;t really do it for me; not enough anyway. You still had a single page with all kinds of stuff on it and I&#8217;ve found hunting through blogs can be really tedious.</p>
]]>
        <![CDATA[<p>What I thought was this: I&#8217;d have a <em>set</em> of blogs. Each blog covers one major area of interest: thus, politics, history, art, books/language, humour, food &amp; wine, and so on. The posts in each blog are categorised. The geekspeak blog, for example, deals with technology and the categories include email, blogging etc. This is kind of neat and tidy &#8212; you don&#8217;t end up looking in posts on history and Dubya for stuff on blogging and PHP.</p>

<p><strong>THE COLLATION PROBLEM</strong></p>

<p>The real trick was, however, to default the first main blog (blog_id= 1) into a non-blog blog. That is, it&#8217;s a blog for the purposes of configuration in MT, but that&#8217;s all. It has a single page (the main index file) no archives and no entries are made to this blog. Instead, this blog pulls material from the other blogs. In short, I have a multi-blog MT installation, with one parent blog and the rest as &#8216;feeder&#8217; blogs from which the parent blogs pulls its material.</p>

<p><strong>THE MULTIPLE BLOG SCENARIO</strong></p>

<p>So far so good; but, immediately, trouble. How do you get the parent blog to constantly refresh its material? What I wanted was this:</p>

<ul> <li>a way of retaining the formatting on the parent blog page;</li> <li>some way of pulling entries from the other blogs;</li> <li>a method for fetching specific, important data (eg, the permalinks) for the entries from the other blogs;</li> <li>some means of specifiying the maximum number of entries to exclude;</li> <li>some way of doing all this automatically without having to rebuild the parent blog;</li> </ul>

<p><strong>THE EXISTING SOLUTIONS IN MOVABLE TYPE</strong></p>

<p>MT does have some solutions in the form of <a href= "http://mt-plugins.org/" target="_blank" title="The MT Plugins Page">MT plugins</a> , notably from David Raynes. His <a href= "http://www.rayners.org/2003/01/06/mtotherblog_v_025.php" title="David Raynes' MT Other Blog" target="_blank">Other Blog</a> has some of these features.</p>

<p>Unfortunately, it has two significant limitations: first, it demands that the blog on which it is used (the target blog, in this case my <a href="http://www.mcavity.com/" title="This site's home page">home page </a>) must be rebuilt to correctly reflect the updates on the source blogs. Second, it completely cracks up when dealing with any sort of archive. It just won&#8217;t work outside an index template.</p>

<p>That&#8217;s not good. So, I dug deeper and found two more plugins: David Raynes&#8217; own <a href= "http://www.rayners.org/2003/01/03/mtwholesystem.php" target="_blank" title="David Raynes' Whole System Plugin for MT">Whole System</a> and Stepan Riha&#8217;s <a href= "http://www.nonplus.net/software/mt/GlobalListings.htm" title="Stepan Riha's Global Listing Plugin for MT" target="_blank">Global Listings</a> plugin. I didn&#8217;t try either because I figured that almost <em>anything</em> that is an MT plugin must demand a rebuild; and that I most certainly don&#8217;t want.</p>

<p>Both are said to be similar to a straight PHP script (not an MT Plugin) from the amazing <a href="http://www.scriptygoddess.com" title= "Scripty Goddess Home Page" target="_blank">Scripty Goddess</a>. She has an absolute cracker of a MT hack, called the <a href= "http://www.scriptygoddess.com/archives/001393.php" title="Scripty Goddess' multiple blog update list" target="_blank">Multiple Blog Updates List</a>. Her script page also references two other PHP solutions for ordered updates and a portal tutorial, both worth checking out. I looked at these briefly and didn&#8217;t like them. The <a href= "http://www.movabletype.org/support/?act=ST&amp;f=14&amp;t=5072&amp;st=0" title= "ordered updates thread" target="_blank">ordered updates thread</a> uses Server Side Includes and shtml files, which I wanted to avoid since they don&#8217;t directly reference the mysql database; and the <a href= "http://www.movabletype.org/support/?act=ST&amp;f=14&amp;t=5291&amp;hl=portal+php" target="_blank" title="portal tutorial">portal tutorial</a> also seems to rely quite a lot on MT Tags (maybe I&#8217;m wrong, but that&#8217;s the impression I got).</p>

<p><strong>TWEAKING THE SCRIPTY GODDESS</strong></p>

<p>:-) That&#8217;s in a lighter vein, I hope she won&#8217;t mind the caption. Anyway, I took the SG script and it worked all right, but I realized soon enough that it needed major tweaking. In its original form, it has at least these limitations:</p>

<ul> <li>It doesn&#8217;t allow you to specify a maximum number of entries on the main page; in fact it takes only the latest from each. I found I wanted more;</li> <li>It has a problem with empty blogs;</li> <li>It doesn&#8217;t correctly reference the permalinks for individual entries;</li> </ul>

<p>I rewrote large chunks of the script, and now I use this:</p>

<blockquote>
<code>

 &lt;?<br />
 //connection info<br />
 include (&quot;/users/mcavity.com/httpdocs/connect.php&quot;);<br />
 <br />
 //for each of the selected blogs (2, 3, 4) in mt_blog, find and display in descending order the most recent post in mt_entry.<br />
 <br />
 $alldata = array();<br />
 $alldates = array();<br />
 <br />
 $blogcount=0; // keep track of number of blogs<br />
 <br />
 $blogarray = &quot;SELECT blog_id, blog_site_url, blog_name, blog_description FROM mt_blog WHERE NOT (blog_id = 1)&quot;; <br />
 $resultblog = mysql_query($blogarray) or die (mysql_error()); <br />
 while ($rowblog = mysql_fetch_array($resultblog)) {<br />
 $burl = ($rowblog['blog_site_url']);<br />
 $bname = ($rowblog['blog_name']);<br />
 $bdesc = ($rowblog['blog_description']);<br />
 <br />
 $rowarray = &quot;SELECT entry_created_on, entry_id, entry_blog_id, entry_title FROM mt_entry WHERE (entry_blog_id = (&quot;.$rowblog['blog_id'].&quot;)) ORDER BY entry_created_on DESC&quot;; <br />
 $resultid = mysql_query($rowarray) or die (mysql_error());<br />
 <br />
 if (mysql_num_rows($resultid) &gt; 0) { <br />
 <br />
 $count=0; <br />
 while ($rowid = mysql_fetch_array($resultid)) {<br />
 // if ($count&gt;0) { break; } <br />
 <br />
 $maxarray = &quot;SELECT entry_title, entry_blog_id, entry_id, entry_created_on, entry_excerpt, entry_text, entry_text_more, trackback_blog_id, trackback_created_on, trackback_entry_id, trackback_url FROM mt_entry, mt_trackback WHERE entry_id = &quot;.$rowid['entry_id'].&quot; and trackback_entry_id = entry_id ORDER by trackback_created_on DESC&quot;; <br />
 $resultmax = mysql_query($maxarray) or die (mysql_error());<br />
 <br />
 while ($rowmax = mysql_fetch_array($resultmax)) {<br />
 <br />
 $ids = array($rowmax['entry_id']);<br />
 $blogid = ($rowmax['entry_blog_id']);<br />
 $tburl = ($rowmax['trackback_url']);<br />
 $date = ($rowmax['entry_created_on']);<br />
 $title = ($rowmax['entry_title']);<br />
 $excerpt = ($rowmax['entry_excerpt']);<br />
 $text = ($rowmax['entry_text']);<br />
 $textmore = ($rowmax['entry_text_more']);<br />
 <br />
 <br />
 <br />
 //saves the data int alldata array for use outside of the while loop <br > $alldates[$blogcount++] = $date; <br />
 $alldata[$blogcount++] = array('bname'=&gt;$bname, 'blogid'=&gt;$blogid, 'burl'=&gt;$burl, 'bdesc'=&gt;$bdesc, 'ids'=&gt;$ids, 'title'=&gt; $title, 'excerpt'=&gt;$excerpt, 'text'=&gt;$text, 'textmore'=&gt;$textmore, 'tburl'=&gt;$tburl); <br />
 <br />
 }<br />
 <br />
 $count++;<br />
 }<br />
 }<br />
 }<br />
 array_multisort($alldates, SORT_DESC, $alldata);<br />
 <br />
 for ($i=0;$i&lt;=5; $i++) {<br />
 <br />
 <br />
 //separate date created on up between year, month, and date <br />
 $year[$i] = substr($alldates[$i], 0, 4); <br />
 $month[$i] = substr($alldates[$i], 5, 2); <br />
 $day[$i] = substr($alldates[$i], 8, 2);<br />
 <br />
 if ( $alldata[$i]['text']&gt;&quot;&quot;):<br />
 echo '&lt;div class=&quot;update&quot;&gt;', date( &quot; F j, Y&quot;, strtotime($alldates[$i])), ' : ', 'In ';<br />
 echo '&lt;a href=&quot;', $alldata[$i]['burl'], '&quot; target=&quot; _blank&quot; title=&quot;', $alldata[$i]['bdesc'], '&quot;&gt;', $alldata[$i]['bname'], '&lt;/a&gt;&lt;/div&gt;'; <br />
 echo '&lt;div class=&quot;title&quot;&gt;', '&lt;a href=&quot;', $alldata[$i]['tburl'], '&quot; target=&quot;_blank&quot; title=&quot;', $alldata[$i]['title'], '&quot;&gt;',$alldata[$i]['title'], '&lt;/a&gt;&lt;/div&gt;'; <br />
 echo '&lt;div class=&quot;excerptsyn&quot;&gt;', $alldata[$i] ['excerpt'], '&lt;/div&gt;';<br />
 if ( $alldata[$i]['textmore']&gt;&quot;&quot;):<br />
 echo '&lt;div class=&quot;blogbodysyn&quot;&gt;', $alldata[$i]['text'], '&lt;a href=&quot;',$alldata[$i]['tburl'], '&quot;target=&quot;_blank&quot; title=&quot;', $alldata[$i]['bdesc'], '&quot;&gt;', ' [ More ] ', '&lt;/a&gt;', '&lt; /div&gt;';<br />
 else:<br />
 echo '&lt;div class=&quot;blogbodysyn&quot;&gt;', $alldata[$i]['text'], '&lt;/div&gt;';<br />
 endif;<br />
 echo '&lt;div class=&quot;dividerline&quot;&gt;','&amp;nbsp;', '&lt;/div&gt;';<br />
 echo '&lt;div class=&quot;divider&quot;&gt;','&amp;nbsp;', '&lt;/div&gt; ';<br />
 else:<br />
 break;<br />
 endif; <br />
 <br />
 <br />
 } <br />
 ?&gt; 
</code>
</blockquote>

<p>Basically, this does several nifty things. <ul> 
<li>First, it includes all blogs <em>except</em> the first parent blog (the &#8220;WHERE NOT blog&#95;id=1&#8221; line). </li> 
<li>Second, it correctly identifies the <strong>permalinks</strong>. It first fetches all the blog&#95;ids. Then it fetches the entry data for each blog by matching the entry&#95;blog&#95;id to the blog&#95;id. Then it matches the entry&#95;id in the next array (&#8220;maxarray&#8221;) to the entry&#95;id in the previous array (which matched the blog&#95;ids) and <em>also</em> requires a match of the trackback&#95;entry&#95;id to the entry&#95;id &#8212; and that&#8217;s what yields the correct permalink.</li> 
<li>It gets rid of the trouble caused by the &#8220;if ($count>0) { break; } &#8221; line;</li> 
<li>It allows you to set a maximum number of entries (setting the variable $i to &lt;= 5 is the key; 5 can be any number you like, but be warned that because of &lt;= and $i++, it will generate one <em>more</em> entry than the actual maximum);</li> 
<li>And here&#8217;s the niftiest bit: if there is actually a text body, then and only then does it print it. This is necessary because on account of all that cross-matching above, it is otherwise apt to produce a whole series of blank entries while it loops.</li> </ul></p>

<p>I added a little refinement in the printing section: if there is an extended body, it insets <strong>[more]</strong> with a permalink http reference tag; and if there isn&#8217;t a an extended body, it just prints the main text entry.</p>

<p>I&#8217;m sure it can be improved and made more efficient by someone who knows PHP well (I&#8217;m really a newbie at this, just got into it a few weeks ago and I&#8217;m not even a computer jock, just an ornery lawyer) but it works well for me. If you&#8217;re using it, remember to remove all the class=&#34;whatever&#34; tags and add your own &#8212; these only reference my CSS file entries. Incidentally, you can embed MT tags into the print section, too, but what that does is yet another saga.</p>

<p><strong>THE SIDEBAR REARS ITS HEAD</strong></p>

<p>So far so good. But there endeth the saga not. I <em>also</em> want a method of pulling the <strong>blog names</strong>, with their URLs, and the top five entries in each blog and sticking these into a little side-bar for navigation. I wanted this to serve the purpose of a navigation bar or menu (you add a blog, it must show up) and must, again, refresh itself.</p>

<p>MTOther blog failed totally because of the demand for a rebuild. I tried other solutions and got some really bizarre results. Then, on the footing that the simplest solution is often the best, I just used a PHP list command coupled with a while command:</p>

<blockquote>
<code>

  &lt;?<br />
 //connection info<br />
 include (&quot;/users/mcavity.com/httpdocs/connect.php&quot;);<br />
 <br />
 $result = mysql_query(&quot;SELECT blog_id, blog_site_url, blog_name, blog_description FROM mt_blog WHERE (blog_id &gt; 1) ORDER BY blog_name ASC&quot;);<br />
 while (list($blog_id, $blog_site_url, $blog_name, $blog_description) = mysql_fetch_row($result)) {<br />
 echo '&lt;div class=&quot;oblog&quot;&gt;+ ', '&lt;a href=&quot;', $blog_site_url, '&quot; target=&quot;_blank&quot; title=&quot;', $blog_description, '&quot;&gt;', $blog_name, '&lt;/a&gt;&lt;/div&gt;';<br />
 <br />
 $entryresult=mysql_query(&quot;SELECT entry_title, entry_blog_id, entry_id, entry_excerpt, trackback_entry_id, trackback_url FROM mt_entry, mt_trackback WHERE ((entry_blog_id = $blog_id) AND (entry_id = trackback_entry_id)) ORDER BY entry_title ASC&quot;);<br />
 while (list($entry_title, $entry_blog_id, $entry_id, $entry_excerpt, $trackback_entry_id, $trackback_url) = mysql_fetch_row($entryresult)) { <br />
 <br />
 if (mysql_num_rows($entryresult) &lt; 6):<br />
 echo '&lt;div class=&quot;oblog2&quot;&gt;? ', '&lt;a href=&quot;', $trackback_url, '&quot; target=&quot;_blank&quot; title=&quot;', $entry_excerpt, '&quot;&gt;', $entry_title, '&lt;/a&gt;&lt;/div&gt;';<br />
 else:<br />
 break;<br />
 endif;<br />
 <br />
 }<br />
 }<br />
 <br />
 ?&gt;
</code>
</blockquote>

<p>What this does is that it first gets all the blog names and lists them alphabetically. So, you add a new blog, it gets added at once. Next, <em>immediately</em> after listing the blog (the WHILE statement) it gets a list of entries where the entry blog id matches the blog id (which it just printed) and where the entry id has a matching trackback id (to get the permalink). Then it prints the sequence of those entries subject to a cap of 5 (the ending if statement where the row count of the entryresult is &lt; 6): your last 5 entries.</p>

<p><strong>THE REAL TRICK</strong></p>

<p>And here&#8217;s the trick. <em>Don&#8217;t</em> use the MTInclude tag for these php chunks &#8212; again that forces rebuilds. Instead use the simple php include statement &lt;? include(&quot;full/path/to/file&quot;) ?&gt; so that it automatically builds these list with every page load.</p>

<p>Happy, happy day! Perfect. Time to go grab that big bowl of cappucino. Yes! Where am I using this? On this site, of course, but also, with a variant, on the <a href="http://www.bombaybar.com/" target= "_blank" title="Bombay Bar Association">Bombay Bar Association</a> website. </p>

<p><em>Postscript</em>: Having done all that, I knocked it off. Frankly, I went back to a single blog system &#8212; I like the bookmarklet feature and, for a personal blog, it just wasn&#8217;t worth the effort struggling with multiple blogs.</p>

<p><em>Post-Postscript and Caveat</em>: This all obviously horribly dated. With MT4 and MT5 <strong>multiblog</strong> is built right in, and MT5 is, in fact, designed with exactly this in mind. But it&#8217;s good to know I was aiming in the right direction &#8212; seven years ago!</p>
]]>
    </content>
</entry>

</feed>
