Results tagged “Movable Type”


What's new in Movable Type 4? With more than 50 new features, MT4 will enable you to quickly start a blog, easily manage entire blogging websites, and better connect with your audience. Here's some of what's new in MT4:
  • A completely redesigned user interface
  • It's easy to install and easy to get started
  • Get an at-a-glance summary of your blogging activity from content to contributors on our new dashboard
  • Easily insert text, photos, files and more with a rich WYSIWYG editing
  • Built-in asset, photo and file management
  • Support for creating standalone pages that automatically inherit your blog's design
  • Built-in member registration system for reader and comment authentication
  • Support for OpenID
  • Aggregate posts from multiple blogs into a single blog
  • Expanded options for archiving and displaying content
  • And much more...
终于有了 WYSIWYG 编辑器了,一会就去试用去 备份先

Blog Reloaded!

My MovableType Blog Reloaded!
Thanks to JAY.

在众多 WYSIWYG 编辑器中,FCKeditor算是不错的一个,可以与很多程序相结合

在与MT的结合方面也做得很不错,下面我们来看看步骤

  1. Download FCKeditor (我用的是2.1.1) 解压到 MT 的static 目录,如 mt-static. 完了后会在该目录下生成一个名为 FCKeditor 的目录.
  2. 打开 FCKeditor/fckeditor.js 文件,检查 this.BasePath 的路径,因为一般MT的后台可能都是Linux,所以要注意大小写的问题,this.BasePath  默认是小写 fckeditor,所以你可以改成FCKeditor ,注意,这个文件通常是只读的,记得改变权限后再去编辑
  1. 打开 /tmpl/cms/header.tmpl  文件,另存为: header_edit_entry.tmpl

  2. 编辑 header_edit_entry.tmpl 文件,在 <head> ... </head>标签之间添加以下代码
       <script type="text/javascript" 
          src="<TMPL_VAR NAME=STATIC_URI>FCKeditor/fckeditor.js"></script>
      
       <script type="text/javascript">
          window.onload = function()
          {
            var oFCKeditor = new FCKeditor( 'text' ) ;
            oFCKeditor.BasePath = '<TMPL_VAR NAME=STATIC_URI>FCKeditor/' ;
            oFCKeditor.Width = 580 ;
            oFCKeditor.Height = 400 ;
            oFCKeditor.CheckBrowser = true ;
            oFCKeditor.ReplaceTextarea() ;

            pFCKeditor = new FCKeditor( 'text_more' ) ;
            pFCKeditor.BasePath = '<TMPL_VAR NAME=STATIC_URI>FCKeditor/' ;
            pFCKeditor.Width = 580 ;
            pFCKeditor.Height = 400 ;
            pFCKeditor.CheckBrowser = true ;
            pFCKeditor.ReplaceTextarea() ;
               
            qFCKeditor = new FCKeditor( 'excerpt' ) ;
            qFCKeditor.BasePath = '<TMPL_VAR NAME=STATIC_URI>FCKeditor/' ;
            qFCKeditor.ToolbarSet = "MTExcerpt" ;
            qFCKeditor.Width = 580 ;
            qFCKeditor.Height = 200 ;
            qFCKeditor.CheckBrowser = true ;
            qFCKeditor.ReplaceTextarea() ;
          }
        </script>

  3. 打开 /tmpl/cms/edit_entry.tmpl 文件,把 <TMPL_INCLUDE NAME="header.tmpl"> 替换为<TMPL_INCLUDE NAME="header_edit_entry.tmpl">

  4. 删除MT原来自带的 (edit_entry.tmpl) 编辑按钮. 类似于 B, I, U 什么的,要删除2次:

    <script type="text/javascript">
    <!--
    if (canFormat) {
        with (document) {
            write('<a title="<MT_TRANS phrase="Bold" escape="singlequotes">
    [...]
        }
    }
    // -->
    </script>

    注意:  Entry Body 和 Extended Entry 段各山河
  5. 编辑 FCKeditor.js 文件(可选)修改默认的 toolbar

    将Default ToolbarSet 一段的代码替换为:

    FCKConfig.ToolbarSets["Default"] = [
    ['Source'],
    ['Cut','Copy','Paste','PasteText','PasteWord','-'],
    ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
    ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
    ['OrderedList','UnorderedList','-','Outdent','Indent'],
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
    ['Link','Unlink','Anchor'],
    ['Image','Table','Rule','Smiley','SpecialChar','UniversalKey']  ,  
    ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
    ' /',
    ['Style','FontFormat','FontName','FontSize'],
    ['TextColor','BGColor'],
    ['About']
    ] ;

  6. 接下来为继续添加以下代码,主要是去掉一些摘要(Excerpt)部分不需要的功能:

    FCKConfig.ToolbarSets["MTExcerpt"] = [
     ['Source'],
     ['Bold','Italic','Underline','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
    ] ;
  7. 最后,禁用自带的图像和链接浏览器:

    FCKConfig.LinkBrowser = false ;
    FCKConfig.ImageBrowser = false ;

  8. That's all! Good luck! 

PS. 这个编辑器很占资源,机器配置不好的朋友不建议使用。

MT插件Technorati Tags是以空格作为分隔符来区别多个关键字的,比如 "Movable Type" 表示的是 "Movable"和 "Type" 两个 Tag ,那如果我想在页面上显示"Movable Type",而 Tag 的链接指向是"Movable"+ "Type",该怎么办?

修改 plugins/TechnoratiTags.pl 文件,找到

$output .= "$tag ";

将其替换成

$output .= "" ;
$tag =~s/\+/ /g;
$output .= "$tag
" ;

这里主要利用了 Perl 的正则表示式来做到替换的目的,其中$tag =~s/\+/ /g; 加号就是连接字符,这样在发布的时候就在关键字一栏输入 Movable+Type ,显示在页面上的将是 "Movable Type",而 Tag 的链接指向是 http://technorati.com/tag/movable+type

PS. 作为连接符的加号可以自行用其他字符替换掉

转自 平生一笑@thinkjam
原文出处 http://www.thinkjam.org/zoptuno/archives/2005/09/stringmultibyte.html

Movable Type对中文的支持不错,但就是有个老毛病,就是在截断过长的中文时(如接收到的引用通告摘要),出现乱码。这虽不影响正常的使用,但看着就是不爽,更不要说还会影响网页的SEO了。

怎么解决呢?那就是Perl的String-Multibyte模块。

你可以采用两种方法安装此模块。一种是作为系统模块,在命令行下输入"ppm install String-Multibyte";另一种是从这里下载String-Multibyte模块解压缩后,将Multibyte.pm文件和 Multibyte目录上传到MT安装目录的extlib\String(没有String目录的话,请自行创建)目录下。

安装好模块后,就可以在MT程序中调用。对我们而言,主要是修改两个文件,即\lib\MT\App下的CMS.pm和Trackback.pm。

打开这两个文件,在@MT::App::Trackback::ISA = qw( MT::App );前加上

use String::Multibyte;
my $utf8 = String::Multibyte->new('UTF8');随后将需要的$substr和$length函数换为$utf8->substr和$utf8->length。

Update! 2005.9.29

为了让 trim_to 参数正常,请打开 \lib\MT\Template\ 下的 Context.pm 文件,在 use MT::ErrorHandler; 前加上上述内容,然后将

if (my $len = $local_args{trim_to}) {
$str = substr $str, 0, $len if $len < length($str);
}

改为

if (my $len = $local_args{trim_to}) {
$str = $utf8->substr($str, 0, $len) if $len < $utf8->length($str);
}

据sah测时,目前只对采用静态方式的归档有作用

随后将需要的$substr和$length函数换为$utf8->substr和$utf8->length。
在vim中,替换可以这样来做 :1,$s/substr(/$utf8->substr(/g

:1,$s/length(/$utf8->length(/g

今天重新配置了Apache服务器,结果发现在保存MT的模板的时候出现Premature end of script headers:mt.cgi referer: http://www.powerk6.org/mt.cgi...错误,后来发现是DBD::mysql的版本的问题,我把3.00000降级到2.9006就OK了

MT 的日期格式

Date Tag Formats
Movable Type uses standard strftime format strings to describe dates and times. (However, note that strftime itself is not actually used to perform the formatting.) In any date tag, you should use the format attribute to specify the format string, like this:

<$MTDate format="%B %e, %Y %I:%M %p"$>
The above format is actually the default format for English date formatting, and creates a date looking like this:

September 20, 2001 11:44 PM

The language used in weekday names, month names, and AM/PM specifiers can be chosen in the Weblog Configuration as Language for date display. The default language used is English.

从MT换到plog,再换到WordPress,兜了一圈,还是换了回来
发现还是MT比较好用
1

Recent Comments

Close