本文转自<a href=”http://hedong.3322.org/archives/000130.html”>竹笋炒肉</a>,且尚未经本人授权,本文将应作者要求保留或删除。
利用MT提供的功能,不用再手工维护自己的相关链接了。
主要参考了Movable Type blogroll..
主要步骤有:1)建立一个新的blog,不妨命名为quicklinks
2)建立相应的类别,如cnblogs,otherblogs,portals等。
3)将不同链接输入并归入不同的类别
4)建立一个索引模板
不妨命名为include,对应的include.html,如下:
<pre>
<MTCategories>
<strong><$MTCategoryLabel$></strong>
<MTEntries sort_by=”title” sort_order=”ascend”>
<MTEntriesHeader>
<ul>
</MTEntriesHeader>
<li><a title=”<$MTEntryExcerpt$>” href=”<$MTEntryBody convert_breaks=”0″$>”>
<$MTEntryTitle$></a><MTEntryIfExtended>
| <a title=”XML-RSS feed” href=”<$MTEntryMore convert_breaks=”0″$>”>
RSS</a></MTEntryIfExtended></li>
<MTEntriesFooter>
</ul>
</MTEntriesFooter>
</MTEntries>
</MTCategories>
</pre>
5)修改你的主blog的MasterIndex模板,增加一行:
<pre>PHP 4.3.0+
<?php echo ( file_get_contents(”http://dylan.tweney.com/links/include.html”)); ?></pre>
<pre>PHP < 4.3.0
<?php echo ( implode(”,file(”http://dylan.tweney.com/links/include.html”)) ); ?></pre>
6)OK!重新生成一主页。
需要说明是的,服务器上要用php,且在apache 中的设置中已经允许php对htm或html文件进行处理。