Backup of Individual Entry Archive Template

<html>

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />

<title><$MTEntryTitle$></title>

<link rel=”stylesheet” href=”http://home.wangjianshuo.com/jianshuowangstyle.css” type=”text/css” />

<meta name=”keywords” content=”<MTIfNonEmpty tag=”MTEntryKeywords”><$MTEntryKeywords encode_html=”1″$><MTElse><$MTEntryTitle encode_html=1$></MTElse></MTIfNonEmpty>” />

<meta name=”description” content=”<$MTEntryExcerpt encode_html=”1″$>” />

<meta name=”robots” content=”index,follow” />

<$MTEntryTrackbackData$>

<link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<$MTBlogURL$>index.xml” />

<MTEntryPrevious><link rel=”prev” href=”<$MTEntryPermalink$>” title=”<$MTEntryTitle encode_html=”1″$>” /></MTEntryPrevious>

<MTEntryNext><link rel=”next” href=”<$MTEntryPermalink$>” title=”<$MTEntryTitle encode_html=”1″$>” /></MTEntryNext>

<script type=”text/javascript” src=”http://home.wangjianshuo.com/archives/2006/10/13/prototype.js”></script>

<script type=”text/javascript” src=”http://home.wangjianshuo.com/archives/2006/10/13/rico.js”></script>

</head>

<body>

<$MTInclude module=”Header”$>

<span class=Adsense style=”padding-top:35px; background-color:transparent;”>

<p><a href=http://home.wangjianshuo.com/archives/20060422_welcome_to_wangjianshuos_blog.htm><img border=0 src=http://home.wangjianshuo.com/cn/2005/05/08/sanjose-jianshuo-standard.JPG></a></p>

<script type=”text/javascript”><!–

google_ad_client = “pub-8513779941474461”;

google_alternate_ad_url = “http://home.wangjianshuo.com/archives/2006/07/13/google_alternative_ad.htm”;

google_ad_width = 120;

google_ad_height = 600;

google_ad_format = “120x600_as”;

google_ad_type = “text_image”;

//2006-11-25: 120×600 Open Air

google_ad_channel = “9775971810”;

google_color_border = “FFFFFF”;

google_color_bg = “FFFFFF”;

google_color_link = “0000FF”;

google_color_text = “000000”;

google_color_url = “008000”;

//–></script>

<script type=”text/javascript”

src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>

</script>

</span>

<h1><$MTEntryTitle$></h1>

<p><small>Author: <a href=”<$MTEntryAuthorURL$>”><$MTEntryAuthorDisplayName$></a>.

Published: <a href=”http://home.wangjianshuo.com/archives/<$MTEntryDate format=”%Y_%m.htm”$>”><$MTEntryDate format=”%B %e”$></a>, <$MTEntryDate format=”%Y”$>.

Tag: <MTEntryCategories glue=” “>

<a href=”<$MTCategoryArchiveLink$>” rel=”tag”><$MTCategoryLabel$></a> (<$MTCategoryCount$>)

</MTEntryCategories><br>

Copyright: You are free to redistribute this work, as long as you keep this <a href=http://creativecommons.org/licenses/by-sa/2.5/>disclaimer</a> and <a href=”<$MTEntryPermalink$>#”>link</a>.<br>

Permlink: <a href=”<$MTEntryPermalink$>#”><$MTEntryPermalink$></a></small></p>

<script type=”text/javascript”>

var ref = document.referrer.toLowerCase();

if (ref.indexOf(‘wangjianshuo.com’) == -1 && location.href.indexOf(‘2007′) == -1) {

document.write(“<IFRAME style=’margin:10px;’ src=’http://home.wangjianshuo.com/archives/2006/07/13/google_adsense_300x250.htm’ width=605 height=250 frameborder=0 marginwidth=0 marginheight=0 scrolling=0></IFRAME>”);

}

</script>

<$MTEntryBody$>

<br>

<a name=”more”></a>

<$MTEntryMore$>

<p><small><MTEntryPrevious>

<br>« Prev: <a href=”<$MTEntryPermalink$>”><$MTEntryTitle$></a>

</MTEntryPrevious>

<MTEntryNext>

<br>Next »: <a href=”<$MTEntryPermalink$>”><$MTEntryTitle$></a>

</MTEntryNext>

</small></p>

<span class=”posted”>Posted by <$MTEntryAuthor$> at <$MTEntryDate$>

<MTEntryIfAllowPings>

| <a href=”#trackback”>TrackBack (<$MTEntryTrackbackCount$>)</a>

</MTEntryIfAllowPings> </span>

</div>

<script src=”http://www.google-analytics.com/urchin.js” type=”text/javascript”>

</script>

<script type=”text/javascript”>

_uacct = “UA-52458-1″;

urchinTracker();

</script>

<div class=”comments-head”>More to do on this site</div>

<ul>

<li><a onclick=”javascript:urchinTracker(‘/go/mail_to_friend’);” href=”mailto:?subject=<$MTEntryTitle encode_url=”1″$>&body=<$MTEntryLink encode_url=”1″$>”>Mail this entry</a> to your friend using your own email client (such as Microsoft Outlook).

<li>Welcome to link this entry: <input size=40 onfocus=”this.select();urchinTracker(‘/go/copy’);” value=”<a href='<$MTEntryPermalink encode_url=”1″$>’><$MTEntryTitle encode_url=”1″$></a>”> (HTML Code)

<li><a href=http://home.wangjianshuo.com/archives/20040211_newsletter_switched_to_yahoo_groups.htm#subscribe>Subscribe to Wangjianshuo’s Blog Update</a>.

</ul>

<div class=”comments-head”><a name=”comments”></a>Comments</div>

<MTComments>

<div class=”comments-body”>

<a name=”<$MTCommentDate format=”%I%M”$>”></a>

<$MTCommentBody$>

<span class=”comments-post”>Posted by: <b><$MTCommentAuthor show_email=”0″$></b> <a href=”http://user.wangjianshuo.com/<$MTCommentAuthor encode_url=”1″$>.htm”><img src=”http://home.wangjianshuo.com/nav-commenters.gif” align=absmiddle border=0></a> on <$MTCommentDate$></span>

</div>

</MTComments>

<div class=”comments-head”>Post a comment</div>

<script type=”text/javascript” language=”javascript”>

<!–

function OpenTrackback (c) {

window.open(c,

‘trackback’,

‘width=480,height=480,scrollbars=yes,status=yes’);

}

var HOST = ‘home.wangjianshuo.com’;

// Copyright (c) 1996-1997 Athenia Associates.

// http://www.webreference.com/js/

// License is granted if and only if this entire

// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {

var curCookie = name + “=” + escape(value) + ((expires) ? “; expires=” + expires.toGMTString() : “”) + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + ((secure) ? “; secure” : “”);

document.cookie = curCookie;

}

function getCookie (name) {

var prefix = name + ‘=’;

var c = document.cookie;

var nullstring = ”;

var cookieStartIndex = c.indexOf(prefix);

if (cookieStartIndex == -1)

return nullstring;

var cookieEndIndex = c.indexOf(“;”, cookieStartIndex + prefix.length);

if (cookieEndIndex == -1)

cookieEndIndex = c.length;

return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));

}

function deleteCookie (name, path, domain) {

if (getCookie(name))

document.cookie = name + “=” + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + “; expires=Thu, 01-Jan-70 00:00:01 GMT”;

}

function fixDate (date) {

var base = new Date(0);

var skew = base.getTime();

if (skew > 0)

date.setTime(date.getTime() – skew);

}

function rememberMe (f) {

var now = new Date();

fixDate(now);

now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);

setCookie(‘mtcmtauth’, f.author.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmtmail’, f.email.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmthome’, f.url.value, now, ‘/’, HOST, ”);

}

function forgetMe (f) {

deleteCookie(‘mtcmtmail’, ”, HOST);

deleteCookie(‘mtcmthome’, ”, HOST);

deleteCookie(‘mtcmtauth’, ”, HOST);

f.email.value = ”;

f.author.value = ”;

f.url.value = ”;

}

__utmSetVar( getCookie(“mtcmtauth”) + ” (” + getCookie(“mtcmtmail”) + “)”);

//–>

</script>

<div class=”comments-body”>

<form method=”post” action=”http://home.wangjianshuo.com/cgi-bin/mt/mt-comments.cgi”

name=”comments_form”

onsubmit=”if (this.bakecookie.checked) rememberMe(this); s1=’http://home.wangjia’; s2=’nshuo.com/cgi-bin/mt/mt-‘; s3=’comments-ifuleuiycfi.cgi’; this.action = s1+s2+s3;”>

<input_HIDDEN type=”hidden” name=”static” value=”http://home.wangjianshuo.com/scripts/thanksforcomment/thankyou.htm” />

<input type=”hidden” name=”static” value=”1″>

<input type=”hidden” name=”entry_id” value=”<$MTEntryID$>” />

<input type=”hidden” name=”src” value=”home.wangjianshuo.com” />

<input type=”hidden” name=”spammer” value=”goaway” />

<input type=”hidden” name=”spamming” value=”gotohell” />

Name: <br />

<input name=”author” /><br />

Email Address: (will not show)<br />

<input name=”email” /><br />

<input name=”url” /><br />

Comments:<br />

<textarea name=”text” rows=”12″ cols=”60″ style=”width:80%”></textarea><br /><br />

It may take up to <b>30 seconds</b> before the server returns a result. IP address recorded. <br>

Your post will appear on the homepage of this site – feel free to post on old entries to re-active the discussion. Please do NOT ask me to contact you by email or mobile. You can also <a href=http://home.wangjianshuo.com/archives/20061024_suggest_a_topic.htm>suggest a new topic</a><br>

<input type=”checkbox” name=”bakecookie” />Remember info?

<br /><br />

<input type=”submit” name=”post” value=” POST ” style=”font-weight: bold;” onclick=”urchinTracker(‘/go/post_comment’)” /> <– Please click POST only once<br />

<input type=”button” onclick=”forgetMe(this.form)” value=”FORGET PERSONAL INFORMATION” />

</form>

<script type=”text/javascript” language=”javascript”>

<!–

document.comments_form.email.value = getCookie(“mtcmtmail”);

document.comments_form.author.value = getCookie(“mtcmtauth”);

document.comments_form.url.value = getCookie(“mtcmthome”);

//–>

</script>

<MTInclude module=”RelatedEntries”>

<p align=center>© 2002 – 2006 Jian Shuo Wang. All right reserved. </p>

<script language=”JavaScript” src=http://home.wangjianshuo.com/archives/2006/07/13/public_javascript.js></script>

<center><small><a href=”http://home.wangjianshuo.com/cgi-bin/mt/mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=1″>E</a></small></center>

<script language=”VBScript” src=”http://www.wangjianshuo.com/include/pubs.vbs”>

</script>

</body>

</html>

Update January 23, 2009

Here is an updated backup of one of the most important template of this blog.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>

<title><$MTEntryTitle$></title>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />

<link rel=”stylesheet” href=”http://home.wangjianshuo.com/jianshuowangstyle.css” type=”text/css” />

<link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<$MTBlogURL$>index.xml” />

<style>h1 {margin-top:5px;}</style>

</head>

<body>

<div id=”header”>

<div id=”banner”><a href=”http://home.wangjianshuo.com”>Wangjianshuo’s blog<br />

<span class=”description”>Events (in Shanghai) that affect my life (and others’)</span></a>

</div>

<div id=”globalMenu”><div id=”nav”><ul id=”nav_menu”><li class=”top”><a class=”top” href=”http://home.wangjianshuo.com/”>Home  </a></ul></div></div>

</div>

<table width=100% id=”bread”><tr><td width=”70%”>

<div id=”navigation”><a href=”<$MTBlogURL$>”>Home</a> »

<MTParentCategories glue=” » “><a href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a></MTParentCategories></div>

</td>

<td align=right nowrap>« <mt:EntryPrevious><a href=”<MTEntryLink>”>prev</a></mt:EntryPrevious> <mt:EntryNext><a href=”<MTEntryLink>”>next</a> »</mt:EntryNext>

</td><td align=right nowrap><form name=g style=”margin:0″ method=”get” action=”http://home.wangjianshuo.com/archives/20060120_search_this_site.htm” target=”_top”><input type=”hidden” name=”domains” value=”home.wangjianshuo.com”></input>

<input type=”text” name=”q” size=”20″ maxlength=”255″ value=””></input>

<input type=”submit” name=”sa” value=”Search”></input>

<input type=”hidden” name=”sitesearch” value=”home.wangjianshuo.com”></input>

<input type=”hidden” name=”client” value=”pub-8513779941474461″></input>

<input type=”hidden” name=”forid” value=”1″></input>

<input type=”hidden” name=”channel” value=”6801625507″></input>

<input type=”hidden” name=”ie” value=”ISO-8859-1″></input><input type=”hidden” name=”oe” value=”ISO-8859-1″></input><input type=”hidden” name=”safe” value=”active”></input><input type=”hidden” name=”flav” value=”0000″></input><input type=”hidden” name=”sig” value=”NdyQdGFpJnNH_B3d”></input><input type=”hidden” name=”cof” value=”GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11″></input><input type=”hidden” name=”hl” value=”en”></input></form><script language=”JavaScript”>document.g.q.focus();</script>

</td><tr></table>

<h1><$MTEntryTitle$></h1>

<!– Start of Google AdSense Section –><div id=”AdSenseSquare”><script type=”text/javascript”>var ref = document.referrer.toLowerCase();if (ref.indexOf(‘wangjianshuo.com’) == -1 ) {

document.write(“<IFRAME src=’http://home.wangjianshuo.com/archives/2006/07/13/google_adsense_300x250.htm’ width=350 height=250 frameborder=0 marginwidth=0 marginheight=0 scrolling=0></IFRAME>”);

document.getElementById(“header”).style.display=”none”;

}</script></div>

<mt:include module=”AdSense”/>

<p><$MTEntryBody$></p>

<a name=”more”></a><$MTEntryMore$>

<p><span class=”post”><small>Posted by <a href=”http://home.wangjianshuo.com/archives/20040218_about_jian_shuo_wang.htm”><$MTEntryAuthor$></a> at <$MTEntryDate$><br />

Copyright: You are free to redistribute this work, as long as you keep this <a

href=http://creativecommons.org/licenses/by-sa/2.5/>disclaimer</a>

and this <a

href=”<mt:EntryLink/>#”>link</a>: <a href=”<mt:EntryLink/>#”><mt:EntryLink/></a></small></span></p>

<div class=”comments-head”>Related Entries: <$MTEntryCategory$></div>

<MTSetVarBlock name=”category”><MTEntryCategory></MTSetVarBlock>

<ol><MTEntries category=”$category” lastn=”9″> <li><a href=”<MTEntryLink>”><MTEntryTitle></a> <i><$MTEntryDate format=”%x”$></i></li> </MTEntries> </ol>

<div class=”comments-head”><a name=”comments”></a>Comments</div> <MTComments> <div class=”comments-body” id=”<$MTCommentDate format=”%I%M”$>”> <a name=”<$MTCommentDate format=”%I%M”$>”></a> <$MTCommentBody$> <span class=”comments-post”>Posted by: <a href=”http://user.wangjianshuo.com/<$MTCommentAuthor encode_html=”1″>.htm”><$MTCommentAuthor$></a>

<MTIfNonEmpty tag=”MTCommentURL”>

(<a href=”<$MTCommentURL$>” rel=”nofollow”>external link</a>)

</MTIfNonEmpty> on <$MTCommentDate$></span>

</div>

</MTComments>

</div>

<MTEntryIfCommentsOpen>

<div class=”comments-head”>Post a comment</div>

<script type=”text/javascript” language=”javascript”>

<!–

var HOST = ‘home.wangjianshuo.com’;

// Copyright (c) 1996-1997 Athenia Associates.

// http://www.webreference.com/js/

// License is granted if and only if this entire

// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {

var curCookie = name + “=” + escape(value) + ((expires) ? “; expires=” + expires.toGMTString() : “”) + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + ((secure) ? “; secure” : “”);

document.cookie = curCookie;

}

function getCookie (name) {

var prefix = name + ‘=’;

var c = document.cookie;

var nullstring = ”;

var cookieStartIndex = c.indexOf(prefix);

if (cookieStartIndex == -1)

return nullstring;

var cookieEndIndex = c.indexOf(“;”, cookieStartIndex + prefix.length);

if (cookieEndIndex == -1)

cookieEndIndex = c.length;

return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));

}

function deleteCookie (name, path, domain) {

if (getCookie(name))

document.cookie = name + “=” + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + “; expires=Thu, 01-Jan-70 00:00:01 GMT”;

}

function fixDate (date) {

var base = new Date(0);

var skew = base.getTime();

if (skew > 0)

date.setTime(date.getTime() – skew);

}

function rememberMe (f) {

var now = new Date();

fixDate(now);

now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);

setCookie(‘mtcmtauth’, f.author.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmtmail’, f.email.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmthome’, f.url.value, now, ‘/’, HOST, ”);

}

function forgetMe (f) {

deleteCookie(‘mtcmtmail’, ”, HOST);

deleteCookie(‘mtcmthome’, ”, HOST);

deleteCookie(‘mtcmtauth’, ”, HOST);

f.email.value = ”;

f.author.value = ”;

f.url.value = ”;

}

//–>

</script>

<form method=”post” action=”http://home.wangjianshuo.com/cgi-bin/mt/mt-comments.cgi”

name=”comments_form”

onsubmit=”if (this.bakecookie.checked) rememberMe(this); s1=’http://home.wangjia’; s2=’nshuo.com/cgi-bin/mt/mt-‘; s3=’comments-ifuleuiycfi.cgi’; this.action = s1+s2+s3;”>

<input_HIDDEN type=”hidden” name=”static” value=”http://home.wangjianshuo.com/scripts/thanksforcomment/thankyou.htm” />

<input type=”hidden” name=”static” value=”1″>

<input type=”hidden” name=”entry_id” value=”<$MTEntryID$>” />

<input type=”hidden” name=”src” value=”home.wangjianshuo.com” />

<input type=”hidden” name=”spammer” value=”goaway” />

<input type=”hidden” name=”spamming” value=”gotohell” />

Name: <br />

<input name=”author” /><br />

Email Address: (will not show)<br />

<input name=”email” /><br />

<input name=”url” /><br />

Comments:<br />

<textarea name=”text” rows=”12″ cols=”60″ style=”width:80%”></textarea><br /><br />

It may take up to <b>30 seconds</b> before the server returns a result. IP address recorded. <br>

<input type=”checkbox” name=”bakecookie” />Remember my information?<br/>

<input type=”checkbox” name=”subscribe” value=”1″ /><label for=”subscribe”>Subscribe to this entry</label><br />

<input type=”submit” name=”post” value=” POST ” style=”font-weight: bold;” onclick=”urchinTracker(‘/go/post_comment’)” /> <– Please click POST only once<br />

<input type=”button” onclick=”forgetMe(this.form)” value=”FORGET PERSONAL INFORMATION” />

</form>

<script type=”text/javascript” language=”javascript”>

<!–

document.comments_form.email.value = getCookie(“mtcmtmail”);

document.comments_form.author.value = getCookie(“mtcmtauth”);

document.comments_form.url.value = getCookie(“mtcmthome”);

//–>

</script>

</MTEntryIfCommentsOpen>

<!– Footer –>

<style>td.bd {border-left:#aaaaaa solid 1px;padding-left:20px;}</style><table bgcolor=”#EAEFF4″ id=”footer” width=”100%”><tr>

<td valign=top><dl><dt>Archives</dt><MTArchiveList archive_type=”Monthly”><dd><a href=”<$MTArchiveLink$>”><$MTArchiveTitle$></a> (<$MTArchiveCount$>)</dd></MTArchiveList></dl></td><td valign=”top” class=”bd”><MTTopLevelCategories><dl><dt>

<$MTCategoryLabel$><MTSubCategories><dd><a href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a></dd></MTSubCategories></dl></MTTopLevelCategories></td>

<td valign=”top” class=”bd”>

<dl><dt>Related Entries</dt>

<MTSetVarBlock name=”category”><MTEntryCategory></MTSetVarBlock>

<MTEntries category=”$category” lastn=”900″>

<dd><a href=”<MTEntryLink>”><MTEntryTitle></a></dd>

</MTEntries>

</dl>

<dl><dt>Other Languages</a></dt>

<dd><a href=”http://<mt:BlogHost/>/zh-CN/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Chinese</a></dd>

<dd><a href=”http://<mt:BlogHost/>/ja/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Japanese</a></dd>

<dd><a href=”http://<mt:BlogHost/>/fr/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>French</a></dd>

<dd><a href=”http://<mt:BlogHost/>/de/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>German</a></dd>

<dd><a href=”http://<mt:BlogHost/>/it/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Italian</a></dd>

<dd><a href=”http://<mt:BlogHost/>/ko/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Korean</a></dd>

<dd><a href=”http://<mt:BlogHost/>/pt/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Portuguese</a></dd>

<dd><a href=”http://<mt:BlogHost/>/ru/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Russian</a></dd>

<dd><a href=”http://<mt:BlogHost/>/ar/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Arabic</a></dd>

<dd><a href=”http://<mt:BlogHost/>/es/<mt:EntryDate format=”%Y%m%d”>_<mt:EntryTitle dirify=”1″/>.htm”>Spanish</a></dd>

</dl>

<!– SiteSearch Google –><form method=”get” action=”http://www.google.com/custom” target=”_top”><table border=”0″><tr><td nowrap=”nowrap” valign=”top” align=”left” height=”32″><a href=”http://www.google.com/”><img src=”http://www.google.com/logos/Logo_25wht.gif” border=”0″ alt=”Google” align=”middle”></img></a><br/><input type=”hidden” name=”domains” value=”wangjianshuo.com”></input><label for=”sbi” style=”display: none”>Enter your search terms</label><input type=”text” name=”q” size=”24″ maxlength=”255″ value=”” id=”sbi”></input></td></tr><tr><td nowrap=”nowrap”><table><tr><td><input type=”radio” name=”sitesearch” value=”” checked id=”ss0″></input><label for=”ss0″ title=”Search the Web”><font size=”-1″ color=”#000000″>Web</font></label></td><td><input type=”radio” name=”sitesearch” value=”wangjianshuo.com” id=”ss1″></input><label for=”ss1″ title=”Search wangjianshuo.com”><font size=”-1″ color=”#000000″>wangjianshuo.com</font></label></td></tr></table><label for=”sbb” style=”display: none”>Submit search form</label><input type=”submit” name=”sa” value=”Search” id=”sbb”></input><input type=”hidden” name=”client” value=”pub-8513779941474461″></input><input type=”hidden” name=”forid” value=”1″></input><input type=”hidden” name=”ie” value=”ISO-8859-1″></input><input type=”hidden” name=”oe” value=”ISO-8859-1″></input><input type=”hidden” name=”safe” value=”active”></input><input type=”hidden” name=”cof” value=”GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:FFFFFF;ALC:000000;LC:000000;T:0000FF;GFNT:0000FF;GIMP:0000FF;LH:0;LW:0;L:http://home.wangjianshuo.com/archives/2003/04/13/screen-home.wangjianshuo.com-logo.PNG;S:http://home.wangjianshuo.com;FORID:1″></input><input type=”hidden” name=”hl” value=”en”></input></td></tr></table></form><!– SiteSearch Google –></td></tr></table>

<center>© 2001 – 2008 Jian Shuo Wang. All right reserved<a href=http://home.wangjianshuo.com/cgi-bin/mt/mt.cgi?__mode=view&_type=entry&id=<MTEntryID>&blog_id=1&saved_changes=1>.</a> </center>

<script type=”text/javascript” src=”http://home.wangjianshuo.com/archives/2006/07/13/public_javascript.js”></script>

<script src=”http://www.google-analytics.com/urchin.js” type=”text/javascript”>

</script>

<script type=”text/javascript”>

_uacct = “UA-52458-1”;

urchinTracker();

</script>

</body>

</html>

Update May 6, 2009

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>

<title><$MTEntryTitle$></title>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />

<link rel=”stylesheet” href=”http://home.wangjianshuo.com/jianshuowangstyle.css” type=”text/css” />

<link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<$MTBlogURL$>index.xml” />

<style>h1 {margin-top:5px;}</style>

</head>

<body>

<script>var t_start = Number(new Date());</script>

<div id=”header”>

<div id=”banner”><a href=”http://home.wangjianshuo.com”>Wangjianshuo’s blog<br />

<span class=”description”>Events (in Shanghai) that affect my life (and others’)</span></a>

</div>

<div id=”globalMenu”><div id=”nav”><ul id=”nav_menu”><li class=”top”><a class=”top” href=”http://home.wangjianshuo.com/”>Home  </a></ul></div></div>

</div>

<table width=100% id=”bread”><tr><td width=”70%”>

<div id=”navigation”><a href=”<$MTBlogURL$>”>Home</a> »

<MTParentCategories glue=” » “><a href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a></MTParentCategories></div>

</td>

<td align=right nowrap>« <mt:EntryPrevious><a href=”<MTEntryLink>”>prev</a></mt:EntryPrevious> <mt:EntryNext><a href=”<MTEntryLink>”>next</a> »</mt:EntryNext>

</td><td align=right nowrap><form name=g style=”margin:0″ method=”get” action=”http://home.wangjianshuo.com/archives/20060120_search_this_site.htm” target=”_top”><input type=”hidden” name=”domains” value=”home.wangjianshuo.com”></input>

<input type=”text” name=”q” size=”20″ maxlength=”255″ value=””></input>

<input type=”submit” name=”sa” value=”Search”></input>

<input type=”hidden” name=”sitesearch” value=”home.wangjianshuo.com”></input>

<input type=”hidden” name=”client” value=”pub-8513779941474461″></input>

<input type=”hidden” name=”forid” value=”1″></input>

<input type=”hidden” name=”channel” value=”6801625507″></input>

<input type=”hidden” name=”ie” value=”ISO-8859-1″></input><input type=”hidden” name=”oe” value=”ISO-8859-1″></input><input type=”hidden” name=”safe” value=”active”></input><input type=”hidden” name=”flav” value=”0000″></input><input type=”hidden” name=”sig” value=”NdyQdGFpJnNH_B3d”></input><input type=”hidden” name=”cof” value=”GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:11″></input><input type=”hidden” name=”hl” value=”en”></input></form><script language=”JavaScript”>document.g.q.focus();</script>

</td><tr></table>

<h1><$MTEntryTitle$></h1>

<!– Start of Google AdSense Section –><div id=”AdSenseSquare”><script type=”text/javascript”>var ref = document.referrer.toLowerCase();if (ref.indexOf(‘wangjianshuo.com’) == -1 ) {

document.write(“<IFRAME src=’http://home.wangjianshuo.com/archives/2006/07/13/google_adsense_300x250.htm’ width=350 height=250 frameborder=0 marginwidth=0 marginheight=0 scrolling=0></IFRAME><p> </p>”);

//document.getElementById(“header”).style.display=”none”;

}</script></div>

<mt:include module=”AdSense”/>

<p><$MTEntryBody$></p>

<p>by <a href=”http://home.wangjianshuo.com/archives/20040218_about_jian_shuo_wang.htm”><$MTEntryAuthor$></a>

on <a href=”http://home.wangjianshuo.com/archives/<$MTEntryDate format=”%Y_%m”$>.htm”><$MTEntryDate format=”%B %e”$></a>, <$MTEntryDate format=”%Y”$>

under <mt:EntryCategories><a href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a></mt:EntryCategories>

<a name=”more”></a><$MTEntryMore$>

<div class=”comments-head”>Do you like this article?</div>

<p id=”welcome”>I wrote an article everyday in the last 7 years with a simple goal: to help people. I will be happy if you share this article to people who may need it.</p>

<ol>

<li><a href=”http://twitter.com/home/?status=Reading @jianshuo%20<$MTEntryTitle encode_url=”1″$>%20<$MTEntryLink$>”>Tweet this post</a></li>

<li>Share this article via Email, Fackebook, Digg or others <!– AddThis Button BEGIN –><script type=”text/javascript”>var addthis_pub=”jianshuo”;</script><a href=”http://www.addthis.com/bookmark.php?v=20″ onmouseover=”return addthis_open(this, ”, ‘[URL]’, ‘[TITLE]’)” onmouseout=”addthis_close()” onclick=”return addthis_sendto()”><img src=”http://s7.addthis.com/static/btn/lg-share-en.gif” width=”125″ height=”16″ alt=”Bookmark and Share” style=”border:0″ align=”absmiddle”/></a><script type=”text/javascript” src=”http://s7.addthis.com/js/200/addthis_widget.js”></script><!– AddThis Button END –></li>

<li>Link use this HTML: <input type=”text” size=”40″ onclick=”this.select();” value=”<a href="<$MTEntryLink$>"><$MTEntryTitle encode_html=”1″$></a>”/></li>

<li>Follow <a href=”http://twitter.com/jianshuo”>@jianshuo</a> on Twitter to get new article notification. I write daily (Yes, every day since 2002)</li>

<li><form method=”GET” action=”http://groups.yahoo.com/subscribe/wangjianshuo” target=_blank>

Subscribe to free newsletter <input type=hidden name=”action” value=”subscribe”>

<input type=”text” name=”user” value=”enter email address” onclick=”this.select()” size=”30″ style=”font-family: Verdana”>

<input type=”submit” name=”Submit” value=”Subscribe”> <i>Powered by Yahoo! Groups (<a href=”http://home.wangjianshuo.com/archives/20030508_emails_and_privacy_policies.htm#privacy”>Privacy Policy</a>)</i></form>

<li>Other Languages: <a

href=”http://<mt:BlogHost/>/zh-CN/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Chinese</a> | <a href=”http://<mt:BlogHost/>/ja/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Japanese</a> | <a href=”http://<mt:BlogHost/>/fr/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>French</a> | <a href=”http://<mt:BlogHost/>/de/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>German</a> | <a href=”http://<mt:BlogHost/>/it/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Italian</a> | <a href=”http://<mt:BlogHost/>/ko/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Korean</a> | <a href=”http://<mt:BlogHost/>/pt/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Portuguese</a> | <a href=”http://<mt:BlogHost/>/ru/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Russian</a> | <a href=”http://<mt:BlogHost/>/ar/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Arabic</a> | <a href=”http://<mt:BlogHost/>/es/<mt:EntryDate

format=”%Y%m%d”>_<mt:EntryTitle

dirify=”1″/>.htm”>Spanish</a></li>

</ol>

<div class=”comments-head”>Related Entries: <$MTEntryCategory$></div>

<MTSetVarBlock name=”category”><MTEntryCategory></MTSetVarBlock>

<ol><MTEntries category=”$category” lastn=”9″> <li><a href=”<MTEntryLink>”><MTEntryTitle></a> <i><$MTEntryDate format=”%x”$></i></li> </MTEntries>

</ol>

<div class=”comments-head”>Related Categories</div>

<p><mt:ParentCategories>

<mt:SubCategories>

<a href=”<$MTCategoryArchiveLink$>”><$MTCategoryLabel$></a> (<$MTCategoryCount$>)|

</mt:SubCategories>

</mt:ParentCategories>

</p>

<div class=”comments-head”><a name=”comments”></a>Comments</div> <MTComments> <div class=”comments-body” id=”<$MTCommentDate format=”%I%M”$>”> <a name=”<$MTCommentDate format=”%I%M”$>”></a> <$MTCommentBody$> <span class=”comments-post”>Posted by:

<a href=”http://user.wangjianshuo.com/<$MTCommentAuthor dirify=”-“>.htm”><$MTCommentAuthor$></a>

<MTIfNonEmpty tag=”MTCommentURL”>

(<a href=”<$MTCommentURL$>” rel=”nofollow”>external link</a>)

</MTIfNonEmpty> on <$MTCommentDate$></span>

</div>

</MTComments>

</div>

<MTEntryIfCommentsOpen>

<div class=”comments-head”>Post a comment</div>

<script type=”text/javascript” language=”javascript”>

<!–

var HOST = ‘home.wangjianshuo.com’;

// Copyright (c) 1996-1997 Athenia Associates.

// http://www.webreference.com/js/

// License is granted if and only if this entire

// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {

var curCookie = name + “=” + escape(value) + ((expires) ? “; expires=” + expires.toGMTString() : “”) + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + ((secure) ? “; secure” : “”);

document.cookie = curCookie;

}

function getCookie (name) {

var prefix = name + ‘=’;

var c = document.cookie;

var nullstring = ”;

var cookieStartIndex = c.indexOf(prefix);

if (cookieStartIndex == -1)

return nullstring;

var cookieEndIndex = c.indexOf(“;”, cookieStartIndex + prefix.length);

if (cookieEndIndex == -1)

cookieEndIndex = c.length;

return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));

}

function deleteCookie (name, path, domain) {

if (getCookie(name))

document.cookie = name + “=” + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + “; expires=Thu, 01-Jan-70 00:00:01 GMT”;

}

function fixDate (date) {

var base = new Date(0);

var skew = base.getTime();

if (skew > 0)

date.setTime(date.getTime() – skew);

}

function rememberMe (f) {

var now = new Date();

fixDate(now);

now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);

setCookie(‘mtcmtauth’, f.author.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmtmail’, f.email.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmthome’, f.url.value, now, ‘/’, HOST, ”);

}

function forgetMe (f) {

deleteCookie(‘mtcmtmail’, ”, HOST);

deleteCookie(‘mtcmthome’, ”, HOST);

deleteCookie(‘mtcmtauth’, ”, HOST);

f.email.value = ”;

f.author.value = ”;

f.url.value = ”;

}

//–>

</script>

<form method=”post” action=”http://home.wangjianshuo.com/cgi-bin/mt/mt-comments.cgi”

name=”comments_form”

onsubmit=”if (this.bakecookie.checked) rememberMe(this); s1=’http://home.wangjia’; s2=’nshuo.com/cgi-bin/mt/mt-‘; s3=’comments-ifuleuiycfi.cgi’; this.action = s1+s2+s3;”>

<input_HIDDEN type=”hidden” name=”static” value=”http://home.wangjianshuo.com/scripts/thanksforcomment/thankyou.htm” />

<input type=”hidden” name=”static” value=”1″>

<input type=”hidden” name=”entry_id” value=”<$MTEntryID$>” />

<input type=”hidden” name=”src” value=”home.wangjianshuo.com” />

<input type=”hidden” name=”spammer” value=”goaway” />

<input type=”hidden” name=”spamming” value=”gotohell” />

Name: <br />

<input name=”author” /><br />

Email Address: (will not show)<br />

<input name=”email” /><br />

<input name=”url” /><br />

Comments:<br />

<textarea name=”text” rows=”12″ cols=”60″ style=”width:80%”></textarea><br /><br />

It may take up to <b>30 seconds</b> before the server returns a result. IP address recorded. <br>

<input type=”checkbox” name=”bakecookie” />Remember my information?<br/>

<input type=”submit” name=”post” value=” POST ” style=”font-weight: bold;” onclick=”urchinTracker(‘/go/post_comment’)” /> <– Please click POST only once<br />

<input type=”button” onclick=”forgetMe(this.form)” value=”FORGET PERSONAL INFORMATION” />

</form>

<script type=”text/javascript” language=”javascript”>

<!–

document.comments_form.email.value = getCookie(“mtcmtmail”);

document.comments_form.author.value = getCookie(“mtcmtauth”);

document.comments_form.url.value = getCookie(“mtcmthome”);

//–>

</script>

</MTEntryIfCommentsOpen>

<center>© 2001 – 2009 Jian Shuo Wang. All right reserved<a href=http://home.wangjianshuo.com/cgi-bin/mt/mt.cgi?__mode=view&_type=entry&id=<MTEntryID>&blog_id=1&saved_changes=1>.</a> </center>

<script type=”text/javascript” src=”http://home.wangjianshuo.com/archives/2006/07/13/public_javascript.js”></script>

<script type=”text/javascript”>

var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);

document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

</script>

<script type=”text/javascript”>

try {

var pageTracker = _gat._getTracker(“UA-52458-1″);

pageTracker._trackPageview();

} catch(err) {}</script>

<script type=”text/javascript”>

window.onload = function() {

var t_end = Number(new Date());

var t_duration = t_end – t_start;

var lc1 = Math.floor(t_duration/1000);

var lc2 = Math.floor((t_duration % 1000)/100);

var lc3 = Math.floor((t_duration % 100)/10);

var lc4 = t_duration % 10;

try {

var pageTracker2 = _gat._getTracker(“UA-52458-3”);

pageTracker2._trackPageview(“/speed/” + “/” + lc1 + “/” + lc2 + “/” + lc3 + “/” + lc4);

} catch(err) {}

}

</script>

</body>

</html>

Adding Tag Support to MovableType

Joey asked how I implemented tag in my MovableType. I didn’t used plugin. Here is the cookbook to add tag as this blog.

Use Categories in the Tagging Way

First thing is, use the built-in category feature in the tagging way. When you want to assign some tags to an entry, just assign multiple categories. Thanks to the features of MovableType, you can easily add a new category (a new tag). It is not free form, but good enough.

Below is the list of tags I have:

screen-categories-mt.PNG

The list is long.

Adding Tag Chart to Template

One of the key feature distinguishing tags from other category or keyword based classification is, tag chart or tag cloud. Like this:

screen-tag.chart-mt.PNG

In Category Archive template, use the following code:

<!–tagging map–>

<p class=Headlines><MTCategories>

<a style=”text-decoration:none” href=”<$MTCategoryArchiveLink$>” title=”<$MTCategoryCount$>”><$MTCategoryLabel$></a>

</MTCategories></p>

<script language=javascript>

e = document.getElementsByTagName(“A”);

for(i=0; i < e.length; i++)

{

if(e[i].title != “”)

{

t = e[i].title;

if(t > 256) e[i].style.fontSize = “150%”;

else if(t > 126) e[i].style.fontSize = “140%”;

else if(t > 68) e[i].style.fontSize = “130%”;

else if(t > 16) e[i].style.fontSize = “120%”;

else if(t > 8) e[i].style.fontSize = “110%”;

else if(t >= 2) e[i].style.fontSize = “100%”;

else if(t = 1) { e[i].style.fontSize = “80%”; }

}

}

</script>

<!–end of tagging map–>

The codes (including the VBScript) are self-explained.

You can put this piece of code to other pages, like homepage.

Done

It is just as simple as using the existing functions to create a new way of presentation. Anyway, categories, keywords, and tags are not too different in nature.

Happy blogging!

Added Commenter Profile Page to MovableType

If you check the site careful enough, you will see a small icon besides the name of the commenter. It is newly added feature – Commenter Profile:

screen-comment.png

The link on the icon will lead you to the profile page of the commenter, so you understand what comments he/she has posted before.

Since it is based on display name only, don’t always take it for granted that people with same display name are the same person. If you found your name are too common, choose a more unique name.

Code?

Below are the code I used. It is very massy, since I didn’t spent time to make it workable for others. It just fit the needs of this blog. I wrote it as if I were writting a blog entry. When what I try to express is completed, the code is completed. So take whatever you can take from the code, but don’t expect it to work on your MovableType directly. For those who don’t like tech stuff, sorry for posting techie again.


<?php

function dirify($s) {

$s = strtolower($s);   ## lower-case.

$s = strip_tags($s);       ## remove HTML tags.

$s = preg_replace('!&[^;\s]+;!','',$s); ## remove HTML entities.

$s = preg_replace('![^\w\s]!','',$s);   ## remove non-word/space chars.

$s = preg_replace('!\s+!','_',$s);       ## change space chars to underscores.

return $s;

}

$mt_blog_users = "http://home.wangjianshuo.com/users/";

$mt_blog_archive = "http://home.wangjianshuo.com/archives/";

$file = '<Location of mt-config.cgi file>';

$cfg = array();

if ($fp = file($file)) {

foreach ($fp as $line) {

// search through the file

if (!ereg('^\s*\#',$line)) {

// ignore lines starting with the hash symbol

if (preg_match('/^\s*([^ ]+)[ ](.*)(\r|n)?$/', $line, $regs)) {

$key = trim($regs[1]);

$value = trim($regs[2]);

$cfg[$key] = $value;

}

}

}

} else {

die("Unable to open configuration file $file");

}

$db = mysql_connect($cfg['DBHost'], $cfg['DBUser'],

$cfg['DBPassword']) or die ('I cannot connect to MySQL.');

mysql_select_db($cfg['Database']);

$query = "SELECT comment_author,

count(comment_author) as comment_count

FROM mt_comment

GROUP BY comment_author

ORDER BY comment_count";

$result = mysql_query($query);

$comment_author_previous = "";

$comment_author_next = "";

while ($row = mysql_fetch_array($result)) {

if($row['comment_author'] == $user) {

$comment_author_previous = $comment_author_previous_temp;

}

if($comment_author_previous_temp == $user) {

$comment_author_next = $row['comment_author'];

}

$comment_author_previous_temp = $row['comment_author'];

}

echo "<small><a href='$mt_blog_users$comment_author_next.htm'>« $comment_author_next</a> |";

echo " <a href='http://home.wangjianshuo.com/scripts/mt-user/mt-all-user.php'>Commenters</a> ";

echo "| <a href='$mt_blog_users$comment_author_previous.htm'>$comment_author_previous »</a></small>";

$user or $user = 'Jian Shuo Wang';

$query = "SELECT entry_id, entry_title,

comment_id, comment_url,

entry_excerpt, comment_text,

comment_entry_id,

date_format(entry_created_on, '%Y%m%d') as comment_entry_ymd,

date_format(comment_created_on, '%h%i') as comment_hourmin,

comment_created_on

FROM mt_comment, mt_entry

WHERE comment_entry_id = entry_id

AND comment_author = '$user'

ORDER BY comment_id DESC

LIMIT 300";

$comment_url = "";

$comment_count = 0;

$html = "";

$result = mysql_query($query);

while ($row = mysql_fetch_array($result)) {

$comment_entry_id = $row['comment_entry_id'];

$html = $html . "<p>" . (nl2br($row['comment_text'])) .

"<p><small>Posted by $user at <

a href='http://home.wangjianshuo.com/users/" .

$row['comment_id'] . ".htm' target=_blank>" .

$row['comment_created_on'] .

"</a> on <a target=_blank href=$mt_blog_archive" .

$row['comment_entry_ymd'] .

"_" . dirify($row['entry_title']) .

".htm#" . $row['comment_hourmin'] .

">" . $row['entry_title'] .

"</a></small><hr>";

$comment_url or $comment_url = $row['comment_url'];

$comment_count = $comment_count + 1;

}

echo "<h1>$user</h1><a href='$comment_url' target=_blank>$comment_url</a> ";

echo "Posted <b>$comment_count</b> comment(s)";

echo $html;

mysql_free_result($result);

mysql_close();

?>

Added Tag to Category Archive Template

Tagging is important. MovableType does not support tagging. There is a plugin for it, but it only applies to MovableType 3.16 or higher, not my MovableType 2.66.

So I leveraged category as tag in MovableType 2.66. To add enough categories that covers all the “tag” I want to create. Maybe in the future, I need someways to automate the creating, mapping and final “save” action of the tagging system on MovableType.

Meanwhile, I added many tag related feature to this blog, like the flickr photo with the same tag also comes to the site.

New Template (after Nov 17, 2005):

Old template (before Dec 17, 2005):

MovableType 3.0 Released

Breaking news. MovableType 3.0 Developer Edition was Released. I waited for this for a long time.

Everyone wants to create big things. MovableType is one of the big things in the world. I admire what the creators achieved today. Maybe it is by chance, but they are more successful than any online software companies.

Congratulations!

I am reading First Things First. I will install MovableType 3.0, at the end of this month. To upgrade is something interesting, but is not so important to the overall quality of a site. ….. according to the book.

Individual Entry Archive Template

Below is the Individual Entry Archive Template for my site. It is the code behind the page you are looking at. Share with MovableType funs. Please note: Changes always under way but the major elements will be stable for a very long time.

<html>

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />

<title><$MTEntryTitle$></title>

<link rel=”stylesheet” href=”http://home.wangjianshuo.com/jianshuowangstyle.css” type=”text/css” />

<link rel=”alternate” type=”application/rss+xml” title=”RSS” href=”<$MTBlogURL$>index.rdf” />

<meta name=”description” content=”<$MTEntryExcerpt$>” />

<meta name=”keyword” content=”<$MTEntryCategoryLabel$>” />

<link rel=”start” href=”<$MTBlogURL$>” title=”Home” />

<MTEntryPrevious>

<link rel=”prev” href=”<$MTEntryLink$>” title=”<$MTEntryTitle$>” />

</MTEntryPrevious>

<MTEntryNext>

<link rel=”next” href=”<$MTEntryLink$>” title=”<$MTEntryTitle$>” />

</MTEntryNext>

</head>

<body>

<a href=”/”><div id=”banner”><$MTBlogName$><br />

<span class=”description”><$MTBlogDescription$></span></div></a>

<$MTInclude module=”Header”$>

<div class=”blog”><div class=”blogbody”>

<h1><$MTEntryTitle$></h1>

<span class=Adsense>

<script type=”text/javascript”><!–

google_ad_client = “pub-8513779941474461”;

google_ad_width = 120;

google_ad_height = 600;

google_ad_format = “120x600_as”;

//–></script>

<script type=”text/javascript”

src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>

</script>

</span>

<!–

<MTEntryCategories glue=” “>

<a href=”<$MTCategoryArchiveLink$>”>

<img border=0 src=”http://<$MTBlogHost$>/archives/2003/03/26/<$MTEntryCategory$>.jpg” alt=”Category: <$MTEntryCategory$>” vspace=5 hspace=5 align=”right”>

</a>

</MTEntryCategories>

–>

<p class=”small-note”>by <$MTEntryAuthor$> | <$MTEntryDate format=”%A, %B %d, %Y”$> | <$MTLinksDirectory$> |

<MTEntryPrevious>

<a href=”<$MTEntryPermalink$>”>«</a>

</MTEntryPrevious>

<MTEntryNext>

<a href=”<$MTEntryPermalink$>”>»</a>

</MTEntryNext>

</p>

<$MTEntryBody$>

<a name=”more”></a>

<$MTEntryMore$>

<span class=”posted”>Posted by <$MTEntryAuthor$> at <$MTEntryDate$>

<MTEntryIfAllowPings>

| <a href=”#trackback”>TrackBack (<$MTEntryTrackbackCount$>)</a>

</MTEntryIfAllowPings></span>

</div>

<$MTInclude module=”Newsletter”$>

<div class=”comments-head”>Related Entries:</div>

<$MTLinksRelatedEntries$>

<MTEntryIfAllowComments>

<div class=”comments-head”><a name=”comments”></a>Comments</div>

<MTComments>

<div class=”comments-body”>

<a name=”<$MTCommentDate format=”%I%M”$>”></a>

<$MTCommentBody$>

<span class=”comments-post”>Posted by: <b><$MTCommentAuthorLink show_email=”0″$></b> on <$MTCommentDate$></span>

</div>

</MTComments>

<div class=”comments-head”><a name=”trackback”>Trackbacks</a></div>

<div class=”comments-body”>TrackBack URL for this entry: <$MTEntryTrackbackLink$>

<MTPings>

<br/><br/><a name=”<$MTPingID$>”></a>

<a href=”<$MTPingURL$>” target=”new”><$MTPingTitle$></a><br />

<b>Excerpt:</b> <$MTPingExcerpt$><br />

<b>Weblog:</b> <$MTPingBlogName$><br />

<b>Tracked:</b> <$MTPingDate$></span>

</MTPings>

</div>

<div class=”comments-head”>Post a comment</div>

<script type=”text/javascript” language=”javascript”>

<!–

function OpenTrackback (c) {

window.open(c,

‘trackback’,

‘width=480,height=480,scrollbars=yes,status=yes’);

}

var HOST = ‘<$MTBlogHost$>’;

// Copyright (c) 1996-1997 Athenia Associates.

// http://www.webreference.com/js/

// License is granted if and only if this entire

// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {

var curCookie = name + “=” + escape(value) + ((expires) ? “; expires=” + expires.toGMTString() : “”) + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + ((secure) ? “; secure” : “”);

document.cookie = curCookie;

}

function getCookie (name) {

var prefix = name + ‘=’;

var c = document.cookie;

var nullstring = ”;

var cookieStartIndex = c.indexOf(prefix);

if (cookieStartIndex == -1)

return nullstring;

var cookieEndIndex = c.indexOf(“;”, cookieStartIndex + prefix.length);

if (cookieEndIndex == -1)

cookieEndIndex = c.length;

return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));

}

function deleteCookie (name, path, domain) {

if (getCookie(name))

document.cookie = name + “=” + ((path) ? “; path=” + path : “”) + ((domain) ? “; domain=” + domain : “”) + “; expires=Thu, 01-Jan-70 00:00:01 GMT”;

}

function fixDate (date) {

var base = new Date(0);

var skew = base.getTime();

if (skew > 0)

date.setTime(date.getTime() – skew);

}

function rememberMe (f) {

var now = new Date();

fixDate(now);

now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);

setCookie(‘mtcmtauth’, f.author.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmtmail’, f.email.value, now, ‘/’, HOST, ”);

setCookie(‘mtcmthome’, f.url.value, now, ‘/’, HOST, ”);

}

function forgetMe (f) {

deleteCookie(‘mtcmtmail’, ”, HOST);

deleteCookie(‘mtcmthome’, ”, HOST);

deleteCookie(‘mtcmtauth’, ”, HOST);

f.email.value = ”;

f.author.value = ”;

f.url.value = ”;

}

//–>

</script>

<div class=”comments-body”>

<form method=”post” action=”<$MTCGIPath$><$MTCommentScript$>” name=”comments_form” onsubmit=”if (this.bakecookie.checked) rememberMe(this)”>

<input_HIDDEN type=”hidden” name=”static” value=”http://home.wangjianshuo.com/scripts/thanksforcomment/thankyou.htm” />

<input type=”hidden” name=”static” value=”1″>

<input type=”hidden” name=”entry_id” value=”<$MTEntryID$>” />

<input type=”hidden” name=”src” value=”home.wangjianshuo.com” />

Name: <br />

<input name=”author” /><br />

Email Address: (will not show)<br />

<input name=”email” /><br />

<input name=”url” /><br />

Comments:<br />

<textarea name=”text” rows=”12″ cols=”60″ style=”width:80%”></textarea><br /><br />

It may take up to <b>30 seconds</b> before the server returns a result. IP address recorded. Spam/advertisement comment will be deleted<br/>

<input type=”checkbox” name=”bakecookie” />Remember info?

<input type=”checkbox” name=”subscribe” />Subscribe this thread?

<br /><br />

<input type=”submit” name=”preview” value=” Preview ” />

<input type=”submit” name=”post” value=” POST ” style=”font-weight: bold;” /> <– Please click POST only once<br />

<input type=”button” onclick=”forgetMe(this.form)” value=”FORGET PERSONAL INFORMATION” />

</form>

<script type=”text/javascript” language=”javascript”>

<!–

document.comments_form.email.value = getCookie(“mtcmtmail”);

document.comments_form.author.value = getCookie(“mtcmtauth”);

document.comments_form.url.value = getCookie(“mtcmthome”);

//–>

</script>

</MTEntryIfAllowComments>

</div>

<div class=”comments-head”>Featured Topics</div>

<br>

<script src=”http://home.wangjianshuo.com/scripts/ads/ads.cgi”></script>

<p><center>

© 2002 – 2003 Jian Shuo Wang. All right reserved.

<a target=”_blank” href=”http://home.wangjianshuo.com/mt26/mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=1″><img src=”http://www.wangjianshuo.com/about/logos/dot.gif” width=3 height=3 border=0></a>

<br/>

Email me:<img alt=”screen-jianshuo.at.hotmail.com-logo.PNG” src=”http://home.wangjianshuo.com/archives/2003/03/26/screen-jianshuo.at.hotmail.com-logo.PNG” width=”152″ height=”19″ border=”0″ align=”texttop”></center>

</p>

<script language=”VBScript” src=”http://www.wangjianshuo.com/include/pubs.vbs”>

</script>

</body>

</html>

MovableType Suggestions

Hi my fellow MovableType users, after using MovableType for more than one year, I want to keep a record of my current MovableType configuration. Hopefully, it will be helpful to other MovableType users. (Yes. I hope it will be as helpful as my first blog entry of MovableType Successfully Installed on Windows XP)

This Guide

The first reader for this guide is me. In case my MovableType corrupt again, I will have to reinstall the whole MovableType system by following this guide. This can also be the guide for you to setup the MovableType from ground-up exactly like this site.

MovableType Package

Download MovableType 2.64 from MovableType.org. I will choose the “Full Version” option instead of “Full Version, with Libraries”, since the libraries are really HUUUGE.

Following the instructions and maybe refer to MovableType Successfully Installed on Windows XP) to make sure the MovableType 2.64 up and running on your site. I was using MovableType 2.63 and upgraded to 2.64 without any problem.

Change Author Name

According to MovableType documenation, the default author name for MovableType is Melody and the password is Nelson. My suggestion is to change the name and password of the default author instead of creating a new one.

After login, click the “Melody” right to User: on the top bar and change the User Name to “Jian Shuo Wang” and Password to my exisiting password (I will not tell you though :-D). Also, be sure to enter an email address that you can send out email.

Chaning instead of creating another one elminate a lot of trouble regarding permissions and you don’t have to delete this default one – otherwise it will leave a security flaw – everyone knows this account. The author ID also remains 1.

Weblog Config

After entering the “The First Weblog”, the default weblog, change the Weblog name to Wangjianshuo’s Blog. The following parameters are applied to my environment:

Core Setup

=======

Local Site Path: E:/customer/wangjianshuo

Site URL: http://home.wangjianshuo.com/

Local Archive Path: E:\customer\wangjianshuo\archives

Archive URL: http://home.wangjianshuo.com/archives/

Timezone: UTC+8 (China Cost Time)

Preferences:

=========

Descriptoin: Events (in Shanghai) that affect my life (and others’)

Number of days displayed: 7

Language for date display: English

Order of entries displayed: Descending

Default Text Formatting for new entries: Convert Line Breaks

Default Post Status: Publish

Number of words in excerpt: 60

Sanitize Spec: Use defaults

Preferred Archive Type: Individual

File extension for archive files: htm

Notify the following sites when I update my blog: [ ] blo.gs [ ] weblogs.com (both cleared)

Allow Pings on by default? [x]

Email new TrackBack pings? [x]

Turn on TrackBack auto-discovery? [ ]

Allow anonymous comments? [ ]

Order of comments displayed: Ascending

Email new comments? [x]

Text Formatting for comments: Convert Line Breaks

Allow HTML in comments? [ ]

Auto-link URLs? [x]

Allow Comments default: Open

Archiving

======

Inspired by Anders Jacobsen, I put both date and title into the filename of my archive (for example: 20031109_movabletype_suggestions.htm). The advantages are: I can tell the content of an entry from the file name and the entries are sorted in time order. Also, the name makes more sense to Google and help Google to match my page with keywords. The disadvantage is, it makes the URL too long, sometimes longer than the 75 characters Jakob listed as No. 9 mistake in his article Top Ten Web-Design Mistakes of 2002.

Archive Type Archive File Template (?)

Individual <$MTArchiveDate format="%Y%m%d"$>_<$MTEntryTitle dirify="1"$>.htm

Category categories/<$MTArchiveCategory dirify="1"$>.htm

IP Banning

=======

Here is a list of my current IP banning list. I feel bad that I have ban a wide varity of IP from sending comment to my site. However, I cannot tolerent some spammer just change their IP’s last serveral digit (for example, when they are using dynamic ADSL ip).

194.221.32.17

193.219.66.170

193.219.66.179

213.136.113.

193.219.66.*

193.219.66

12.146.38.

202.146

61.181.5.118

193

208.63

61.181.

65.33.

209.210.176.

203.186.145.253

213.206.

62.42.228

203.186

212.171

62.42

209.21

66.169

66.119.

209.21

212.185

202.146.236.4

Template

Here is a list of templates I used in my website. I’d like to share with everyone so you may get inspired, as I benifit from many well designed websites.

You may need to save the files to your local disk and view it using your notepad.

Category Archive

Category News Feeding VBScript

Comments

Date-Based Archive

Individual Entry Archive

Main Index

Master Archive Index

News Feeding VBScript

RSS 0.91 Index

RSS 1.0 Index

Search Bar

VBScript Comment IP

WAP Index

Backup

Backup is critical especially when content management system like MovableType is used. I will get tearlessly sad if the database get corrupted. Currently, I am using three types of backup at the same time.

Full backup

From time to time (typically at interval of weeks), I will download everything from my website to local disk. The tool I am using is LeechFTP. This tool is really handy to do backup jobs. It let me feel secure that no matter what happened, I still can analyze the files on the disk to restore it. It did helped me in the last serveral disasters.

Export Entries

From time to time, I will also export my entries using the Export functions in MovableType. It is important that you double check that no entires contains a line that starts with many dashes – it is the seperator of MovableType and may cause problem.

MovableType Database Files

The database files of MovableType are also important. It is the easist way to restore from disaster if the database files are backed up.

Invalid Login on My MovableType

As some of you may have noticed, my site experienced technical difficulties yersterday. The comment system didn’t work. You will see Entry with ID “xx” does not exisit or page not found or other error messages. This lasted for about 20 hours.

For me, when I try to logon using my user name and password into MovableType, I got the following error:

“Invalid Login”

It seemed I have typed the wrong username and password, which I was very sure to be correct.

I tried the recover password in MovableType function but was told the user “Jian Shuo Wang” does not exist.

Wired

I was really scared and backed up everything immediately. I tried a lot of methods, including restore my previous backups to the server. These does not work. After that, I know something wrong with the server software, instead of my database files.

Answers have been Given

I should search with Google for “Invide Login” and MovableType earlier. Actually, this problem is descrbied in user mannual of MovableType already. According to the troubleshooting secton:

I changed hosts, and now I can’t log in to Movable Type

When you change hosting providers (or just move to a different server at the same provider), it is possible that the two servers have different versions of the Berkeley DB library; this is the library that Movable Type uses to store your data. When you copy the DB files from one host to another, if the two hosts have different versions of Berkeley DB, the new host will not be able to read the files from the old host.

This can be fixed by converting the DB files over to the format used by the new library version; this is accomplished in several different ways, depending on the Berkeley DB versions involved. The files that need to be converted are all of the files in your db directory whose filenames end in either .db or .idx (the .lock files do not need to be converted).

The Server Administrator Upgraded the Dataase Driver

It turned out that the server administrator has upgraded the database driver on the server. I checked the system with mt-check.cgi and got the following result:

Movable Type [mt-check.cgi]

SYSTEM INFORMATION:

Current working directory: E:/customer/wangjianshuo

Operating system: MSWin32

Perl version: 5.6.0

(Probably) Running under cgiwrap or suexec

CHECKING FOR REQUIRED MODULES:

HTML::Template (version >= 2)…

Your server has HTML::Template installed (version 2.6).

Image::Size…

Your server has Image::Size installed (version 2.992).

File::Spec (version >= 0.8)…

Your server has File::Spec installed (version 0.8).

CGI::Cookie…

Your server has CGI::Cookie installed (version 1.16).

CHECKING FOR DATA STORAGE MODULES:

The following modules are used by the different data storage options in

Movable Type. In order run the system, your server needs to have at least

one of these modules installed.

DB_File…

Your server has DB_File installed (version 1.806).

DBD::mysql…

Your server does not have DBD::mysql installed. DBI and

DBD::mysql are required if you want to use the MySQL database

backend. Please consult the installation instructions for help

in installing DBD::mysql.

DBD::Pg…

Your server does not have DBD::Pg installed. DBI and DBD::Pg

are required if you want to use the PostgreSQL database

backend. Please consult the installation instructions for help

in installing DBD::Pg.

DBD::SQLite…

Your server does not have DBD::SQLite installed. DBI and

DBD::SQLite are required if you want to use the SQLite database

backend. Please consult the installation instructions for help

in installing DBD::SQLite.

CHECKING FOR OPTIONAL MODULES:

The following modules are optional; if your server does not have these

modules installed, you only need to install them if you require the

functionality that the module provides.

LWP::UserAgent…

Your server has LWP::UserAgent installed (version 1.73).

SOAP::Lite (version >= 0.5)…

Either your server does not have SOAP::Lite installed, or the

version that is installed is too old. SOAP::Lite is optional;

it is needed if you wish to use the MT XML-RPC server

implementation. Please consult the installation instructions

for help in installing SOAP::Lite.

File::Temp…

Your server does not have File::Temp installed. File::Temp is

optional; it is needed if you would like to be able to

overwrite existing files when you upload. Please consult the

installation instructions for help in installing File::Temp.

Image::Magick…

Your server has Image::Magick installed (version 5.26).

Your server has all of the required modules installed; you do not need to

perform any additional module installations. Continue with the installation

instructions.

I cannot remember the previous version number, but it was obviously not 1.806 – this string seems so strange to me.

The Fix

The fix was easy – to run db_upgrade command on all *.db and *.idx.

“Run db_upgrade?” It is easy to say! The db_upgrade can be easily get on a Linux or Unix server. Where can I get db_upgrade command from a Windows system?

I searched the Internet and didn’t got an answer. The final fix was, not surprisingly, I asked for help from my friend Eric. He opened an account on his Linux server for me. I was not skilled enough to transfer data from Windows to Linux yet. So I opened FTP service on another Windows 2003 server, transfered all my *.db and *.idx files to that server, download it from the Linux server – thank God that the TCP/IP is working on the Linux. Run the db_upgrade *.db *.idx command at the folder containing the database files. Then transfer the new files back via the FTP server. It worked like a charm. The nightmare of the dabase problem ended.

Importance of Backup

Many articles are avaiable on Installation of MovableType. However, I didn’t see anyone talking about backup of MovableType. I suggest the following backup approach.

1. Export the Entries. On the MovableType console, click Import/Export from the left navigation bar and click Export Entries From <your blog name> and you see the HTML code. Do not directly click File -> Save as…. to save it. Instead, click View -> Source Code. After the codes are loaded in notepad, click Save on File menu to save it. I am using the naming convension of yyyymmdd-blogname-weekly.backup.txt to save the files.

Special note: Please check the exported files to make sure there is no lines with more than seven dashes “-“. Dashes from the begining of the line has sepecial meanings. So replace any seperator in comments or entry bodies like “”

2. Save all the .db and .idx files in your database folders. There should be 53 files of them. The .lock files always has 0 bytes in it and don’t need backup.

Adding Rank Bar to MovableType Entry

Recently, I added Rank Bars to all the recent entries, as you may have noticed.

screen-rankbar.PNG

The Rank Bars are the green bars attached to each of the entry titles. It reveals the popularity of the entry by the number of comments under that entry. The longer, the more comments it has. When you move your mouse on to the bar, the number of comments is shown as tool tip. Actually, every 10 pixel in width of the comment system means 1 comment.

The problem I met when I was designing this feature is, that the number of comments are not balanced among the entries. Although most entries have 2 to 5 comments, some entries have more than 100 comments. For example, this one in spam category has 234 comments already. If I use the 10 pixel per 1 comment algrithm, it will be 2340 pixel in width and will turn the pages into big mass.

Finally, I put another <span> tag with width of 100 pixel and set the overflow style to hidden, which means that all the extra part outside the span is hide, so the longest possible width is 100 pixel. (I may change this width limitation without update this article in the future).

Here is the code to implement this feature.

<div class=”comments-head”>Related Entries:</div>

<ul><MTRelatedEntries>

<MTEntries lastn=”6″>

<li><a href=”<MTEntryLink>”><MTEntryTitle></a> – <i><$MTEntryDate format=”%b %d, %Y”$></i> <span style=”width:100;overflow:hidden;”><img height=”4″ alt=”<$MTEntryCommentCount$> comment(s)” width=”<$MTEntryCommentCount$>0″ align=”absMiddle” border=”0″ src=”http://home.wangjianshuo.com/archives/2003/08/20/screen-rank.bar.gif”></span>

</MTEntries>

</MTRelatedEntries>

What do you think of this feature? Like it? You can try it on your own blog (if you own a blog and it is powered by MovableType). Paste your link in the comment system to let us know.

DB_File Error When Installing MovableType

I got ROSS’s email on DB_File Error this morning.

Hi Jian Shuo,

I have seen your instructions for installing Moveable Type on Windows XP and have come across a problem. I have followed the instructions exactly but when I try and install DB_File, I get the error:

PPM> Install DB_File

Install package ‘DB_File?’ (y/N): Y

Installing package ‘DB_File’…

Error installing package ‘DB_File’: Read a PPD for ‘DB_File’, but it is not inte

nded for this build of Perl (MSWin32-x86-multi-thread)

PPM> QUIT

when I run /mt/mt-check.cgi it tells me

DB_File…

Your server does not have DB_File installed. DB_File is

required if you want to use the Berkeley DB/DB_File backend.

Please consult the installation instructions for help in

installing DB_File.

and when I run /mt/mt-load.cgi it says:

Loading initial data into system…

An error occurred while loading data:

Unsupported driver MT::ObjectDriver::DBM: Can’t locate DB_File.pm in @INC (@INC contains: c:\inetpub\wwwroot\mt\extlib c:\inetpub\wwwroot\mt\lib C:/perl/lib C:/perl/site/lib .) at c:\inetpub\wwwroot\mt\lib/MT/ObjectDriver/DBM.pm line 9.

BEGIN failed–compilation aborted at c:\inetpub\wwwroot\mt\lib/MT/ObjectDriver/DBM.pm line 9.

Compilation failed in require at (eval 3) line 1.

BEGIN failed–compilation aborted at (eval 3) line 1.

I was wondering whether you would be able to try and help me?

many thanks

Ross

(United Kingdom)

It is a frequently asked question. I have described the steps to install MovableType in this blog: MovableType Successfully Installed on Windows XP, but it seems the DB_File is the place where most of the problems happen. This can be seen from the threads listed below. I even met the same problem when I worked with my technical professional on ISP side to move my host to another machine.

At that time, I feel lucky that I have posted the steps on the web, so others like Samuel Wan have posted his solution to the page. I used the resource and steps he listed and successfully solved the problem. I’d like to thank Mr. Wan to share the tips and would like to summarize the steps.

Steps to install DB_File on ActivePerl 5.6.0

If you see this error message when installing DB_File

PPM> Install DB_File

Install package ‘DB_File?’ (y/N): Y

Installing package ‘DB_File’…

Error installing package ‘DB_File’: Read a PPD for ‘DB_File’, but it is not inte

nded for this build of Perl (MSWin32-x86-multi-thread)

It means the default repository of perl modules does not exist – this may be caused by the upgrade of the website or the perl module. You need to manually install the DB_File.

The installation should be successful. Please post after this thread if you find it work or does not work.

Add Unsubscribe Function to MovableType

Adding unsubscription function into MovableType has been a very hot topic in MovableType Support Forum (refer to this post and that one.

Tonight, I spent some time to think about it and changed the code a little bit to support unsubscription function.

mt-add-notify.cgi

my $note = MT::Notification->new;

$note->blog_id( $q->param('blog_id') );

$note->email( $q->param('email') );

$note->url( $q->param('url') );

$note->save;

As you can see, I added a line into the code – as shown in red. I am using the existing URL field to add a tag of unsubscription. By utilizing existing fields, we reduce the code changes.

Result for subscription

By default, MovableType does not offer the subscription success confirmation page. It redirect users to the home page of the weblog by default. It is very confusing since subscribers don’t know what happened. We need to create one by yourself and change the _redirect input field of the subscription page. Refer to MovableType’s help for suggestions on adding “subscribe” function to your page.

<form method="post" action="http://home.wangjianshuo.com/mt/mt-add-notify.cgi">

<p>Enter your email address in the textbox below and click Subscribe</p>

<input type="hidden" name="blog_id" value="1">

<input type="hidden" name="_redirect" value="http://www.wangjianshuo.com/news/20020126JSZine/subscribe.htm">

<input name="email" size="56" value="Enter your email"><br>

<input type="submit" value="Subscribe"> </p>

</form>

Unsubscribe

<form method="post" action="http://home.wangjianshuo.com/mt/mt-add-notify.cgi">

<p>Please enter your email address in the box below</p>

<input type="hidden" name="blog_id" value="1">

<input type="hidden" name="_redirect" value="http://www.wangjianshuo.com/news/20020126JSZine/unsubscribe.htm">

<input name="email" size="56" value="Enter your email"><br>

<input type="hidden" name="url"

value="unsubscribe" / >

<input type="submit" value="Unsubscribe"> </p>

</form>

I added a hidden field called URL with value of unsubscribe. Thus you can see the who is willing to unsubscribe from the notification list and do it manually when you notice it.

Want to have a try?

Please check the homepage of my weblog. The notification subscription area is at the right-top corner. You can also directly visit the subscription page.

Next step

It is ideal if we can add code for removing the Email from $note database directly in MT-add-notify.cgi. I don’t have time to do it now, but it should be very easy. Please let me know if you have done so.

MovableType Successfully Installed on Windows XP

To be honest, I don’t know too much about Perl. However, to make the best weblog system work – Movable Type, I installed Perl onto my Windows XP machine from scretch. I believe I am not alone to install MT to Windows XP machines – although I believe there will not be too many people doing so – so I’d like to record the steps for other’s reference. It is also a good resource for myself if I need to rebuild the server.

Environment

Windows XP

Inetnet Information Server (IIS)

Install Perl on Windows XP

  • Download ActivePerl for Windows XP from ActiveState. At the time I downloaed, the version was ActivePerl 5.6.1 build 633.
  • After registering my user information, I choosed WIndows MSI package, which is 8.31M in size.
  • It took me about 2 minutes and 51 seconds to download – thanks to the broadband provider – China Great Wall Broadband Corp[Chinese site]. I haven’t dreamed of downloading files larger than 5M in 10 minutes before.
  • Install the MSI package. There is no any problem during the installation. I accepted all the defaul settings expect changing the default location from c:\Perl to c:\Program Files\Perl. I believe it is always good to follow the Windows convension instead of seeking for a place in root directory of C:\. This makes the disk hard to manage. Update: I am changing my mind recently. “C:\Program Files” folder is special in terms of Read-only settings and security permissions. Moving programs from their original location to this folder may bring unneccessary trouble if the program has never been tested in this environment.

Download MT source code

  • Download the MT source code from http://www.movabletype.org/download.shtml. It is only 299K in size and took me 5 seconds to get it from the other side of the Pacific.
  • Having MT-2.21.tar.gz on my disk, I met the first problem. I rely heavily on Windows XP to extract all .ZIP files and don’t use WinZip any more, but it seems I need to get my Winzip back. OK. Download a trial version from www.winzip.com and continue.
  • Now all the source code is located in C:\Inetpub\Wwwroot\Mt folder, which can be accessed via http://home.wangjianshuo.com/mt. I am very serious about naming convensions. I cannot bear to put all the files directly into the root folder.

Configure IIS for Perl and perl script with .CGI extension to work

  • I know it is wired for more green hand to have CGI run on Windows computer. At this time, if anyone access http://home.wangjianshuo.com/mt/mt.cgi, it will prompt to download the file instead of see the result. I configured IIS to recognize .CGI extension just as it recognize .ASP or .SHTML.
  • In Inetmgr.exe, right click MT folder and select Properties. Click Create button in Application Settings area on Directory tab. Now we have created a seperate application.
  • Click Configure and check the program to parse .pl files. It is C:\program files\perl\bin\perl.exe “%s” %s for my server.
  • Note: The following changes can be changed on website level, no applicaiton level. Click Add and enter the same parsing program (C:\program files\perl\bin\perl.exe “%s” %s for my case) and enter .cgi to Extension text box. Click OK.

Configure MT to work on my site

  • Open MT.cfg
  • Changed the CGIPath to http://home.wangjianshuo.com/mt/
  • Changed DataSource to c:\inetpub\wwwroot\mt\db\ (Alex reminded me that I need to state that you have to create the db folder yourself. The db folder does not exist by default).

Updated: Install additional MT modules

Before you can run your MovableType, you still need to install more required ActivePerl components. As stated in Checking for Perl Modules section of MovableType Installation menual, you need to run http://home.wangjianshuo.com/mt/mt-check.cgi.

At the time I downloaded ActivePerl, it includes most of the required modules except the following:

DB_File

Image-Size

HTML-template

Typically, you need to follow these steps:

1. Start -> Run

2. Type “cmd” and click “OK”

3. In DOS command line, enter “PPM” (without quotation marks)

4. When PPM> prompt apprears, type “Install HTML-template”

5. Wait until it is installed, then type “Install Image-Size”

6. Type “Install DB_File”

7. Quite PPM program.

Thanks for Jeff for pointing this out. I forgot to add this item before.

Updated again Fail to Install DB_File

If you see this error message when installing DB_File

PPM> Install DB_File

Install package ‘DB_File?’ (y/N): Y

Installing package ‘DB_File’…

Error installing package ‘DB_File’: Read a PPD for ‘DB_File’, but it is not inte

nded for this build of Perl (MSWin32-x86-multi-thread)

You may try to follow the steps below:

Thanks for Samuel Wan for pointing this out for me. I have also wrote another blog entry on this: DB_File Error When Installing MovableType

Complete the installation

  • After all the steps are perfomed, there is very little work left. Just follow the installation instruction and it works very well.
  • The user manual is also very good resource to go ahead to configure the MT system.

Updated Sending Email on Windows XP

Sending email on Unix system seems easy. Just configure the sendmail command and it will work. Typically you don’t have any SMTP server that you can configure MT to send to. To port MovableType on Windows system (Windows 2000 or Windows XP or Windows .NET Server), you will need to configure the SMTP services of IIS.

  • Check you have IIS install with SMTP service. Start -> Control Panel -> Add/Remove Programs -> Add/Remove Windows Component. (or simply Start -> Run -> AppWiz.cpl). Ensure IIS is selected. You may also want to click Details… button to see if SMTP is installed within IIS.
  • Make sure SMTP is started. Start -> Run -> InetMgr.exe. Make sure SMTP is up and running.
  • Configure On properity sheet of SMTP Viture Server, click Relay button on Access tab. The default setting is “Only the list below”. Add the IP address of the server your MovableType is hosted to the list. Or, select “All expect the list below”. The later one is not recommended since it may open a door for spammers to use your server to send spams. (Microsoft has more detailed articles on configuration of SMTP Service.)
  • Configure MovableType to send mail using local SMTP server. Uncomment the lines below in mt.cfg file.

    MailTransfer smtp

    SMTPServer localhost

    Replace localhost with the host name of your SMTP server if you are hosting the servers on two machines.

Acknowledgement

  • I’d like to thank Geo, who writes for www.russianlegs.com. He inspired me with the idea of WebLog. After talking with him on the issue of Google’s block in China, I was aware of the weblog trends and joined it.
  • I also want to thank andersja, the owner of anderrsja’s blog. His site on weblog are very well done. I learnt a lot on categories and the pertential usage of MovableType from his site.

This posting is provided “AS IS” with no warranties, and confers no rights.