用镜头记录,用心灵体验 | 订阅本站 | 所有笔记 | 亲和力设计 | 流量

DB2 学习笔记

博客话题:DB2,Linux,Web,业余无线电,户外,摄影,截拳道,Thankpad,其他

Movable Type

MT(Movable Type) Blog 程序使用的技术话题,本站即采用MT发布

升级MT4 带来的plugins问题:Blogroll, LinkRoller, Favicon and etc

LinkRoller替代Blogroll 升级到MT4,比较普遍的问题就是插件兼容性,被抱怨的比较多的是Blogroll,Blogroll的标签在MT4中无法识别,作者到目前为止还没有升级代码,有人发布了一个替代品LinkRoller ,但有部分Blogroll的功能没有实现:Link的分类和优先顺序,临时的解决方法是用tags与创建时间来对应。 LinkRoller作者提供了安装指南,文件copy 结束,重新访问MT4管理界面,会提示升级,升级过程会将Blogroll所属表的数据自动导入MT4的Asset系列表中(不copy Blogroll的lib文件到LinkRoller 也可以自动导入数据),原来Blogroll的Category(分类)属性,在LinkRoller中会关联到Tags属性。 plugin升级完成后,更新模板代码(参照了Justin的文章):<mt:Tags type="asset" sort_by="name"><h2><mt:TagName></h2><MTSetVarBlock name="linktag"><mt:TagName /></MTSetVarBlock><ul class="links"><mt:assets type="link" tag="$linktag" sort_by="$created_on"...

LinkRoller替代Blogroll

升级到MT4,比较普遍的问题就是插件兼容性,被抱怨的比较多的是Blogroll,Blogroll的标签在MT4中无法识别,作者到目前为止还没有升级代码,有人发布了一个替代品LinkRoller ,但有部分Blogroll的功能没有实现:Link的分类和优先顺序,临时的解决方法是用tags与创建时间来对应。

LinkRoller作者提供了安装指南,文件copy 结束,重新访问MT4管理界面,会提示升级,升级过程会将Blogroll所属表的数据自动导入MT4的Asset系列表中(不copy Blogroll的lib文件到LinkRoller 也可以自动导入数据),原来Blogroll的Category(分类)属性,在LinkRoller中会关联到Tags属性。

plugin升级完成后,更新模板代码(参照了Justin的文章):

<mt:Tags type="asset" sort_by="name">
<h2><mt:TagName></h2>

<MTSetVarBlock name="linktag"><mt:TagName /></MTSetVarBlock>
<ul class="links">
<mt:assets type="link" tag="$linktag" sort_by="$created_on" sort_order="ascent">

  <li><a href="<mt:assetURL />" title="<mt:assetDescription />"><mt:assetLabel /></a><li>
</mt:assets>
</ul>

</mt:Tags>

这部分代码会显示不同Tags下面的Links(首页右侧有实例),Links的顺序以创建时间为准,这符合我原来的需求,也可以更改为按名称排序等方式:sort_by="label",如果需要再现在Blogroll 当中手工设置的无规律排序方式,那么有点麻烦,有人变通的活用了Author 属性。 

如果遇到Plugin升级后,Link数据有中文乱码的问题,如果是Mysql数据库,那么可以检查一下mt_asset表的字符集设置,如果是Latin1,改成utf8试试,直接Alter表和相关列的定义即可,数据不用动。值得一提的是Mysql有非常灵活的字符集设定,可以在安装实例、数据库、表、列,不同的级别上独立设定,因此Alter命令必须在表本身,以及所有需要的列上面分别运行。

Favicon

Favicon是个获取网站访问者的网站的favicon.ico的插件,只能用在Comments与Trackbacks的上下文中,目前的版本还是1.4,默认地,其在MT4中可以很好的运行。如果不幸遇到以下错误信息:"Undefined subroutine &URI::Escape::escapechar called",那么可能是MT4的某个插件包含了一个较MT4 自身lib更旧的Escape.pm,在我的例子里是Blogroll,找到后将其删除或者重命名即可。

$ find cgi-bin/mt -name "Escape.pm"
$ mv cgi-bin/mt/plugins/Blogroll/lib/Escape.pm cgi-bin/mt/plugins/Blogroll/lib/Escape.pm.bak

我曾经为Favicon加了几行代码,让其支持Blogroll的标签,即自动获取好友网站的favicon.ico并显示在其链接上。同样地,对于LinkRoller,也需要几行额外的代码:

sub favicon {
        my($ctx, $args) = @_;
        my $c;
        my $u;
        if ($c = $ctx->stash("ping")) {
                favicon_debug("Trackback in MTFavicon");
                $u = $c->source_url;
        } elsif ($c = $ctx->stash("comment")) {
                favicon_debug("Comment in MTFavicon");
                $u = $c->url;
                favicon_debug("URL for comment ID <" . $c->id . "> is <$u>");
        } elsif ($c = $ctx->stash("br_entry")) {
                favicon_debug("Blogroll in MTFavicon");
                $u = $c->uri;
        } elsif ($c = $ctx->stash("asset")) {
                favicon_debug("LinkRoller in MTFavicon");
                $u = $c->url;

        } else {
                favicon_debug("Error: MTFavicon called without a comment or trackback in context");
                return $ctx->error("Error: MTFavicon called without a comment or trackback in context");
        }
        return favicon_return($u, $ctx, $args);

将以上加重的部分加入文件cgi-bin/mt/plugin/Favicon/favicon.pl 对应的位置即可。

如何使用Favicon?下面是一个例子:

<mt:Tags type="asset" sort_by="name">
<h2><mt:TagName></h2>

<MTSetVarBlock name="linktag"><mt:TagName /></MTSetVarBlock>
<ul class="links">
<mt:assets type="link" tag="$linktag" sort_by="$created_on" sort_order="ascent">
<li>
<MTFaviconIfAvailable>
  <img src="<$MTFavicon$>" alt="Siteicon" title="Siteicon" height="16" width="16" />
</MTFaviconIfAvailable>

  <a href="<mt:assetURL />" title="<mt:assetDescription />"><mt:assetLabel /></a><li>
</mt:assets>
</ul>

</mt:Tags>

其它插件

WidgetManager 遇到了一点小问题,升级过程仅仅将我自定义的Widgets 名称迁移到MT4,而下面包含的Module 信息丢失了,不得不手工又添加了一遍。

mt-varz 在MT4中内建了,如果将它留在MT4的plugins目录中,登录MT4管理界面会出错。

MT4引入的所有plugins.

除此以外,我用到的其它plugins在MT4中都很正常:

  • Collect 1.2
  • Feeds.App Lite 1.01
  • TagSupplementals 0.22
  • mt-archive-dateheader

 

Posted by Alex at 9:42 AM | Comments (1) | Edit | Taged: Blogroll (2), favicon (2), linkroller (1), MT (25), plugin (8)

MT3.34 升级至 MT4.26 数据库中文乱码的解决

上次升级MT是两年前的事情了,过程很顺利,这次就没那么幸运,遇到了字符集的问题,此外还有一些插件的问题,而且都比较棘手。 字符集的问题与虚拟主机有一定关系,数据存储在Dreamhost主机的mysql数据库中,3.34版本的数据库使用Dreamhost上Mysql默认的字符集Latin1,升级完成,切换到MT4.26之后,登录MT后台管理,数据库中所有的中文是乱码(问号),尝试了一个从前(MT3.34)的解决方法: 在文件 cgi-bin/mt/lib/MT/ObjectDriver/DBI/mysql.pm 中增加一行: $driver->{dbh}->do("SET NAMES 'utf8'");,这句代码告诉数据库,客户端和数据库连接都使用utf-8编码,数据库返回的数据也使用utf-8编码,但于事无补,乱码依旧。临时学习了一下Mysql处理字符集的机制,找到了一个解决方法:先将升级后(MT4.26)的数据导出,然后新建一个utf-8编码的数据库,最后导入数据即可。 导出数据:$ mysqldump -h HOSTNAME -u USERNAME -p DBNAME...

上次升级MT是两年前的事情了,过程很顺利,这次就没那么幸运,遇到了字符集的问题,此外还有一些插件的问题,而且都比较棘手。

字符集的问题与虚拟主机有一定关系,数据存储在Dreamhost主机的mysql数据库中,3.34版本的数据库使用Dreamhost上Mysql默认的字符集Latin1,升级完成,切换到MT4.26之后,登录MT后台管理,数据库中所有的中文是乱码(问号),尝试了一个从前(MT3.34)的解决方法: 在文件 cgi-bin/mt/lib/MT/ObjectDriver/DBI/mysql.pm 中增加一行: $driver->{dbh}->do("SET NAMES 'utf8'");,这句代码告诉数据库,客户端和数据库连接都使用utf-8编码,数据库返回的数据也使用utf-8编码,但于事无补,乱码依旧。临时学习了一下Mysql处理字符集的机制,找到了一个解决方法:先将升级后(MT4.26)的数据导出,然后新建一个utf-8编码的数据库,最后导入数据即可。

导出数据:

$ mysqldump -h HOSTNAME -u USERNAME -p DBNAME > DUMPFILE

Dreamhost中似乎无法命令行创建数据库,只能在Web phpMyAdmin中创建,Dreamhost的Mysql服务器参数character_set_server的默认值是utf8(从前是Latin1),可以用以下命令查看:

mysql> use DBNAME;
mysql> show variables like 'character_set_%';

如果不是utf8,可以用以下命令修改:

mysql> alter database DBNAME default character set utf8;

最后一步,导入数据:

$ mysql -h HOSTNAME -u USERNAME -p DBNAME < DUMPFILE

补充一下,查看了部分MT4的代码,在mt-config.cgi中设定: PublishCharset utf-8 应该相当于在应用程序中: SET NAMES 'utf8',而Dreamhost Mysql服务器目前与字符集有关参数的默认值如下:

+--------------------------+---------------------------------------------+
| Variable_name            | Value                                       |
+--------------------------+---------------------------------------------+
| character_set_client     | latin1                                      |
| character_set_connection | latin1                                      |
| character_set_database   | utf8                                        |
| character_set_filesystem | binary                                      |
| character_set_results    | latin1                                      |
| character_set_server     | latin1                                      |
| character_set_system     | utf8                                        |
+--------------------------+---------------------------------------------+

与客户端有关的几个参数默认值是Latin1(非utf8),而MT4的PublishCharset默认值与MT后台管理User的Language 设定有关,对于值English,其对应了编码utf-8,此时,可以省略mt-config.cgi中的PublishCharset设定。

有关插件的部分再单独讨论。

参考资料

Posted by Alex at 7:36 AM | Comments (1) | Edit | Taged: MT (25), upgrade (5)

让你的Blogroll 看起来更生动

Blogroll 是MT 的一个非常强大的插件,它的众多功能是围绕着链接管理 展开的,使用它,我可以很方便的在侧边栏添加一个新的外部或者内部链接,而无需去直接修改模板。 现今,相当一部分bloger 都为自己的blog 设计有icon,一般在站点根目录下,命名为favicon.ico。我们可以在他们的链接前自动加上他们自己的icon,这样可以使链接看起来更生动,让那些对其有印象的访问者可以迅速识别出来。 Favicon  Blogroll 不支持这个功能,我找到了另外一个插件Favicon 1.4 ,但它仅仅在comments 与 trackback 的上下文中有效,并不支持Blogroll,我对其进行了小的改动,增加了一小段代码(加重部分),使其支持Blogroll。...

BlogrollMT 的一个非常强大的插件,它的众多功能是围绕着链接管理 展开的,使用它,我可以很方便的在侧边栏添加一个新的外部或者内部链接,而无需去直接修改模板。

现今,相当一部分bloger 都为自己的blog 设计有icon,一般在站点根目录下,命名为favicon.ico。我们可以在他们的链接前自动加上他们自己的icon,这样可以使链接看起来更生动,让那些对其有印象的访问者可以迅速识别出来。

Favicon 

Blogroll 不支持这个功能,我找到了另外一个插件Favicon 1.4 ,但它仅仅在comments 与 trackback 的上下文中有效,并不支持Blogroll,我对其进行了小的改动,增加了一小段代码(加重部分),使其支持Blogroll。

plugin/Favicon/favicon.pl

sub favicon {
        my($ctx, $args) = @_;
        my $c;
        my $u;
        if ($c = $ctx->stash("ping")) {
                favicon_debug("Trackback in MTFavicon");
                $u = $c->source_url;
        } elsif ($c = $ctx->stash("comment")) {
                favicon_debug("Comment in MTFavicon");
                $u = $c->url;
                favicon_debug("URL for comment ID <" . $c->id . "> is <$u>");
        } elsif ($c = $ctx->stash("br_entry")) {
                favicon_debug("Blogroll in MTFavicon");
                $u = $c->uri;
        } else {
                favicon_debug("Error: MTFavicon called without a comment or trackback in context");
                return $ctx->error("Error: MTFavicon called without a comment or trackback in context");
        }
        return favicon_return($u, $ctx, $args);
}

我使用MT 3.34 与Blogroll 2.51,如果您认为合适,可以直接下载修改过的favicon.pl

进行以上修改,需要参考以下两个文件:

plugin/Blogroll/Blogroll.pl
plugin/Blogroll/lib/Blogroll/Template/ContextHandlers.pm 

Blogroll

为了显示icon,接下来需要修改Blogroll 部分的模板,添加一部分代码(加重的部分),以下是一个的例子:

<ul>
<MTBlogrollLinks>
<li>
    <MTFaviconIfAvailable>
<img src="<$MTFavicon$>" alt="Siteicon" title="Siteicon" height="16" width="16" />
</MTFaviconIfAvailable>
<a href="<$MTBlogrollLinkURI$>"><$MTBlogrollLinkName$></a>
</li>
</MTBlogrollLinks>
<ul>

如果你还没有自己的favicon.ico,可以在这里,使用自己的图片免费生成一个 。 

延展阅读

 

Posted by Alex at 1:11 PM | Edit | Taged: Blogroll (2), favicon (2)

恢复MT 控制台密码

这篇文章 描述了从DB 恢复MT 控制台密码的方法。 $ perl -e "print crypt('password', 'ac');" mysql> update mt_author set author_password...

这篇文章 描述了从DB 恢复MT 控制台密码的方法。

$ perl -e "print crypt('password', 'ac');"

mysql> update mt_author set author_password = '???' where author_name = 'XXX';

使用print 出来的字符串替换"???","XXX" 是登录用户名。然后使用"password" 作为密码即可登录。

"password"  与 "ac"  可随意更改。

Posted by Alex at 12:53 PM | Comments (0) | Edit | Taged: MT (25), Password (2)

MT 3.33 至MT3.34

升级的好处 我就不多说了,这里介绍一点升级过程中的tips。 比较文件 将程序解压、解包之后放入与上一版本同级的目录,取名mt3.34 ./mt ./mt3.34 上一版本因为额外安装有插件以及个别hack文件,不能完整替换,先比较两个目录,使用-q 参数忽略具体文件差异,-r 递归子目录。 $ diff -qyr mt3.34 mt |grep...

升级的好处 我就不多说了,这里介绍一点升级过程中的tips。

比较文件

将程序解压、解包之后放入与上一版本同级的目录,取名mt3.34

./mt
./mt3.34

上一版本因为额外安装有插件以及个别hack文件,不能完整替换,先比较两个目录,使用-q 参数忽略具体文件差异,-r 递归子目录。

$ diff -qyr mt3.34 mt |grep Only 

Only in mt: mt-config.cgi
Only in mt3.34: mt-config.cgi-original
Only in mt/php/extlib/smarty: .cvsignore
Only in mt/php/plugins: block.MTBlogrollCategories.php
Only in mt/php/plugins: block.MTBlogrollLinkCategories.php
Only in mt/php/plugins: block.MTBlogrollLinkIfTagged.php
Only in mt/php/plugins: block.MTBlogrollLinkIfUpdated.php
Only in mt/php/plugins: block.MTBlogrollLinkTags.php
Only in mt/php/plugins: block.MTBlogrollLinks.php
Only in mt/php/plugins: block.MTBlogrollTags.php
Only in mt/php/plugins: function.MTBlogrollCategoryCount.php
Only in mt/php/plugins: function.MTBlogrollCategoryDesc.php
Only in mt/php/plugins: function.MTBlogrollCategoryDescription.php
Only in mt/php/plugins: function.MTBlogrollCategoryID.php
Only in mt/php/plugins: function.MTBlogrollCategoryLabel.php
Only in mt/php/plugins: function.MTBlogrollLinkBlogAuthor.php
Only in mt/php/plugins: function.MTBlogrollLinkCategory.php
Only in mt/php/plugins: function.MTBlogrollLinkDate.php
Only in mt/php/plugins: function.MTBlogrollLinkDesc.php
Only in mt/php/plugins: function.MTBlogrollLinkDescription.php
Only in mt/php/plugins: function.MTBlogrollLinkID.php
Only in mt/php/plugins: function.MTBlogrollLinkModifiedDate.php
Only in mt/php/plugins: function.MTBlogrollLinkName.php
Only in mt/php/plugins: function.MTBlogrollLinkPriority.php
Only in mt/php/plugins: function.MTBlogrollLinkRel.php
Only in mt/php/plugins: function.MTBlogrollLinkTarget.php
Only in mt/php/plugins: function.MTBlogrollLinkURI.php
Only in mt/php/plugins: function.MTBlogrollLinkURL.php
Only in mt/php/plugins: function.MTBlogrollLinkUpdated.php
Only in mt/php/plugins: function.MTBlogrollTagCount.php
Only in mt/php/plugins: function.MTBlogrollTagID.php
Only in mt/php/plugins: function.MTBlogrollTagName.php
Only in mt/php/plugins: function.MTBlogrollTagRank.php
Only in mt/php/plugins: plugins
Only in mt/plugins: Ajaxify
Only in mt/plugins: Blogroll
Only in mt/plugins: CheckLinks
Only in mt/plugins: Collect
Only in mt/plugins: FlickrPhotos
Only in mt/plugins: TagSupplementals.pl
Only in mt/plugins: mt-archive-dateheader.pl
Only in mt/plugins: mt-varz.pl

合并文件 

然后将上一版本多出或者更新日期更新的文件copy 到新版本,为了保险起见,使用-i 参数确认任何文件覆盖。

$ cp -iur  mt/plugins/* mt3.34/plugins 

 然后手动编辑合并曾经hack 过的文件,在这里我曾经修改了mysql.pm 以及批量编辑basename 所需的相关文件。

$ diff  mt3.34/lib/MT/ObjectDriver/DBI/mysql.pm mt/lib/MT/ObjectDriver/DBI/mysql.pm

1c1
< # Copyright 2001-2007 Six Apart. This code cannot be redistributed without
---
> # Copyright 2001-2006 Six Apart. This code cannot be redistributed without
5c5
< # $Id: mysql.pm 1003 2007-01-05 23:46:47Z gboggs $
---
> # $Id: mysql.pm 653 2006-08-04 19:33:48Z bchoate $
63c63
<             $driver->{dbh}->do("SET NAMES " . $c) or
---
>             $driver->{dbh}->do("SET NAMES " . $c) or
99a100
>     $driver->{dbh}->do("SET NAMES 'utf8'");

 

可以使用vi 同时编辑多个文件,使用:n 与:N 命令进行切换,剪贴板缓冲区是共享的,方便copy 代码行。

$ vi   mt3.34/lib/MT/ObjectDriver/DBI/mysql.pm   mt/lib/MT/ObjectDriver/DBI/mysql.pm

批量编辑basename 一般在大规模迁移时才会用到,这次就不修改了。

cgi-bin 目录的所有升级就完成了,把mt-statics copy 到相应目录,重复以上步骤。

版本切换 

全部完成后,把两组新旧目录名称迅速交换,再打开MT控制台,发现升级已经生效,没遇到任何错误,算是无缝切换。 

Posted by Alex at 7:55 PM | Comments (0) | Edit | Taged: MT (25), upgrade (5)

一直无法接收Trackback

今天查看网站日志,发现有trackback 进来,但都是403错误,使用自己的msn space进行测试,结果相同。车东给了解决方法:MT HTTP error: 403 Throttled的原因和解决,统计一下log中的trackback数量,一天有1000多条trackback,而且几乎全部是spam, [hostname]$ grep mt-tb.cgi ./access.log.2007-03-18 |wc -l 1301 在我的mt-config.cgi加入如下2行...

今天查看网站日志,发现有trackback 进来,但都是403错误,使用自己的msn space进行测试,结果相同。车东给了解决方法:MT HTTP error: 403 Throttled的原因和解决,统计一下log中的trackback数量,一天有1000多条trackback,而且几乎全部是spam,

[hostname]$ grep mt-tb.cgi ./access.log.2007-03-18 |wc -l
1301

在我的mt-config.cgi加入如下2行

OneHourMaxPings 5000
OneDayMaxPings 20000

再次测试,日志中显示正常code 200,但页面并没有生成trackback 的引用。在Yee 这里 ,又找到了部分Dreamhost 主机不支持国内trackback过来的说法,于是,在此blog内部进行了trackback 测试,结果一切正常,证实了Yee 的说法。 

有趣的是,又有新的发现,在Junk TrackBacks 里面发现了几千个trackback,也包扩我在msn space 后来做的测试。虽然这不能说明Yee 的说法是错误的,但至少可以证明我不在那部分Dreamhost 主机当中。

 

Posted by Alex at 3:06 AM | Comments (2) | Edit | Taged: Dreamhost (4)

Get rollable entry list in MT - postroll.js

Most of blogers have the recent entry list at the sidebar. Sometime it's difficult to...

Most of blogers have the recent entry list at the sidebar. Sometime it's difficult to balance spacing and convenience. People may want more entries in the list, but they may also want to see other feature area without rolling scrollbar too much. I wrote a Javascript postroll.js that make the entry list rollable as far as you expect.

How does it work? Download postroll.js to your web server path and include it in your web page that you need the feature. Then edit your tempate like below. The template code is a little thick but works.

<h2>最近更新|Recent Entries</h2>
<div id="recententry" class="module-content">
<ul id="recententry1">
<MTEntries lastn="5">
<li><$MTInclude module="Entry Link"$></li>
</MTEntries>
</ul>
<MTEntries offset="5" lastn="1">
<MTIfNonEmpty tag="EntryTitle"><$MTSetVar name="recententry2" value="1"$></MTIfNonEmpty>
</MTEntries>
<MTIf name="recententry2">
<ul id="recententry2">
<MTEntries offset="5" lastn="5">
<li><$MTInclude module="Entry Link"$></li>
</MTEntries>
</ul>
</MTIf>
<MTEntries offset="10" lastn="1">
<MTIfNonEmpty tag="EntryTitle"><$MTSetVar name="recententry3" value="1"$></MTIfNonEmpty>
</MTEntries>
<MTIf name="recententry3">
<ul id="recententry3">
<MTEntries offset="10" lastn="5">
<li><$MTInclude module="Entry Link"$></li>
</MTEntries>
</ul>
</MTIf>
<MTEntries offset="15" lastn="1">
<MTIfNonEmpty tag="EntryTitle"><$MTSetVar name="recententry4" value="1"$></MTIfNonEmpty>
</MTEntries>
<MTIf name="recententry4">
<ul id="recententry4">
<MTEntries offset="15" lastn="5">
<li><$MTInclude module="Entry Link"$></li>
</MTEntries>
</ul>
</MTIf>
<MTEntries offset="20" lastn="1">
<MTIfNonEmpty tag="EntryTitle"><$MTSetVar name="recententry5" value="1"$></MTIfNonEmpty>
</MTEntries>
<MTIf name="recententry5">
<ul id="recententry5">
<MTEntries offset="20" lastn="5">
<li><$MTInclude module="Entry Link"$></li>
</MTEntries>
</ul>
</MTIf>
<label id="recententrybar1"></label><label id="recententrybar2"></label>
<!--end #recententry-->
</div> 
 The emphasis must be followed in your code, otherwise need to configure yours in postroll.js.
// Configuration
Postroll = {
box: ["recententry"],
bar1: ["recententrybar1"],
bar2: ["recententrybar2"],
bar1_txt: "&nbsp;&nbsp;&laquo;&nbsp;&nbsp;&nbsp;&nbsp;",
bar2_txt: "&nbsp;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;",
bar1_lnk_title: "Previous 5 entries",
bar2_lnk_title: "Next 5 entries"
};

Then have this style in the css. I don't use script to initial the style because this method is quicker for the page first loading. There won't be a long entry list at a moment then hided by the script. I use script to initial the text link for rolling entries and control the entry roll after all stuffs were loaded.

#recententry2,
#recententry3,
#recententry4,
#recententry5 {
display: none;
} 

There's more action you need to take if want it works perfect! Create a file name as ie_onload.js, and have below only line. About ie_onload.js here's an explanation.

 try{Postroll.run()}catch(e){} 

This script is able to serve multi-area in one page. That case you should have the configuration like below. It could be 3 groups or more.

 // Configuration
Postroll = {
box: ["recententry", "othertag"],
bar1: ["recententrybar1", "othertagbar1"],
bar2: ["recententrybar2", "othertagbar2"]
bar1_txt: "&nbsp;&nbsp;&laquo;&nbsp;&nbsp;&nbsp;&nbsp;",
bar2_txt: "&nbsp;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;",
bar1_lnk_title: "Previous 5 entries",
bar2_lnk_title: "Next 5 entries"
};

Update 2007-02-14 

I found that there's one post missed on each 5 posts in the postroll list. The point is that I had  wrong offset value in MTEntries tag. I've updated the template code above from offset="6" to offset="5" and also for the value of 11, 16 and 21.

Posted by Alex at 1:44 AM | Comments (0) | Edit | Taged: Javascript (5), MT (25)

无法删除MT widget 默认module的问题

升级MT3.3 以后多了不少plugin,其中包括Widgets Manager,Widget 这个词最近在Blog 出现频率很高,也不知道到底是何物,今天google了一下,才知道大部分人谈论的Widget 与我要了解的MT Widget 还不是一回事。 这里有篇文章详细介绍:使用Movable Type的Widgets,我就不废话了。只说一个奇怪的问题,Widget Manager 会在Template 的Module 中生成默认的Widget 可以利用的Module,我已经有了很多类似的Module,于是把已有的Module重命名,在名称前面加上"Widget: "...
升级MT3.3 以后多了不少plugin,其中包括Widgets Manager,Widget 这个词最近在Blog 出现频率很高,也不知道到底是何物,今天google了一下,才知道大部分人谈论的Widget 与我要了解的MT Widget 还不是一回事。 这里有篇文章详细介绍:使用Movable Type的Widgets,我就不废话了。只说一个奇怪的问题,Widget Manager 会在Template 的Module 中生成默认的Widget 可以利用的Module,我已经有了很多类似的Module,于是把已有的Module重命名,在名称前面加上"Widget: " 前缀,这样就可以被Widget Manager 识别,然后将默认的全部删除,但是下一次点击Manage my Widgets进入后,这些默认的Module 又会自动生成,没有找到解决办法,最后将我自己的Module修改成与默认的具有相同的名字(大小写敏感),才算了事。

Posted by Alex at 7:24 PM | Comments (0) | Edit | Taged: MT (25), plugin (8), widget (1), 模板 (2)

重构MT模板结构

MT默认的模板包含大量的重复或者类似模板代码,当你需要进行一处模板修改时,也许不得不考虑得更多,并在多个模板中同时进行,已达到统一的效果。 模板重构的目的就是尽可能将多个模板之间相同的部分抽象出来,然后在多个模板中进行引用,另外还有趋向于将一组具有相同功能的模板代码放入同一个模板文件 的作用,从而减少模板修改带来的工作量。MT很早就在模板中支持Module,定义好的Module可以通过如下代码进行引用。 <$MTInclude module="Module Name"$> 我 们需要做的就是把重复的模板代码放在一个个Module中进行定义,然后在模板中去引用他们。经过一定的重构,模板的重用性得到一定的改观,但依然会有一 些冗余的代码,除非MT可以提供一些模板标签,能够让我们判断当前所在的模板而采用不同的Module或者调整细微的模板代码差别。幸运的是,我找到了一 个MT plugin,mt-varz version 0.31。 它提供了更高级的变量支持,支持以下模板标签: <$MTGetVar$>,...

MT默认的模板包含大量的重复或者类似模板代码,当你需要进行一处模板修改时,也许不得不考虑得更多,并在多个模板中同时进行,已达到统一的效果。 模板重构的目的就是尽可能将多个模板之间相同的部分抽象出来,然后在多个模板中进行引用,另外还有趋向于将一组具有相同功能的模板代码放入同一个模板文件 的作用,从而减少模板修改带来的工作量。MT很早就在模板中支持Module,定义好的Module可以通过如下代码进行引用。

<$MTInclude module="Module Name"$>

我 们需要做的就是把重复的模板代码放在一个个Module中进行定义,然后在模板中去引用他们。经过一定的重构,模板的重用性得到一定的改观,但依然会有一 些冗余的代码,除非MT可以提供一些模板标签,能够让我们判断当前所在的模板而采用不同的Module或者调整细微的模板代码差别。幸运的是,我找到了一 个MT plugin,mt-varz version 0.31。 它提供了更高级的变量支持,支持以下模板标签:

<$MTGetVar$>, <MTSetVarBlock>, <MTIf>, <MTUnless>, <MTIfOne>, <MTUnlessEmpty>, <MTUnlessZero>

其中部分标签在MT3.3中已经得到支持, mt-varz对其进行了over load,具体细节可以参考此plugin文档(在下载包内)。我们在这里需要用到MT标准标签MTSetVar,以及mt-varz 支持的MTIf 标签。我在每个模板的第一行使用MTSetVar 定义一个变量用于标识当前模板,然后在Module中需要的地方使用MTIf 判断当前模板,并注入相应模板代码。下面是一个例子:

Template: Category Archive

<$MTSetVar name="Category Archive" value="1"$> 
...
<$MTInclude module="Header"$>
...

Template Module: Header

<head>
<MTIf name="Category Archive">
<title><$MTBlogName encode_html="1"$>: <$MTArchiveTitle$> Archives</title>
</MTIf>
...
</head> 
<$MTSetVar name="Category Archive" value="1"$> 这里value 可以是其它非0值,如果值为1,那么MTIfOne 标签在上面与MTIf 标签的作用相同,加以利用可以进行更精细的控制。除了1以外,目前还不提供对变量值的详细判断。

经过重构之后,我的Main Index 模板看起来就像这个样子,其它也很类似,模板修改主要在少量的Module中进行。

<$MTSetVar name="Main Index" value="1"$>
<$MTInclude module="Template Header"$> 
<$MTInclude module="Header"$>  
<MTEntries>
<$MTInclude module="Entry"$>
</MTEntries>
<$MTInclude module="Footer"$>
<$MTInclude module="Template Footer"$>  

更新:经测试,<MTIfOne> 标签不能正确的解析内嵌的<MTElse> 标签,根据不同情况,将在模板rebuild 阶段抛出错误,或者rebuild 通过,但逻辑不符合嵌套关系。下面是一个逻辑错误示例。<MTIf>标签是否存在此问题未作测试。已经report 这个bug 给了Appnel,希望可以解决。

<MTIfOne name="Search Result Template"><MTIfTagSearch>Tag Search<MTElse>None Tag Search</MTElse></MTIfTagSearch></MTIfOne>

Posted by Alex at 4:42 PM | Comments (0) | Edit | Taged: MT (25), plugin (8), 模板 (2), 重构 (1)

列出不定期更新的日志

我有一些这样的日志,需要长期更新,不断追加内容,或者内容经常变化,需要不定期进行更新。它们很容易就被新的日志淹没,从而增加了查找定位的成本。对于这样的日志,我希望可以将它们固定的列在blog边栏,方便随时查看和修改。有两种方法可以方便的实现: 为这部分日志指定共同的分类(categories) 为这部分日志指定共同的标签(tags) 指定分类的方法,将会额外增加一个blog分类,可能是不期望的,不过也可能正是使用者所期望的,我采用了第二种指定tags的方法。MT3.2 开始,MTEntries模板标签新增了tag参数,用于列出具有特定tag的日志。MT中以"@"开头的tags会被隐藏,不会在MTTags 模板标签中列出,但这个标签在其它方面与一个真正的标签没有任何区别,比如可以用来关联主题相似的日志。我为这部分日志指定了一个永远不会被其它日志用到的标签,并加上了"@"作为前缀。然后在边栏增加一下模板代码来生成这部分日志的列表。 <h3>不定期更新|Handy Entries</h3> <div class="module-content"> <ul> <MTEntries tag="@_handy"> <li><$MTInclude module="Entry...

我有一些这样的日志,需要长期更新,不断追加内容,或者内容经常变化,需要不定期进行更新。它们很容易就被新的日志淹没,从而增加了查找定位的成本。对于这样的日志,我希望可以将它们固定的列在blog边栏,方便随时查看和修改。有两种方法可以方便的实现:

  1. 为这部分日志指定共同的分类(categories)
  2. 为这部分日志指定共同的标签(tags)

指定分类的方法,将会额外增加一个blog分类,可能是不期望的,不过也可能正是使用者所期望的,我采用了第二种指定tags的方法。MT3.2 开始,MTEntries模板标签新增了tag参数,用于列出具有特定tag的日志。MT中以"@"开头的tags会被隐藏,不会在MTTags 模板标签中列出,但这个标签在其它方面与一个真正的标签没有任何区别,比如可以用来关联主题相似的日志。我为这部分日志指定了一个永远不会被其它日志用到的标签,并加上了"@"作为前缀。然后在边栏增加一下模板代码来生成这部分日志的列表。

<h3>不定期更新|Handy Entries</h3>
<div class="module-content">
<ul>
<MTEntries tag="@_handy">
<li><$MTInclude module="Entry Link"$></li>
</MTEntries>
</ul>
</div> 
Template Module Entry Link:
<a href="<$MTEntryPermalink$>" title="<MTEntryIfTagged>Tags: <MTEntryTags glue=", "><$MTTagName$></MTEntryTags><MTElse>No tags</MTElse></MTEntryIfTagged> "><$MTEntryTitle$></a> 

Posted by Alex at 10:13 AM | Comments (0) | Edit | Taged: MT (25), Tag (2)

upgrade to TinyMCE 2.09

TinyMCE new version 2.09 came. What's the new feature? Let's have a compare with the 2.02....
TinyMCE new version 2.09 came.

What's the new feature?

Let's have a compare with the 2.02.

The interface with full features of 2.02

TinyMCE 2.02 full feature Interface

The interface with full features of 2.09 

TinyMCE 2.09 full feature interface

Lots of changes, include: (I only list the changes which are most important for me. I didn't check the change logs, this info just for reference. )

  • New fullscreen mode, I'm editing on this mode, like it very much!
  • New tags supported
    • cite
    • abbr
    • del
    • ins
    • acronym
  • New development kit, powerful and helpfule!
  • Some tiny changes, such as:
    • nicer formating on HTML source window.
    • won't link the followed text after a link new generated.

Development kit interface

TinyMCE Development kit interface

This kit interface is able to collsape and expand.

Download and Upgrade in MT

Donwload the package file at here. Unpackage it and prepare to upgrade. Here's the steps:

  • Backup the old directory and files.
mt-static\plugins\Ajaxify\tinymce\
\cgi-bin\mt\plugins\Ajaxify\EnhancedEntryEditing.pl (You won't have and don't need to backup this file if you don't use the plugin EnhancedEntryEditing.) 
  • Replace all things in mt-static\plugins\Ajaxify\tinymce\ with the new version.
  • Open \cgi-bin\mt\plugins\Ajaxify\EnhancedEntryEditing.pl to edit. (no need do this if you don't have.)
  • Comment out all old settings from last installation within:
    settings => new MT::PluginSettings([
        ['tinymce_config', { Default => q{
        old setttings here
        }}]
    ]),

 

  • Copy new settings from the source(View->Page Source) of mt-static/plugins/Ajaxify/tinymce/examples/example_full.htm to the place of old settings.

    settings => new MT::PluginSettings([
        ['tinymce_config', { Default => q{
        /* old settings here */
        new setttings here
        }}]
    ]),
  • Make some neccesory changes on the new settings.
mode : "textareas",
mode : "exact"
elements : "text,text_more",
content_css : "example_full.css",
content_css : "/css/extend.css",

  • Save changes, then logon MT management to new an entry(might need a refresh here, F5), the new interface will take effect.
  • Done!

Here's the new interface in MT, a little fat for MT got overflow, but not a big problem. Enjoy it!

TinyMCE 2.09 interface in MT

The full code section in \cgi-bin\mt\plugins\Ajaxify\EnhancedEntryEditing.pl

settings => new MT::PluginSettings([
['tinymce_config', { Default => q{
/** This section was used by TinyMCE v2.01
mode : "exact",
elements : "text,text_more,excerpt",
theme : "advanced",
plugins : "iespell, emotions, inlinepopups",
theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6",
theme_advanced_buttons1 : "formatselect,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,undo,redo,separator,link,unlink,separator,image,emotions,iespell,help",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],span[class|align|style]",
force_p_newlines : true,
relative_urls : false,
remove_script_host : false,
button_tile_map : true,
ask : false,
auto_cleanup_word : true,
theme_advanced_path_location : "bottom",
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
safari_warning: false,
oninit: "quicktagsHide"
**/
/** This section was used by TinyMCE v2.02
//mode : "textareas",
mode : "exact",
elements : "text,text_more",
//editor_selector : "mceEditor",
theme : "advanced",
//plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
plugins : "table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
//theme_advanced_buttons1_add_before : "save,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js",
content_css : "/css/extend.css",
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
oninit: "quicktagsHide"
**/
/** This section was used by Tiny MCE v2.09 **/
//mode : "textareas",
mode : "exact",
elements : "text,text_more",
theme : "advanced",
plugins : "devkit,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
theme_advanced_buttons1_add_before : "save,newdocument,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor,advsearchreplace",
theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
content_css : "/css/extend.css",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_link_list.js",
external_image_list_url : "example_image_list.js",
flash_external_list_url : "example_flash_list.js",
media_external_list_url : "example_media_list.js",
file_browser_callback : "fileBrowserCallBack",
theme_advanced_resize_horizontal : false,
theme_advanced_resizing : true,
nonbreaking_force_tab : true,
apply_source_formatting : true
}}]
]), 

 

Posted by Alex at 1:33 AM | Comments (0) | Edit | Taged: MT (25), TinyMCE (4), upgrade (5), wysiwyg (6)

EnhancedEntryEditing plugin settings problem

About  EnhancedEntryEditing here's an article talked about it in update section.Problem I was trying to change the...

About  EnhancedEntryEditing here's an article talked about it in update section.

Problem 

I was trying to change the style sheet for the MT entry editing area of the plugin EnhancedEntryEditing.

Here's the access to edit the settings in MT plugin management.

MT plugin management interface

To click Show Settings will get the settings text and be able to edit then save change.
I did the change and the save action did work but got no affection on the MT entry edit interface. It continued to refer to the old style sheet.

Solution 

Finally I track to EnhancedEntryEditing.pl where is the true settings live. I found that the change on MT plugin management don't effect this file in some abnormal reason. So I edited the .pl file directly and it works out.

EnhancedEntryEditing.pl is locate at: cgi-bin\mt\plugins\Ajaxify

Another blockquote Issue

I talked about blockquote at this article, then want to have it in TinyMCE, but I did not found where to insert it into content. After I did some hack work on Format feature I got this tag on the panel of TinyMCE. It's already there, the Indent will insert <blockquote> tag.

MT panel section

As my new learned, I should only use blockquote tag for real quoted content, not for the format indent. So, I might never use this button.

 

 

Posted by Alex at 4:16 PM | Comments (0) | Edit | Taged: EnhancedEntryEditing (2), TinyMCE (4)

Refine and add new features to my web site

This site disappeared on Internet from the early of this year because of the server...

This site disappeared on Internet from the early of this year because of the server problem. Since then it's running on my thinkpad locally for 1 year. Now it's more like my personal blog. I have to have some refine work on my blog since I decided to publish it again. Also I added some new features.

Here's a work log.

upgrade MT to version 3.3 

changed to plugined tinymce


changed title appearance

There are 3 level Titles.

  1. site title
  2. category and monthly title
  3. entry title

Each pages have this title structure for search engine friendly, but only display the related title. Others are hided.

In the 2nd level pages, the site title is hided. Also in the 3rd level pages, both 1st level and 2nd level titles are hided.

Using style:

.subindex-container .index-logo,
.individual-container .index-logo,
.individual-container .subindex-logo {
display: none;
}

gave tags to each entry

Give one or more meaningful tags to each entry. The old keywords field is abandoned. 

neater monthly archive list

added keywords.js

I used keyword.js to hilight keywords which visitor used in search engine for linking in this page in my old site. I did some simple configure and add it into my blog.

I had following settings. 

// Configuration:
Keyword = {
hilite: true,
index: false,
refill1: true,
refill2: false,
element1: 'search',
element2: 'w', 
style_name: 'hilite',
style_name_suffix: true,
debug_referrer: '',
debug_meta: ''
};

added edit link to individual archive

Simply to add an edit link to individual entry view, that makes editing entries quicker without going to MT management first.

Add following code to individual template:

<a href="<$MTCGIPath$>mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=<$MTBlogID$>" title="edit this entry, only for admin">Edit</a> 

changed download files location 

I organized all download files by date instead of by categories. That reduces the length of the file list in a same directory.

Current directory structure rule is /ref/year/month/files, exam:

/ref/2006/12/simple.zip

fixed new line problem for entries 

recheck the broken links

I have been using Xenu to check broken site links. It's still a good solution up to now. Recently, I got another solution that could play part of role of Xenu, CheckLinks. It's a plugin for MT that only check the links they are within entries. The reason I picked it up is that It's easier to have the edit link in the bad links report by CheckLinks. Here's a report from my site.  For having this feature, I use below Template. This template is used for checking all entries(maximum 9999 here) in your blog and printing only the entries with bad links. But rebuilding this template is as slow as when you check through your blog links with other tool. So better to uncheck the "Rebuild this template automatically when rebuilding index templates" at template setting if you are using it in Indexes Template. 

<MTEntries lastn="9999">
<MTCheckLinks include_local="1">
<MTCheckLinksHere>
<$MTEntryBody$>
<$MTEntryExtended$>
</MTCheckLinksHere>
<MTIfBadLinks>
<dl class="badlinks">
<dt><a href="<$MTEntryLink$>"><$MTEntryTitle$></a> (<a href="<$MTCGIPath$>mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=<$MTBlogID$>" title="in <$MTCatetoryTitle$>">edit</a>) Have bad links:</dt>
<MTBadLinks load_entries="1">
<dd><$MTBadLinkStatus trim_to="3"$>: <$MTBadLinkURL$> [<a href="<$MTBadLinkURL$>"><$MTBadLinkText$></a>]</dd>
</MTBadLinks>
</dl>
</MTIfBadLinks>
</MTCheckLinks>
</MTEntries> 

A note: If you are refering any Entries Tag like "MTEntryTitle" within CheckLinks Tag <MTBadLinks>, you must specify load_entries="1" otherwise there's error raising during rebuilding this template.

 

set up category rss feeds and links

managed external links by blogroll

I downloaded a new plugin Blogroll for managing my links. 

Use Blogroll I could manage and group my links, and publish them in template.

Using following code in template: 

<MTBlogrollCategories>   
<h3><$MTBlogrollCategoryLabel$></h3> 
<ul><MTBlogrollLinks> 
<li><a href="<$MTBlogrollLinkURI$>" title="<MTBlogrollLinkDesc>"<MTIfNonEmpty tag="BlogrollLinkRel"> rel="<MTBlogrollLinkRel>"</MTIfNonEmpty> <MTIfNonEmpty tag="BlogrollLinkTarget">target="<MTBlogrollLinkTarget>"</MTIfNonEmpty>><$MTBlogrollLinkName$></a></li> 
</MTBlogrollLinks></ul> 
</MTBlogrollCategories> 

related tags on tag search 

I downloaded a new plugin TagSupplymentals that brings much features on tags. I use MTRelatedEntries and MTRelatedTags.

Using following code in template:

<ul>
<h3>Related Entries</h3>
<MTRelatedEntries lastn="5">
<li><$MTInclude module="Entry Link"$></li>
</MTRelatedEntries>
</ul> 
 
<ul>
<h3>Related Tags</h3>
<MTEntryTags>
<MTRelatedTags>
<li><a xhref="<$MTTagSearchLink$>"><$MTTagName$></a> (<$MTTagCount$>)</li>
</MTRelatedTags>
</MTEntryTags>
</ul>

 

related entries by tags

See above. 

more clear search result

On the search result list, as default only show the entry title and entry summary. So the searcher could have an overview on all search result. If he wants more info about the entry there's a link to expand the entry area to show entry body.

Template:

<MTEntriesHeader>
<!--start #top-alpha-->
<div id="top-alpha">
<label id="hidebodybar" class="hidbodybar"></label>
<!--end #top-alpha-->
</div>
</MTEntriesHeader>
<!--start #entry~-->
<div class="entry" id="entry<$MTEntryID pad="1"$>">
<a name="a<$MTEntryID pad="1"$>" />

<!--start #top-entry~-->
<div class="top-entry" id="top-entry<$MTEntryID pad="1"$>">
<label class="hidebodybar" id="hidebodybar<$MTEntryID pad="1"$>"></label>
<!--end #top-entry~-->
</div>
<h3 class="entryheader" id="a<$MTEntryID pad="1"$>"><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></h3>
<!--start #entryinfo~-->
<div class="entryinfo" id="entryinfo<$MTEntryID pad="1"$>">
<MTIfOne name="Category Archive">
<p class="subtitle"><$MTEntryDate format="%x"$></p>
<MTElse>
<p class="subtitle">In <a href="<$MTEntryLink archive_type="Category"$>"><$MTEntryCategory$></a>, <$MTEntryDate format="%x"$></p>
</MTElse>
</MTIfOne>
<!--end #entryinfo~-->
</div>
<!--start #entrysummary~-->
<div class="entrysummary" id="entrysummary<$MTEntryID pad="1"$>">
<$MTEntryBody convert_breaks="0" words="16"$>...
<!--end #entrysummary~-->
</div>
<!--start #entrybody~-->
<div class="entrybody" id="entrybody<$MTEntryID pad="1"$>">
<$MTEntryBody convert_breaks="0"$>
<MTEntryIfExtended><p>继续阅读 "<a href="<$MTEntryPermalink$>#more"><$MTEntryTitle$></a>" 的剩余内容</p></MTEntryIfExtended>
<!--end #entrybody~-->
</div>
<!--start #entryfooter~-->
<div class="entryfooter" id="entryfooter<$MTEntryID pad="1"$>">
<MTEntryIfTagged><p>标签 Tags: 其它与<MTEntryTags glue=", "><a href="<$MTTagSearchLink$>"><$MTTagName$></a> (<$MTTagCount$>)</MTEntryTags> 相关的话题</p></MTEntryIfTagged>
<p class="posted">
Posted by <$MTEntryAuthorUsername$> at <$MTEntryDate format="%X"$>
<MTEntryIfAllowComments> | <a href="<$MTEntryPermalink archive_type="Individual"$>#comments">Comments (<$MTEntryCommentCount$>)</a></MTEntryIfAllowComments>
<MTEntryIfAllowPings> | <a href="<$MTEntryPermalink archive_type="Individual"$>#trackbacks">TrackBack (<$MTEntryTrackbackCount$>)</a></MTEntryIfAllowPings>
| <a href="<$MTCGIPath$>mt.cgi?__mode=view&_type=entry&id=<$MTEntryID$>&blog_id=<$MTBlogID$>" title="edit this entry, only for admin">Edit</a>
</p>
<!--end #entryfooter~-->
</div>
<!--end #entry-->
</div>

Javascript: hide-body.js

flexible style sheet

I had this new bar on the top of page.

text bar for changing style

It makes possible to switch different style sheet on current page by one click.

For doing this, needs switch-css.js, and the defination in the head.

<link rel="stylesheet" type="text/css" href="<$MTBlogURL$>css/screen.css" media="screen" title="BlockStyle" />
<link rel="alternate stylesheet" type="text/css" href="<$MTBlogURL$>css/screen-clearstyle.css" media="screen" title="ClearStyle" />
<script type="text/javascript" language="javascript" src="<$MTBlogURL$>switch-css.js"></script>
And the label tag with ID definition in the page. The css links would be generated by the .js above dynamically.
<label id="switchcssbar"></label>

The code refer to:

tested none-css appearance 

To see what my blog is like without style sheet, click below link. If you want to change it back, choose the block Style links on the top of any page. I'm ready to change this site as None Style

tested printable view

To see how it works, select "File - Print Preview" in your Internet Browser.

The format is defined in print.css .

made the old site work

Made some neccesary changes on my old site for showing it in sub folder well.

change to mysql database

power editing basename 

I think this would be helpful, lots of people want to have this feature. 

add style to preformatted tag <pre>

I used <pre> tag for several cases:

  • programming code (exam: javascripts)
  • command (exam: unix shell commands)
  • output (exam: screen output of a command)
  • refererence (exam: a short paragraph from other blog)

But they do have different requirements for showing up. So I add several class styles for the tag.

  • .code
  • .cmd
  • .output
  • .refer (with word wrap)

For the .refer class style, I referred to pre标签自动换行方案.

Update: Read an article What are semantics?, learned that I should use <blockquote> tag to wrap the resource that I refer to. So I need to use <blockquote> tag instead of class style .refer.

upgrade to TinyMCE 2.09

Refined Page structure

Refinced CSS

I split my css file as multi-level and use import keyword to link them up. I have following structure. The base.css and extend.css is used by each style sheet. The difference is that the extend.css is also refered by TinyMCE in MT. About TinyMCE please read this article .

base.css      extend.css
          \      /
           \    /
         screen.css
         screen-linestyle.css
         screen-clearstyle.css

I reset padding and margin as 0 in my base.css that makes crossing browsers development easier. Here's a style list about Firefox 1.5 default style sheet for HTML elements for reference.

I tried to have more comfortable color for pages. Here are some links would be helpful on this. The safe 216 web colors, a list of online colour tool.

 

Disable listing directory


Create a file ".htaccess" at the root path of web site and have following line:

Options All -Indexes 

Rewrite url for old site


Add below lines to /.htaccess.

RewriteEngine On
RewriteRule ^archives/([0-9]+/[0-9]+) $1
RewriteRule ^archives/(jeet_kune_do|outdoors) $1
RewriteRule ^archives/study_notes/(web|linux) $1
RewriteRule ^hobbies/(outdoors) $1
RewriteRule ^hobbies/ham/ amateur_radio
RewriteRule ^hobbies/sbenefit/ society_benefit
RewriteRule ^notes/*(db2|linux)* $1
RewriteRule ^notes/[a-z0-9\_\-]+.htm$ db2
RewriteRule ^archives/study_notes/[a-z0-9\_\-]+.html$ db2 
A little help on expression I used. 
  • ^ is maching the begin of aline.
  • $ is mathing the end of a line. 
  • $n is a reference for the expression within (), also could have $1, $2..., as I know, $0 should be the entire of $n.
  • | is the OR relationship.
  • + match at least one time.
Had this article  for reference. 

Posted by Alex at 10:05 AM | Edit | Taged: css (3), MT (25), plugin (8), refine (2), upgrade (5)

Related entries on tags

I had a plugin that allows having a related entries list in the same category. It's...

I had a plugin that allows having a related entries list in the same category. It's not very helpfule for visitors as you have many entries in a category.

Tags is supported since MT 3.3. We may want to have a related entries list based on tags on the current entry. TagSupplementals plugin is doing that. It provides a set of features for tags supplement. We're using one of them.

Posted by Alex at 2:08 PM | Comments (0) | Edit | Taged: MT (25), plugin (8), Tag (2)

Change monthly archive style

The too long monthly archive list get bad-looking.Download a new plug-in mt-archive-dateheader to have a neat...

The too long monthly archive list get bad-looking.

Download a new plug-in mt-archive-dateheader to have a neat calendar for monthly archive like this:

kalsey-dates.gif

 

Change the template to

  <h2>按月归档|By Month</h2>

<a class="skip" xhref="http://blog.alex.com/cgi-bin/mt/mt.cgi#endbymonth">Skip over by month</a>

<MTArchiveList archive_type="Monthly">
<MTArchiveDateHeader>
<p><b><MTArchiveDate format="%Y"></b></p>
</MTArchiveDateHeader>
<a xhref="<$MTArchiveLink$>"><MTArchiveDate format="%B"></a><span class="num"><$MTArchiveCount$></span>
</MTArchiveList>
<p></p>

<a class="skip" id="endbymonth"></a>

Posted by Alex at 5:02 PM | Comments (0) | Edit | Taged: MT (25), plugin (8)

Convert MT from Berkeley DB to MySQL

最近决定把MT的后台数据从Berkeley的文件DB转到MySQL。原因之一是使用关系数据库可以获得更多的灵活性,比如运行一条sql来变更 所有entry的某一个属性;另外一个原因是为了提前熟悉一下这个数据库,牙牙网站使用虚拟主机,DreamHost提供的数据库是MySQL,而我从前 主要使用了SQL Server,Oracle和DB2,Postgresql也只了解了一点,而MySQL则几乎没有接触过。 下载了5.0.27安装文件,安装顺利,使用了第一个默认端口3306,UTF-8的数据库字符集。 安装完成,运行了命令行客户端,输入help,给出的帮助命令不多,也没见到有关数据库创建的命令,便查了安装的帮助文件,组织的还算不错,很齐全,很快找到相关的命令: 查看已有数据库 show databases; 连接数据库 test use test; 创建数据库 mt...

最近决定把MT的后台数据从Berkeley的文件DB转到MySQL。原因之一是使用关系数据库可以获得更多的灵活性,比如运行一条sql来变更 所有entry的某一个属性;另外一个原因是为了提前熟悉一下这个数据库,牙牙网站使用虚拟主机,DreamHost提供的数据库是MySQL,而我从前 主要使用了SQL Server,Oracle和DB2,Postgresql也只了解了一点,而MySQL则几乎没有接触过。

下载了5.0.27安装文件,安装顺利,使用了第一个默认端口3306,UTF-8的数据库字符集。

安装完成,运行了命令行客户端,输入help,给出的帮助命令不多,也没见到有关数据库创建的命令,便查了安装的帮助文件,组织的还算不错,很齐全,很快找到相关的命令:

查看已有数据库
show databases;
连接数据库 test
use test;
创建数据库 mt
create database mt;

接下来寻找把已有DB转化到MySQL的方法,很快找到一个第三方的工具mt-db-convert.cgi ,可以实现MT支持的几种不同的DB之间的转换。

下载回来放到cgi-bin的mt目录,在浏览器访问运行,输入新创建的MySQL数据库名称mt,用户名root,密码,主机填入localhost,开始Convert。转换过程很快就完成了,不到1分钟,没有出现错误提示,转换信息如下:

mt-db-convert.cgi($Rev: 173 $): Converting your MT data between DB engines (for MT 3.2)
Loading database schema...                                                                                    
Loading data...                                                                                               
MT::Author                                                                                                    
.                                                                                                             
(1 objects saved.)                                                                                            
MT::Blog                                                                                                      
..                                                                                                            
(2 objects saved.)                                                                                            
MT::Trackback                                                                                                 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......                                                                                 
(327 objects saved.)                                                                                          
MT::Category                                                                                                  
.......... .......... .......... .......... ..........                                                        
(50 objects saved.)                                                                                           
MT::Comment                                                                                                   
..                                                                                                            
(2 objects saved.)                                                                                            
MT::Entry                                                                                                     
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... ....                                                                                               
(514 objects saved.)                                                                                          
MT::IPBanList                                                                                                 
(0 objects saved.)                                                                                            
MT::Log                                                                                                       
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......                                                                      
(437 objects saved.)                                                                                          
MT::Notification                                                                                              
(0 objects saved.)                                                                                            
MT::Permission                                                                                                
....                                                                                                          
(4 objects saved.)                                                                                            
MT::Placement                                                                                                 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... 
.......... .......... .......                                                                                 
(527 objects saved.)                                                                                          
MT::Template                                                                                                  
.......... .......... .......... .......... .......... .......... .......... .......... ...                   
(83 objects saved.)                                                                                           
MT::TemplateMap                                                                                               
..........                                                                                                    
(10 objects saved.)                                                                                           
MT::TBPing                                                                                                    
(0 objects saved.)                                                                                            
MT::Session                                                                                                   
.......... .......... .........                                                                               
(29 objects saved.)                                                                                           
MT::PluginData                                                                                                
(0 objects saved.)                                                                                            
MT::Config                                                                                                    
.                                                                                                             
(1 objects saved.)                                                                                            
MT::FileInfo                                                                                                  
(0 objects saved.)                                                                                            
Done copying data from DBM to DBI::mysql! All went well.                                                      
Your recommended setting                                                                                      
-------------------------------------                                                                         
# DataSource R:/SITE/mt-db                                                                                    
ObjectDriver DBI::mysql                                                                                       
Database mt                                                                                                   
DBUser root                                                                                                   
DBHost localhost                                                                                              
DBPassword comein                                                                                             
-------------------------------------                                                                         

然后修改mt-config.cgi文件,把数据源改成MySQL。 

再次访问MT,看起来一切正常,甚至原有的session都没有丢掉,只是后台使用的数据已经改变了位置。
不过发现了中文乱码问题,Google到了这个方法 ,按文修改后,需要再次执行mt-db-convert.cgi,把数据重新导入MySQL,再访问MT,乱码没有了,所有中文显示正常。

转换后又发现了一个新的问题,原DB中的Tags全部丢失,原因是mt-db-convert.cgi仅支持到MT 3.1,3.3的新功能带来的数据变化可能还会有其它信息丢失。

NOTE

This script is compatible with Movable Type version 3.1x. I didn't test it at any other versions.


其实MT自身已经提供了转换工具mt-db2sql.cgi,与mt.cgi在同一目录当中。使用方法是,安装好MySQL数据库服务,并创建好用于MT的DB,将MySQL数据库的配置信息加入mt-config.cgi,并同时保留原Berkeley DB的路径配置,即保持两种DB的配置同时生效,然后通过浏览器运行mt-db2sql.cgi,转换会自动开始,显示如下信息:

Loading database schema...
Loading data...
MT::Author
1
MT::Blog
1
3
MT::Trackback 
...
Done copying data from Berkeley DB to your SQL database! All went well.

确认转换成功后,再修改mt-config.cgi,注释掉Berkeley DB的配置即可。

这里是官方的帮助文档:

 

Posted by Alex at 2:35 AM | Edit | Taged: MT (25), mysql (4)

Power editing basename

There's no way to batch edit basename in MT, even no a plugin for this....

There's no way to batch edit basename in MT, even no a plugin for this.

I hacked into .tmpl and .pm files to implement the feature based on MT version 3.33.

  • \cgi-bin\mt\tmpl\cms\entry_table.tmpl

line 40 add:

<TMPL_IF NAME=IS_POWER_EDIT>
<th id="en-basename"><MT_TRANS phrase="Basename"></th>
</TMPL_IF> 

line 133 add: 

<TMPL_IF NAME=IS_POWER_EDIT>
<td>
<input type="hidden" name="basename_manual_<TMPL_VAR NAME=ID>" id="basename_manual_<TMPL_VAR NAME=ID>" value="0" />
<input type="text" name="basename_<TMPL_VAR NAME=ID>" id="basename_<TMPL_VAR NAME=ID>" value="<TMPL_VAR NAME=BASENAME>" onchange="setElementValue('basename_<TMPL_VAR NAME=ID>', dirify(this.value));setElementValue('basename_manual_<TMPL_VAR NAME=ID>', 1)" />
</td>
</TMPL_IF> 

 

  • \cgi-bin\mt\lib\MT\App\CMS.pm

line 6468 add:

        my $basename = $q->param('basename_' . $id);
if ( $basename && $q->param('basename_manual_' . $id)) {
$entry->basename($basename);
} elsif ( !$basename ) {
$entry->basename(MT::Util::make_unique_basename($entry));
}
  • \mt-static\style.css add(optional):

line 1107 add:

 #list-entry table #en-basename { width: 20% }

 

Posted by Alex at 6:35 AM | Edit | Taged: MT (25)

MT Upgrade from 3.2 to 3.33

Download MT 3.33 from MovableType.I didn't find the special version for upgrade,  however get it back...

Download MT 3.33 from MovableType.

I didn't find the special version for upgrade,  however get it back and unzip.

Out of my expectation, there's no any document about this release, like Readme.txt or so. Anyway I've experienced 2 times upgrade with past version.

Rename old cgi-bin directory as old, then upzip new as the original name. Make a compare by Beyond Compare, Rename mt-config.cgi-original to mt-config.cgi, and merge the old settings into it. The new configuration file remove most optional settings, only keep the required settings.

Modify the first line of all .cgi files from:

#!/usr/bin/perl -w

to

#!d:/green/perl/bin/perl -w

Rename old mt-static as mt-static_old, and move the new one to the path.

Open Firefox, address to http://blog.alex.com/cgi-bin/mt/mt.cgi, upgrade prompted automatically, Confirm to upgrade.

    * Upgrading database from version 3.2001.
    * Upgrading table for MT::Log
    * Upgrading table for MT::Category
    * Creating new template: 'Search Results Template'.
    * Assigning basename for categories... (100%)
    * Migrating any "tag" categories to new tags... (100%)
    * Setting new entry defaults for weblogs... (100%)
    * Updating user permissions for editing tags... (100%)
    * Database has been upgraded to version 3.3.

The new version works now.

Remain some work, need to restore the HTML Editor and some plugins from old version.

2006-11-20  Update

There're 3 plugins I used before update.

  • Collect
  • RelatedEntries
  • TinyMCE

Collect and RelatedEntries are easy to restore. TinyMce was intergreted via modifying tmpl files by myself more complex than a true plugin. I found there's new plugin comes,  EnhancedEntryEditing v1.11. TinyMCE v2.01 is wrapped in it. It' easy to install as well as normal plugins. See the online manual .

EnhancedEntryEditing provides less features as default setting than TinyMCE. I made change to support more features.

  1. Replace the content of below directory with the TinyMCE 2.02 to let it have the newest features.
    • EnhancedEntryEditing_1.11\EnhancedEntryEditing\mt-static\plugins\Ajaxify\tinymce
  2. Modify the plugin setting.

This step is more complex because of the version conflict. What I did is:

  • Comment out all settings from the EnhancedEntryEditing plugin(with TinyMCE 2.01)
  • Copy all settings from my old TinyMCE 2.02 as the current settings.
  • Merge the special settings in EnhancedEntryEditing to the current.
This is the last what I got.
ore,excerpt",
//theme : "advanced",
//plugins : "iespell, emotions, inlinepopups",
//theme_advanced_blockformats : "p,h1,h2,h3,h4,h5,h6",
//theme_advanced_buttons1 : "formatselect,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent,indent,separator,undo,redo,separator,link,unlink,separator,image,emotions,iespell,help",
//theme_advanced_buttons2 : "",
//theme_advanced_buttons3 : "",
//theme_advanced_toolbar_location : "top",
//theme_advanced_toolbar_align : "left",
//extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],span[class|align|style]",
//force_p_newlines : true,
//relative_urls : false,
//remove_script_host : false,
//button_tile_map : true,
//ask : false,
//auto_cleanup_word : true,
//theme_advanced_path_location : "bottom",
//theme_advanced_resizing : true,
//theme_advanced_resize_horizontal : false,
//safari_warning: false,
//oninit: "quicktagsHide"

//mode : "textareas",
mode : "exact",
elements : "text,text_more",
//editor_selector : "mceEditor",
theme : "advanced",
//plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
plugins : "table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
//theme_advanced_buttons1_add_before : "save,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js",
content_css : "/css/screen.css",
force_p_newlines : true,
relative_urls : false,
remove_script_host : false,
button_tile_map : true,
ask : false,
auto_cleanup_word : true,
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false,
safari_warning: false,
oninit: "quicktagsHide"

FlickrPhotos Version 0.84

Added a new plugin to MT.

Flickr photos is a plugin that enables you to display thumbnail links of Flickr photos in your Movable Type blog. Flickr Photos focuses on displaying lists of photos, in many possible ways.

Posted by Alex at 3:16 PM | Comments (0) | Edit | Taged: EnhancedEntryEditing (2), MT (25), TinyMCE (4), upgrade (5)

Export and Import with Basenames?

I losts my basenames for each entrie after I export and then import my entries from...

I losts my basenames for each entrie after I export and then import my entries from an old MT system to a fresh MT installation.

Export and Import don't deal with the field of Basenames for now.

To say the least, I also don't find the feture of Power Editing Basenames. 

I searched Six Part Plugin Directory, there's no any plugins that deal with either of my problems above.

Reference

Posted by Alex at 2:27 AM | Comments (0) | Edit | Taged: export (1), import (2), MT (25)

replace all templates with another MT system ones

If you want to use all the templates of MT2 in MT1 including Indexes, Archives, System...

If you want to use all the templates of MT2 in MT1 including Indexes, Archives, System and Modules templates, you don't needs copying and pasting manually many times.

There's an easier way that just needs copying 10 files from MT1 to MT2 and rebuild the whole site. You will get all the templates from MT1 to MT2.

Here're the list of 10 files.

  1. template.db
  2. templatemap.db
  3. template.name.idx
  4. template.type.idx 
  5. template.blog_id.idx
  6. template.build_dynamic.idx
  7. templatemap.archive_type.idx
  8. templatemap.blog_id.idx
  9. templatemap.is_preferred.idx
  10. templatemap.template_id.idx

This operation depends that the 2 MT system have the same encode. Otherwise the double words will not be showed correctly.

trying to find a way of converting templates and posts from gb2312 to utf-8. here's a refer might help:

Posted by Alex at 2:13 AM | Comments (0) | Edit | Taged: MT (25)

install TinyMCE into MT cms

Following code will make all tags of textareas editable with TinyMCE.Add following code to MT /tmpl/cms/header.tmpl<!--...

Following code will make all tags of textareas editable with TinyMCE.

Add following code to MT /tmpl/cms/header.tmpl

<!-- added by alex on 2006-02-12 -->
<script language="javascript" type="text/javascript" xsrc="/ref/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    //mode : "textareas"
    mode : "exact",
    elements : "text,text_more",
    theme : "advanced",
    //plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    plugins : "table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    //theme_advanced_buttons1_add_before : "save,separator",
    theme_advanced_buttons1_add : "fontselect,fontsizeselect",
    theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
    theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
    theme_advanced_buttons3_add_before : "tablecontrols,separator",
    theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    plugin_insertdate_dateFormat : "%Y-%m-%d",
    plugin_insertdate_timeFormat : "%H:%M:%S",
    extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
    external_link_list_url : "example_data/example_link_list.js",
    external_image_list_url : "example_data/example_image_list.js",
    flash_external_list_url : "example_data/example_flash_list.js"
    //content_css : "/styles-site.css"
});
</script>
<!-- added end -->

Edit /tmpl/cms/edit_entry.tmpl, to modify the value of the attribute ROWS for tag TEXTAREA which are defined as following id.

  • id="text"
  • id="text_more"

I don't want to the textareas of templates to be editable with TinyMCE, so I change code to following. 

/tmpl/cms/header.tmpl

<!-- added by alex on 2006-02-12
     modified by alex on 2006-03-01 -->
<script language="javascript" type="text/javascript" xsrc="/ref/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    //mode : "exact",
    //elements : "text,text_more",
    editor_selector : "mceEditor",
    theme : "advanced",
    //plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    plugins : "table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
    //theme_advanced_buttons1_add_before : "save,separator",
    theme_advanced_buttons1_add : "fontselect,fontsizeselect",
    theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
    theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
    theme_advanced_buttons3_add_before : "tablecontrols,separator",
    theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    plugin_insertdate_dateFormat : "%Y-%m-%d",
    plugin_insertdate_timeFormat : "%H:%M:%S",
    extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
    external_link_list_url : "example_data/example_link_list.js",
    external_image_list_url : "example_data/example_image_list.js",
    flash_external_list_url : "example_data/example_flash_list.js"
    content_css : "/css/screen.css"
});
</script>
<!-- added end -->

content_css : "/css/screen.css" tells TinyMCE to use my own css file to display the content of the editable TEXTAREA.

Edit /tmpl/cms/edit_entry.tmpl.

class="full-width mceEditor" name="text" id="text"
class="full-width mceEditor" name="text_more" id="text_more" 

Posted by Alex at 1:55 AM | Comments (0) | Edit | Taged: MT (25), TinyMCE (4)

MT 中控制Entries 的URL 名称

在Six apart 读到一篇文章,介绍了MT 3.2 版本支持的一项新功能:Entry basename control,在3.2 版本之前,MT不支持手动命名Entries 发布的URL ,是根据Title 自动生成的,如果是英文标题,会将其转化为小写,空格转化为下划线,并自动截断。如果是中文标题,则汉字部分被字母填充,类似于下面这样:mt_oeoeoeentrie.html在3.2 版本中提供了额外的Field 对URL 进行手动指定,这样的URL 就更友好。不过我一直使用3.14 版本,并通过变通的方法实现了URL手动命名。为此需要占用Entries...

Six apart 读到一篇文章,介绍了MT 3.2 版本支持的一项新功能:Entry basename control,在3.2 版本之前,MT不支持手动命名Entries 发布的URL ,是根据Title 自动生成的,如果是英文标题,会将其转化为小写,空格转化为下划线,并自动截断。如果是中文标题,则汉字部分被字母填充,类似于下面这样:

mt_oeoeoeentrie.html

在3.2 版本中提供了额外的Field 对URL 进行手动指定,这样的URL 就更友好。不过我一直使用3.14 版本,并通过变通的方法实现了URL手动命名。

为此需要占用Entries 编辑界面中的Extended Entry 项,并在Individual Archives 中进行设置。

WEBLOG CONFIG -> Archives Files -> Archives

选中Individual 的复选框,在Archives File Template 编辑框中设置:

<MTSubCategoryPath>/<MTIfNonEmpty tag="MTEntryMore"><$MTEntryMore dirify="1"$><MTElse><MTEntryDate format="%Y%m%d%H%M"></MTElse></MTIfNonEmpty>.html

<MTSubCategoryPath> 标签相当于:

<MTParentCategories glue="/"><MTCategoryLabel dirify="1"></MTParentCategories>

可将当前项所属所有父分类按层级,由"/" 进行连接,返回按文件路径规则格式化的字符串。

MTEntryMore 标签从Extended Entry 项中提取URL 命名,如果没有指定,则采用发布的日期命名URL 。

例如,我在本篇Entry 的Extended Entry 中指定:

mt entry basename control

则生成如下URL(本篇所属分类:Study Notes -> Web):

study_notes/web/mt_entry_basename_control.html
当然,如果你使用或者升级到3.2 版本,就不用费这么大的周折了.

Posted by Alex at 1:00 PM | Comments (0) | Edit | Taged: MT (25)

安装MT Collect 插件,实现文章内自动索引标题

安装环境 Movable Type 3.14 RedHat Linux 安装配置插件 下载插件 安装配置说明 作者网站,还有很多其它插件。 将文件Collect.pl 上传到服务器上MT 的plugins 目录,并设置权限:$ tag -zxvf...

安装环境

  • Movable Type 3.14
  • RedHat Linux

安装配置插件

下载插件

安装配置说明

作者网站,还有很多其它插件。

将文件Collect.pl 上传到服务器上MT 的plugins 目录,并设置权限:

$ tag -zxvf Collect.tar.gz
$ cp Collect/Collect.pl /var/www/cgi-bin/mt/plugins/
$ chmod 755 /var/www/cgi-bin/mt/plugins/Collect.pl

修改MT 模板

Individual Archives 模板相关部分如下:

  <MTCollect tags="h3,H3"><MTCollectThis><$MTEntryBody$></MTCollectThis>
  <MTIfCollected>
  <table align="right" width="250" class="section" bgcolor="#EEEEEE" style="padding-top: 2">
  <tr>
    <td bgcolor="#BBBBBB">目录</td>
  </tr>
  <tr>
    <td>¡¡
      <ol>
        <MTCollected><li><a xhref="http://blog.alex.com/cgi-bin/mt/mt.cgi#<$MTCollectedIndex$>" mce_href="http://blog.alex.com/cgi-bin/mt/mt.cgi#<$MTCollectedIndex$>"><$MTCollectedContent$></a></li>
        </MTCollected>
      </ol>
    </td>
  </tr>
  </table>
  </MTIfCollected>
  </MTCollect>
  <MTCollect tags="h3,H3"><MTCollectThis show="1" h3="&lt;a name=&quot;[N]&quot; \/&gt;/" H3="&lt;a name=&quot;[N]&quot; \/&gt;/"><$MTEntryBody$></MTCollectThis>
  </MTCollect>

上面的模板共使用了两次MTCollect 标签,第一次用于生成索引目录,第二次用于在索引的段落标题中加入锚链接(anchor)。MTCollect 标签的tags 属性用于指定收集的HTML 标签名称,区分大小写,如果有多个标签,用逗号隔开,这里我们收集标题标签h3 与 H3。

<MTCollect tags="h3,H3">

MTCollectThis 标签用于指定收集的对象,并对收集的标签赋以新值。需要用到tag="new value" 的格式,tag 必须是上级MTCollect 收集的标签名称。我们需要在标题中加入锚链接,并保存原标题。因此我们如下定义模板:

<MTCollectThis show="1" h3="&lt;a name=&quot;[N]&quot; \/&gt;/" H3="&lt;a name=&quot;[N]&quot; \/&gt;/"><$MTEntryBody$></MTCollectThis>

上面的模板会将原文档中的内容:

<h3>段落标题1</h3>
<h3>段落标题2</h3>

替换成如下内容:

<a name="1" /><h3>段落标题1</h3>
<a name="2 /><h3>段落标题2</h3>

新值当中的最后一个斜线 "/" 代表收集到的内容,如果需要写入一个真实的斜线,比如A 标签的结束标志 "<a />",则需要使用转义字符 "\/" 。

方括号"[]" 中的 "N" 代表收集序号,我们恰好利用这个序号来作为锚链接的值。

属性 show="1" 告诉MTCollect ,不仅显示收集并替换的新值,也显示作为收集对象的原始内容。

此插件所有标签的使用方法,请参考:

http://www.staggernation.com/mtplugins/Collect/

使用

在编写新的Blog 时,使用H3 或h3 作为文章的段落标题,上述代码将会自动识别,并生成目录索引,生成的目录索引自动编号,并可以链接到对应文章标题处。具体实例可参看本文右上部的目录。

 

Posted by Alex at 6:19 PM | Comments (0) | Edit | Taged: MT (25), plugin (8)

安装MT Related Entries 插件,实现相关文章

安装环境 Movable Type 3.14 Redhat Linux Related Entries 2.0  配置插件 下载插件 安装和配置指南 解开压缩包,将文件RelatedEntries.pl 上传到服务器上MT 脚本文件所在的目录,例如:/cgi-bin/mt/plugins/ 如果MT...

安装环境

配置插件

下载插件

安装和配置指南

解开压缩包,将文件RelatedEntries.pl 上传到服务器上MT 脚本文件所在的目录,例如:

/cgi-bin/mt/plugins/

如果MT 根目录下plugins 目录不存在,则手动创建。

设置.pl 文件的权限为 755

chmod 755 RelatedEntries.pl

之后就可以在MT 的模板中进行调用了。

修改MT 模板

在Individual Archives 模板中定义如下:

  <MTRelatedEntries>
  <p>
  <b>相关文章</b>
  <ul>
    <MTEntries lastn="5"><li><$MTInclude module="EntryLinkWithDate"$></li></MTEntries>
  </ul>
  </p>
  </MTRelatedEntries>

Rebuild 站点即可。

Update

已改用关联性更准确的plugin TagSupplymentals,参考related entries by tags

 

Posted by Alex at 6:03 PM | Comments (0) | Edit | Taged: MT (25), plugin (8)

MT整合HTML在线编辑器Editlet(三)——统一CSS

正文 Editlet 提供了默认的CSS,可以在编辑界面为所选文字指定样式。此CSS 文件位置为:editlet 主目录/css/sample.css 如果你在编辑界面使用了此样式单定义,则Editlet 会自动在文章末尾加入外联样式单的链接,否则发布的文章将无法正确显示Editlet 中定义的样式。<LINK xhref="css/sample.css" mce_href="css/sample.css" type=text/css rel=stylesheet> 一般我们在MT 当中已经定义好了一套CSS,让Editlet 使用MT 的CSS...

正文

Editlet 提供了默认的CSS,可以在编辑界面为所选文字指定样式。此CSS 文件位置为:

editlet 主目录/css/sample.css

如果你在编辑界面使用了此样式单定义,则Editlet 会自动在文章末尾加入外联样式单的链接,否则发布的文章将无法正确显示Editlet 中定义的样式。

<LINK xhref="css/sample.css" mce_href="css/sample.css" type=text/css rel=stylesheet>

一般我们在MT 当中已经定义好了一套CSS,让Editlet 使用MT 的CSS 只需很简单的几步。

打开editor.js 进行编辑,首先确定没有关闭CSS 功能按钮,应有如下定义:

var css_flag    = 1 ;

然后修改CSS 文件指向,如果你的CSS 文件名称为:style.css,放在web 根目录下的css 文件夹中,则修改如下:

//var css_url   = "css/sample.css";
var css_url   = "/css/style.css";

接下来告诉Editlet 如何生成用于选择样式单的下拉列表,需要把你在style.css 中定义的样式名称,组成一个用逗号分隔的字符串,赋给变量css_list 。

//var css_list   = "header1,header2,text,pageheader,boldtext,tableheader1,tablecolor,italictext,textbg,tableheader2,tableheader3,graytext,smalltext,header3,header4,graytextbold,redtext,footertext";
var css_list   = "big-font,middle-font,small-font";

editor.js 修改完毕。

接着打开editor.html 进行编辑,只需修改一处,找到CSS 链接,修改如下:

<!--
<link type="text/css" rel="stylesheet" xhref="css/sample.css" mce_href="css/sample.css">
-->
<link type="text/css" rel="stylesheet" xhref="/css/style.css" mce_href="/css/style.css">

在此文件中链接CSS 文件,是为了使用实际的样式来格式化编辑界面中的每一个CSS 选项,实现“所见即所得”编辑。

修改完成,现在就可以在Editlet 的界面中使用MT 的CSS 了。

参考资源

Posted by Alex at 6:50 AM | Comments (0) | Edit | Taged: Editlet (5), MT (25), wysiwyg (6)

MT整合HTML在线编辑器Editlet(二)

整合Editlet到MT 首先将Editlet上传到MT所在的Web服务器,可以放在任意目录,我的目录结构如下:/index.html /archives/ /weblog/static/ /weblog/editlet/ /weblog/editlet/editlet.html /weblog/editlet/editor.html MT模板 MT的后台管理页面均使用了模板,存放在目录 /tmpl/cms/ 。有两个模板与Entries的新增与编辑相关,分别是:header.tmpl、edit_entry.tmpl 。 editlet.html 主要做了如下几件事: 在head 部装载editor.js...

整合Editlet到MT

首先将Editlet上传到MT所在的Web服务器,可以放在任意目录,我的目录结构如下:

/index.html 
/archives/
/weblog/static/
/weblog/editlet/
/weblog/editlet/editlet.html
/weblog/editlet/editor.html
MT模板

MT的后台管理页面均使用了模板,存放在目录 /tmpl/cms/ 。有两个模板与Entries的新增与编辑相关,分别是:header.tmpl、edit_entry.tmpl 。

editlet.html 主要做了如下几件事:

  1. 在head 部装载editor.js 脚本,并定义Editlet程序文件的存放路径。
  2. 在body 标签中定义事件处理。
  3. 生成编辑工具条与文本区域。
  4. 为文本区域设定初始编辑内容。
  5. 保存文本区域的内容。

要实现整合,我们就需要把这几项功能实现在MT的以上两个模板中。

修改MT部分

我们把第1、2项功能放到header.tmpl 中实现。

打开header.tmpl 进行编辑,在<head>与</head>之间加入editlet.html 头部的脚本:

<script type="text/javascript" xsrc="/weblog/editlet/editor.js" mce_src="/weblog/editlet/editor.js"></script>
<script type="text/javascript">
var path="/weblog/editlet/";
</script>

其中变量path 指定为editlet目录的web绝对路径。

在<body>标签中加入editlet.html <body>标签中的script:
<body onafterprint="return window_onafterprint()" LANGUAGE="javascript">

保存header.tmpl ,注意修改文件之前先进行备份。

打开edit_entry.tmpl 进行编辑。先找到<form> 标签,在标签中加入:

onsubmit="return getContent();"
<form name="entry_form" method="post" onsubmit="return getContent();" action="<TMPL_VAR NAME=SCRIPT_URL>">

接着找到那个叫做Entry Body 的文本区域(textarea),将其注释掉:

<!--
<textarea class="full-width" name="text" id="text" tabindex="3" rows="<TMPL_IF NAME=DISP_PREFS_SHOW_EXTENDED>10<TMPL_ELSE>20</TMPL_IF>"><TMPL_VAR NAME=TEXT ESCAPE=HTML></textarea>
-->

在后面使用MT的<INCLUDE> 标签将editlet.html页面包含到这里,路径要写成editlet.html 在服务器上的文件系统绝对路径,写成web的绝对或相对路径都无法工作。

<INCLUDE TMPL="/var/www/html/weblog/editlet/editlet.html">

为了装载和保存编辑内容,添加一个隐含的文本框,id、name、value等属性与注释掉的<textarea> 相同:

<input name="text" id="text" type=hidden value="<TMPL_VAR NAME=TEXT ESCAPE=HTML>">

对MT的修改到此结束。

修改Editlet部分

打开Editlet.html 进行编辑。首先删除<table> 标签之前以及</table> 标签之后的所有代码,以上部分已经在MT模板中实现了。

接下来删除<form> 与</form> 标签之间的所有代码,保存的功能将通过在MT模板中定义的onsubmit 事件在editor.js中完成。

函数setContent() 用于设置文本区域的初始内容,我们将其改为:

//setContent('Your Content');
setContent(document.entry_form.text.value);

text 在edit_entry.tmpl 中定义,打开一个Entry 时,MT将数据写入这个文本框,保存时,MT读取其内容并保存。

函数setEditlet(path) 用于生成工具条和文本区域,保留这个部分。

为了使文本区域的宽度适合MT,修改<table> 标签:

<!--
<table border="0" width="760" cellspacing="0" cellpadding="2" style="HEIGHT: 151px; WIDTH: 760px">
-->
<table border="0" width="580" cellspacing="0" cellpadding="0" style="HEIGHT: 151px; WIDTH: 580px">

打开editor.js 进行编辑。

函数getContent() 将会在编辑内容被提交时执行,我们只需将此函数获得的文本区域内容交给MT来处理,修改如下:

//document.form1.hid_out_content.value = content1;
//document.form1.submit();
document.entry_form.text.value = content1;

变量content1 是Editlet 获取的文本区域内容。

找到函数setEditlet() 的定义,将其中的函数调用replace() 注释掉,replace() 所处理的一些转换,MT已经做过了,否则会重复处理。修改后如下:

function setEditlet(path){
 setEditor(path);
 //replace();
}

接下来修改一些配置参数。

将编辑区域的宽度缩小,以适合MT:

//var editorwidth  = 900 ;
var editorwidth  = 580 ;

关闭一些不使用的按钮,以使工具条宽度不超过580,只需要设置哪些后缀为"_flag" 的参数,将值改为0 即可。

var table_flag   = 0 ;
var help_flag    = 0 ;
var clean_html_flag   = 0 ;
var spellcheck_flag   = 0 ;
var save_flag    = 0 ;
var open_flag   = 0 ;
var xhtml_flag    = 0 ;

在编辑区域中按回车键,默认会产生一个<br> 标签,如下修改后,将产生<p> </p>标签,依个人编辑喜好而设定。

//var CarriageReturn  = false;
var CarriageReturn  = true;

Editlet 部分修改完毕。

测试

至此,基本功能整合完毕,进入MT后台管理,进行测试。

选择“NEW ENTRY”,应该可以看到新的编辑界面,测试一下各编辑按钮是否正常工作,测试保存功能。

选择“ENTRIES”,选择一篇已有文章打开编辑,测试原有内容是否正常装入,有无重复转换字符(比如空格、双引号"、连接符&)的问题,测试保存功能。

参考资源

Posted by Alex at 7:20 PM | Comments (0) | Edit | Taged: Editlet (5), MT (25), wysiwyg (6)

MT整合HTML在线编辑器Editlet(一)——解除限制

前言 Movable Type 是一个非常不错的Blog网站发布和管理系统,目前最新版本是v3.14,后台提供了带有简单超文本编辑功能的文章编辑界面。 但缺乏诸如标题、字体、CSS、项目列表、表格和图片等内容的支持。虽然对于一个熟练的bloger来说,以上这些都可以通过手工在文章内容中嵌入超文本标签来完成,但却无法使其更专注于内容。在比较了多个超文本在线编辑器组件和产品之后,笔者选择了Editlet ,其在IE浏览器中运行的界面如下,本文就是在类似这样一个界面中发布的,比如我可以随意在其它网页或者word文件中拷贝一个与下面类似的图表,粘贴在这里。本文介绍把Editlet整合到MT后台发布管理系统的过程。 准备工作 系统应该先安装好MT,相关信息请参考车东的MT安装笔记:初始化和安全配置。 下载Editlet,目前Editlet提供JSP、PHP,PERL三个版本,不过网站以及程序包内均未标识版本信息。免费下载版本增加了一些限制:只能在运行Editlet的本机上访问,就是说只能通过http://localhost 或者http://127.0.0.1 进行访问;另外增加了时间限制,只能免费试用一个月。 下载地址:http://www.editlet.com 我下载了PHP版本。 笔者的安装环境: RedHat Linux...

前言

Movable Type 是一个非常不错的Blog网站发布和管理系统,目前最新版本是v3.14,后台提供了带有简单超文本编辑功能的文章编辑界面。

但缺乏诸如标题、字体、CSS、项目列表、表格和图片等内容的支持。虽然对于一个熟练的bloger来说,以上这些都可以通过手工在文章内容中嵌入超文本标签来完成,但却无法使其更专注于内容。在比较了多个超文本在线编辑器组件和产品之后,笔者选择了Editlet ,其在IE浏览器中运行的界面如下,本文就是在类似这样一个界面中发布的,比如我可以随意在其它网页或者word文件中拷贝一个与下面类似的图表,粘贴在这里。本文介绍把Editlet整合到MT后台发布管理系统的过程。

Editlet Full feature interface

准备工作

  1. 系统应该先安装好MT,相关信息请参考车东的MT安装笔记:初始化和安全配置
  2. 下载Editlet,目前Editlet提供JSP、PHP,PERL三个版本,不过网站以及程序包内均未标识版本信息。免费下载版本增加了一些限制:只能在运行Editlet的本机上访问,就是说只能通过http://localhost 或者http://127.0.0.1 进行访问;另外增加了时间限制,只能免费试用一个月。
    下载地址:http://www.editlet.com
    我下载了PHP版本。
  3. 笔者的安装环境:
    RedHat Linux
    Movable Type 3.14

解除Editlet的限制

Editlet程序的所有文件都在一个压缩包内,HTML和JS代码无需编译,虽然主要代码经过了加密处理,但也很容易找到限制的部分并去除。

如果仅仅使用Editlet的基本编辑功能(除去打开文件、保存文件、上载图片、拼写检查),甚至无需将其放在一个Web服务器上,就可以测试。

我们将其解压到web服务器根目录下的editlet目录,在editlet根目录有以下几个重要的文件:

  • editor.html
  • editor.js
  • editlet.html
  • multi_editlet.html

其中,editor.html包含了程序的核心代码,editlet.html是程序运行的主页面,它通过editor.js调用核心文件editor.html的代码。

multi_editlet.html是另外一个主页面,当在同一个页面需要使用多个编辑器窗口时使用,我们这里暂不考虑。

分析editor.html

程序以函数Decode2() 作为入口,函数内部首先进行软件是否过期检查,然后检查访问链接是否包含localhost或是127.0.0.1来确认是否在本机运行程序。

如果以上两项测试通过,程序执行函数enable() 和b() 。在enable() 中,判断是被editlet.html、multi_editlet.html 哪一个调用,并分别作出不同的配置。这个程序的作者很有意思,函数b(z) 中放了一堆迷惑的代码,实际只做了一件事:调用函数a() ,而核心的主体代码全部在函数a() 中。

函数a() 的主要作用:读取文件editor.js中以及本文件中的的配置参数,根据这些参数,动态生成用于显示编辑器页面的代码,然后调用解码函数写到浏览器。

这些动态组合的代码使用内置函数escape() 进行了编码,这样可以避免一些特殊字符在组合过程中出错。在根据配置参数组合完成之后,调用函数c(y) ,同样使用内置函数unescape() 进行解码,然后写到浏览器。函数c(y) 只有一行代码:

window.document.write(unescape(y));

如果需要查看这些编码了的代码到底做了什么,可以使用这个工具

了解程序流程后,去除限制,只需要删除掉相关函数并清理变量定义,然后以函数enable() 和a() 作为入口函数即可。具体的过程较为繁琐,不祥述,下面提供修改后的程序文件下载。

修正的文件中,也包含了editor.js,不仅去除了editlet.html 的限制代码,也重整了两个文件之间的配置参数调用关系,重整后,所有参数均在editor.js 中一处配置。

运行Editlet

在浏览器中运行editlet.html 所在的链接,这里是带全部编辑按钮的Editlet 演示页面。如果使用非IE浏览器,比如Firefox,会有部分调用了IE组件的按钮——比如表格——会被隐含起来。为了安全起见,该测试页面链接的所有动态程序文件(PHP)被删除。

(未完待续)

参考资源

Posted by Alex at 9:35 AM | Edit | Taged: Editlet (5), MT (25), wysiwyg (6)

Alex's picture

my email address in picture

搜索|Search

订阅更新|Subscribe to Feed

评论|Recent Comments

按月归档|By Month

2009
07
2008
11
10
07
05
04
03
02
01
2007
12
10
07
06
05
04
03
02
01
2006
12
11
10
09
08
07
06
05
04
03
02
01
2005
11
10
09
08
07
04
03
2004
12
11
10
09
08
07
06
05
04
03
02
01
2003
12
10
09
08
06
2002
09
08
04
03
02
2001
12
09
07
06
05

我读|My Books

db2

我的链接|My Links

我的朋友|My Friends

Movable Type 4 Logo
Creative Commons License
This blog is licensed under a Creative Commons License.