httpd.conf
①【CentOS6,5の場合】
[root@centos ~]# vi /etc/httpd/conf/httpd.conf ← httpd設定ファイル編集
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
↓
Options Includes ExecCGI FollowSymLinks ← CGI,SSIの許可
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
↓
AllowOverride All ← .htaccessの許可
#AddHandler cgi-script .cgi
↓
AddHandler cgi-script .cgi .pl ← CGIスクリプトに.plを追加
-----------------------------------------------------
②mt側のパーミッションの変更
path:/var/www/html/mt
拡張子.cgiのファイル->755
path:/var/www/html/mt/mt-static/
フォルダsupport->777
path:/var/www/html/
下のMTのブログフォルダ->777
mtフォルダ内の.cgiすべて755
DBの作成
CREATE DATABASE db;
[?]の文字化け対応
alter database db_name character set utf8 collate utf8_general_ci;
ALTER TABLE テーブル名
COLLATE utf8_general_ci;
SHA
yum -y install perl-Digest-SHA
ZIP
yum install perl-Archive-Zip
yum install perl-Time-HiRes
yum -y install perl-XML-Parser
yum install ImageMagick-perl
添付ファイルによるダウンロードか詳細ページ遷移する
<MTEntries>
<MTIgnore>添付ファイルのカウント</MTIgnore>
<MT:SetVar name="tmp_cnt" value="0">
<MT:For var="i" from="1" to="7">
<MT:SetVarBlock name="tagName">attfile<mt:var name="i"></MT:SetVarBlock>
<MTIfNonEmpty tag="$tagName">
<MT:SetVar name="tmp_cnt" value="1" op="+">
</MTIfNonEmpty>
</MT:For>
<li>
<MT:If name="tmp_cnt" gt="1"><a href=<$MTEntryPermalink$>><$MTEntryTitle$>(<MT:Var name="tmp_cnt">)</a>
<MT:Else><$MTEntryTitle$>,
<MT:If tag="attfile1"><mt:attfile1Asset><a href="<$MTAssetURL$>" target="_blank"><$MTAssetLabel$>(<$MTAssetProperty property="file_size"$>)</a></mt:attfile1Asset>
</MT:If>
</MT:If>
</li>
</MTEntries>
カテゴリリストとカテゴリ別のページ遷移
<MTTopLevelCategories sort_by="user_custom">
<MT:unless tag="CategoryLabel" eq="bannerarea">
<MTIfNonZero tag="MTCategoryCount">
<li class="cat_box">
<a href=<$mt:CategoryArchiveLink$>>
<mt:if tag="catImage"><mt:catimageAsset><img src="<mt:AssetUrl>" width="185" height="140"></mt:catimageAsset>
<mt:else><img src="<$MTWebsiteURL$>/img/noimage.png" width="185" height="140">
</mt:if>
</a></li>
</MTIfNonZero>
</MT:unless>
</MTTopLevelCategories>
newマークのつけ方(php_version)
<?php
$display = 60 * 60 * 24 * 3;
$entry_date = '<$MT:EntryDate format="%Y/%m/%d %H:%M:%S"$>';
$now = time();
if($now - $display < $entry_date){ echo "new";}else{echo "old";}
?>
ページネーションの実装(プラグイン:pagebute)
(※3.5.7以降のバージョンでは、こちらになります。)
<MTPageContents count="5">
<MTEntries>
<MTEntriesHeader><dl></MTEntriesHeader>
<dt><$MTEntryTitle$></dt>
<dd><$MTEntryExcerpt$></dd>
<$MTPageSeparator$>
<MTEntriesFooter></dl></MTEntriesFooter>
</MTEntries>
</MTPageContents>
<MTIfPageBefore>
<span><$MTPageBefore delim="前の5件"$></span>
</MTIfPageBefore>
<$MTPageLists$>
<MTIfPageAfter>
<span><$MTPageAfter delim="次の5件"$></span>
</MTIfPageAfter>
複数ブログ一括構築(プラグイン)
QuickRebuild
これで楽かな
本文の文字数のカウント(htmlタグを除く)
<$MT:EntryBody remove_html="1" count_characters="1" setvar="body_cnt"$>