<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>まいにち＠ぐだぐだ &#187; WordPress</title>
	<atom:link href="http://www.gdgd.ebiplan.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gdgd.ebiplan.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 26 Jan 2012 13:58:02 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/category/wordpress/feed/" />
		<item>
		<title>UpdateMessageプラグインのカスタマイズその後</title>
		<link>http://www.gdgd.ebiplan.com/2011/12/updatemessage%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba%e3%81%9d%e3%81%ae%e5%be%8c/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/12/updatemessage%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba%e3%81%9d%e3%81%ae%e5%be%8c/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 13:45:31 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Update Message]]></category>
		<category><![CDATA[日付書式]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1278</guid>
		<description><![CDATA[2011/11/5のエントリー『Update Messageプラグインの日付を何とか « まいにち＠ぐだぐだ』で、ブログエントリーで更新情報を明記するためのプラグイン、UpdateMessageを、日本風の年/月/日の書 [...]]]></description>
			<content:encoded><![CDATA[<p>2011/11/5のエントリー『<a href="http://www.gdgd.ebiplan.com/2011/11/update-message%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%AE%E6%97%A5%E4%BB%98%E3%82%92%E4%BD%95%E3%81%A8%E3%81%8B/">Update Messageプラグインの日付を何とか « まいにち＠ぐだぐだ</a>』で、ブログエントリーで更新情報を明記するためのプラグイン、UpdateMessageを、日本風の年/月/日の書式にするカスタマイズを施してみた。</p>
<p>その後、いろいろ考えていたんだけど、やっぱり、WordPressの日付書式フォーマットをそのまま適用できるようにしたいと、ここ数日悩んでみました。</p>
<p>前回のカスタマイズとは別に、オリジナルに手を加えて何とか出来ないかな…と、悩んでみたものの、オリジナルが『dd/mm/yy』という変換しにくい書式で登録しているのでいろいろ扱いにくいので、やっぱり、前回のカスタマイズの延長線上でのカスタマイズと言うことになってしまいました。</p>
<p>なので、日付を登録する際は『yyyy/mm/dd』という書式で登録しなければなりません。<br />
その代わりに、WordPressの日付書式フォーマットを反映して日付を表示するようになります。</p>
<p>135行目くらいから</p>
<pre> foreach ($all_msg as $a) {

preg_match('|\*([0-3][0-9]\/[0-1][0-9]\/[0-9]{2})\*|',$a, $date) ;
$a = trim(str_replace("*".$date[1]."*", "", $a)) ;

$b = str_replace('%ud%', $date[1], $html);
$b = str_replace('%pd%', get_the_time(), $b);
$b = str_replace('%ut%', $a, $b);

$resultat .= $b ;

}
</pre>
<p>を</p>
<pre> foreach ($all_msg as $a) {

preg_match('|\*([0-9]{4}\/[0-1][0-9]\/[0-3][0-9])\*|',$a, $date) ;
preg_match('|([0-9]{4}\/[0-1][0-9]\/[0-3][0-9])|',$a, $l_date) ;
$a = trim(str_replace("*".$date[1]."*", "", $a)) ;
$l_time = date_format(date_create($l_date[1]),get_option('date_format'));

//$b = str_replace('%ud%', $date[1], $html);
$b = str_replace('%ud%', $l_time, $html);
$b = str_replace('%pd%', get_the_time(), $b);
$b = str_replace('%ut%', $a, $b);

$resultat .= $b ;

}
</pre>
<p>こんな感じで書き換えてあげます。</p>
<p>だからどうした？と言いたくなる程度の事ですけどｗ</p>

]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/12/updatemessage%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba%e3%81%9d%e3%81%ae%e5%be%8c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/12/updatemessage%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba%e3%81%9d%e3%81%ae%e5%be%8c/" />
	</item>
		<item>
		<title>Boozurkを使ってみた</title>
		<link>http://www.gdgd.ebiplan.com/2011/11/boozurk%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/11/boozurk%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 03:09:33 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[boozurk]]></category>
		<category><![CDATA[サムネイル画像]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1252</guid>
		<description><![CDATA[使ってみたという言い方は変だなｗ 今使っているのがそうです。 この間までのShiwordと比べると、ずいぶんとシンプルな作りになっている。 今日(2011/11/12)現在、WordPressのテーマディレクトリにはまだ [...]]]></description>
			<content:encoded><![CDATA[<p>使ってみたという言い方は変だなｗ<br />
今使っているのがそうです。<br />
この間までのShiwordと比べると、ずいぶんとシンプルな作りになっている。<br />
今日(2011/11/12)現在、WordPressのテーマディレクトリにはまだ登録されていないようですが、まあ、数日のうちには登録されるでしょう。</p>
<p>ところで、サムネイル画像は使っていますか？<br />
おいらは、バリバリ使っていました。<br />
Shiwordがそういう作りになっていたのもあるのですが、何かいいですよね？<br />
サムネほいほいじゃないですけどｗ</p>
<p>そんな、既存の状況下にBoozurkをインストールすると、サムネイルがポストタイトルの下地に横幅一杯に拡大された状況でしかも、上からテーマで設定した高さで斬られるという哀れな状況になってしまいます。<br />
<a href="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/11/boozurk_sam_img_def.png"><img src="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/11/boozurk_sam_img_def_thumb.png" border="0" alt="boozurk_sam_img_def" title="boozurk_sam_img_def" width="240" height="56" style="background-image: none; margin: 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>まあ、こんな具合ですorz<br />
テーマのサムネイル画像では横長のイメージが使われていたようなので、おそらく、想定外なのではないかと思うのだけれど、このテーマのために、ゼロからサイトを作る人は居ないと思うので、何か上手い方法を考えて欲しいかな…と思って、コメントは入れておいた。</p>
<p>とりあえずの回避策としてはstyle.cssの465行目をコメントアウトすればとりあえずカッコが付きます。</p>
<pre>.bz-featured-title img {
width: 100%;
}
</pre>
<p>を</p>
<pre>.bz-featured-title img {
/*width: 100%;*/
}
</pre>
<p>な感じで。</p>
<p><a href="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/11/boozurk_sam_img_cus.png"><img src="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/11/boozurk_sam_img_cus_thumb.png" border="0" alt="boozurk_sam_img_cus" title="boozurk_sam_img_cus" width="240" height="49" style="background-image: none; margin: 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>こんな風になるだけですが…orz</p>

]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/11/boozurk%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/11/boozurk%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f/" />
	</item>
		<item>
		<title>Update Messageプラグインの日付を何とか</title>
		<link>http://www.gdgd.ebiplan.com/2011/11/update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/11/update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 17:03:54 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Update Message]]></category>
		<category><![CDATA[カスタマイズ]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1230</guid>
		<description><![CDATA[WordPressのプラグインのUpdate Message。 一度公開したエントリーの細かい更新情報を手動で(ｗ)記述しておくためのプラグインです。 コンテンツの最後にこんな感じで表示されます。 まあ、気分的になくても [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressのプラグインのUpdate Message<sup>[<a href="#update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b-n-1" class="footnoted" id="to-update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b-n-1">1</a>]</sup>。</p>
<p>一度公開したエントリーの細かい更新情報を手動で(ｗ)記述しておくためのプラグインです。<br />
コンテンツの最後にこんな感じで表示されます。</p>
<p><a href="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/11/UpdateMessage_sample.png"><img src="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/11/UpdateMessage_sample_thumb.png" border="0" alt="UpdateMessage_sample" title="UpdateMessage_sample" width="240" height="51" style="background-image: none; margin: 0px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>まあ、気分的になくてもどうってことはないんですが、何となく、おいらの自尊心のために『いいなぁこういうの』って言う程度ですので、だからどうだと声を<span style="color: #ff0000; font-size: medium;"><strong>大</strong></span>にしてぼやくほどのことでもないのですが…。</p>
<p>このプラグインのデフォルトでは日付の形式が</p>
<blockquote><p>05/10/11</p></blockquote>
<p>のような欧文表記にしか対応していません。<br />
でも、ここは日本じゃぱに～ず。</p>
<blockquote><p>2011/10/05</p></blockquote>
<p>のような表記の方が一般的でなじみやすい。</p>
<p>このプラグインはWordPressの設定を読んだりとか言う優しい作りになっていないので、いまいち気にくわなかったのでどうしようかと悩んだ挙げ句の果てに、強引にカスタマイズしてしましましたｗ</p>
<p>ああ、でも、前述のようなWordPressの設定を読んで動くなんて言う手は加えていませんｗ<br />
オリジナルのupdate-message.phpが強引に正規表現で動作しているだけなのでお手軽に正規表現とそれにまつわる部分を一部ちょっと書き換えてしまった程度です。</p>
<p>書き換える部分は2カ所ほど。</p>
<p>まずは105行目と106行目。</p>
<pre>

foreach ($all_msg as $a) {
if ($resultat!="")
$resultat .= "---" ;
if ((!preg_match('|\*[0-3][0-9]\/[0-1][0-9]\/[0-9]{2}\*|',$a))&amp;&amp;(trim($a)!="")) {
$a = "*".date("d")."/".date("m")."/".date("y")."*\n".$a ;
}
$resultat .= $a ;
}
</pre>
<p>を以下のようにカスタマイズ</p>
<pre>

foreach ($all_msg as $a) {
if ($resultat!="")
$resultat .= "---" ;
if ((!preg_match('|\*[0-9]{4}\/[0-1][0-9]\/[0-3][0-9]\*|',$a))&amp;&amp;(trim($a)!="")) {
$a = "*".date("y")."/".date("m")."/".date("d")."*\n".$a ;
}
$resultat .= $a ;
}
</pre>
<p>そして、もう一カ所。<br />
135行目。</p>
<pre>

preg_match('|\*([0-3][0-9]\/[0-1][0-9]\/[0-9]{2})\*|',$a, $date) ;
</pre>
<p>を以下のように。</p>
<pre>

preg_match('|\*([0-9]{4}\/[0-1][0-9]\/[0-3][0-9])\*|',$a, $date) ;
</pre>
<p>とまあ、こんな感じでほぼ強引な書き換えをしました。<br />
たぶん…いや、確実に<span style="color: #ff0000; font-size: medium;"><strong><span style="text-decoration: underline;">プラグインのアップデート</span></strong></span>が来ると<span style="color: #ff0000; font-size: medium;"><strong><span style="text-decoration: underline;">泣きます</span></strong></span>ｗ</p>
<p>まあ、と言うわけで、覚え書きのメモです(^_^;</p>

<ol class="footnotes">
	<li class="footnote" id="update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b-n-1"><strong><sup>[1]</sup></strong> <a href="http://wordpress.org/extend/plugins/update-message/">WordPress › Update Message « WordPress Plugins</a> <a class="note-return" href="#to-update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b-n-1">&#x21A9;</a></li></ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/11/update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/11/update-message%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e6%97%a5%e4%bb%98%e3%82%92%e4%bd%95%e3%81%a8%e3%81%8b/" />
	</item>
		<item>
		<title>WordPressのコメントスパム対策</title>
		<link>http://www.gdgd.ebiplan.com/2011/10/wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/10/wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 15:38:30 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Akismet]]></category>
		<category><![CDATA[QuickCommentsプラグイン]]></category>
		<category><![CDATA[ZigTrap]]></category>
		<category><![CDATA[スパム対策]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1216</guid>
		<description><![CDATA[こんな町外れの寂れたブログサイトですらコメントスパムはやってきます。 そうは言っても数は本当に少ないです。 もっとも、誰が視ているのかすらまっとうな数字は判りませんのでスパム率がどんなモノなのかは判りかねますが、おそらく [...]]]></description>
			<content:encoded><![CDATA[<p>こんな町外れの寂れたブログサイトですらコメントスパムはやってきます。</p>
<p>そうは言っても数は本当に少ないです。<br />
もっとも、誰が視ているのかすらまっとうな数字は判りませんのでスパム率がどんなモノなのかは判りかねますが、おそらくは、まっとうな訪問者よりもずっとスパムの方が多いはず。</p>
<p>一番簡単なスパム対策は『日本語が存在しなかったらはじく』と言うモノ。<br />
今までの経験的に、機械的にばらまかれるコメントスパムはほぼ、海外製。<br />
なので、日本語、つまり <span style="background-color: #ffff00; color: #ff0000;"><strong>あ～ん</strong></span> までの文字が1文字も存在しないコメントはスパムだと判断させること。</p>
<p>でも、今のおいらはこのデザインテーマを凄く気に入っていて、作者さんとの技術的やりとりを何度かさせていただいた関係上、この手は使えないのです。<br />
なので、このブログサイトでのスパム対策は既に先人の皆様が作って公開してくださっている便利なプラグインを使わせてもらっているだけです。</p>
<p>まずは、WordPressに初めからインストールされている <strong><em>Akismet</em></strong> プラグイン。<br />
このプラグインはWordPressを導入して、<strong>Akismet </strong>プラグインを有効にしているサイト同士でスパムの情報を交換し合うというか、蓄積して共有しているというか…まあ、そんな感じのプラグインです。<br />
おいらのブログサイト的にはかなりの活躍ですｗ<br />
ただね、このプラグインはコメントが投稿されて、<span style="background-color: #ffff00; color: #ff0000;"><strong>スパムと判定しても隔離するだけで、<span style="text-decoration: underline;">削除</span>や<span style="text-decoration: underline;">拒否</span>はしてくれません。</strong></span>その辺は管理者のお仕事なんですよ。<br />
まあ、誤判定というのも中にはあるでしょうから、致し方ないと言えば致し方ないんですがね。</p>
<p>正直に言うと、横着者のおいらはこの削除ですらめんどくさい。<br />
ここで次のプラグインです。</p>
<p><strong>ZigTrap <a href="http://www.zigpress.com/plugins/zigtrap/">ZigTrap – ZigPress</a></strong></p>
<p>このプラグインはコメントフォームに、見えないフォーム項目を追加して、そこに値が記入されていたらコメントを拒否するというプラグイン。<br />
つまり、機械的にスパムをばらまくスクリプトは、無駄な作業をしたくないから、ＨＴＭＬソースでフォーム項目を解析します。<br />
すると、本来、必要では無いし見えもしない項目(表示されない隠し項目)にまでわざわざ何かを記入しようとします。<br />
それを逆手にとって追加された隠し項目に何か入力があったらスパムと判定してコメントを拒否してしまうと言う動きをします。<br />
前述のAkismetプラグインと違い、コメントをシステムに残さないので気分的に楽です。<br />
そして、今や、Ａｋｉｓｍｅｔプラグインよりもスパムの撃退率が高くなっています。<br />
ただし、効果が現れるまでに少し時間がかかりましたが、効果が現れてからはすこぶる順調にスパムを撃退してくれているようです。</p>
<p>でもですよ。<br />
それでもやはり、時々、スパムはＡｋｉｓｍｅｔプラグインによって、捕獲されています。<br />
次のプラグインはスパム撃退効果のほどは判りません。<br />
無いよりはマシかな？くらいの感覚です。<br />
あ、プラグインの作者の名誉のために言っておきますが、プラグインが駄目だと言っているのではありませんからね。前述の<span style="background-color: #ffff00; color: #ff0000;"><strong>2つのプラグインが動作している環境に導入したので、このプラグインでのスパム撃退効果が判断付かない</strong></span>という意味合いです。</p>
<p><strong>Quick Comments <a href="http://wppluginsj.sourceforge.jp/quick-comments/">WordPress Plugins/JSeries » Quick Comments (コメント投稿 Ajax 化)</a></strong></p>
<p>このプラグインは、そもそもスパム対策のプラグインではありません。<br />
コメントを投稿するときに該当のページ全体をリロードするのでは無く、コメントの部分のみをＡｊａｘで取得して、現在のページを書き換えてコメントの投稿→表示を高速化しようというプラグインです。<br />
テーマテンプレートに少し手を加えないといけないのでテーマデザインの知識が少し必要ですが、動作のもっさりしているレン鯖で運営しているサイトには是非とも装備して欲しいプラグインです。<br />
で、このプラグインが進化の過程で追加された機能が</p>
<blockquote><p>Ver.0.6.0 からは、コメント修正時に名前・メール・ウェブサイトの修正も可能になりました。<br />
また、Livedoor が提供する<a href="http://spam-champuru.livedoor.com/dnsbl/">統合スパムフィルタ「スパムちゃんぷるー」のデータに基づくDNSBL(β)</a>を利用したSPAM対策を利用できるようになりました。<br />
(<a href="http://wppluginsj.sourceforge.jp/quick-comments/">WordPress Plugins/JSeries » Quick Comments (コメント投稿 Ajax 化)</a>のページから抜粋させていただきました)</p></blockquote>
<p>という、スパム対策の機能です。</p>
<p>とりあえず、以上の3つのプラグインにて、おいらの辺境僻地のブログサイト『まいにち＠ぐだぐだ』では、Akismetプラグインによるスパムの捕獲も本当に、ごくたまにくらいになりましたので、ものすごく負担が軽減されています。<br />
まあ、WordPressにはコメントの投稿の際に画像文字を表示してそれを入力させて機械的スパムを判定するCAPTCHA<sup>[<a href="#wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-1" class="footnoted" id="to-wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-1">1</a>]</sup>プラグインもあまた存在しますが、これって、実はいたちごっこで、OCR技術の進歩とともに、アルファベットのみのCAPTCHA認証では限界があり、その一線を越えた複雑なモノは逆に、人間ですら認識するのが困難になるという本末転倒な状況<sup>[<a href="#wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-2" class="footnoted" id="to-wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-2">2</a>]</sup>が起きています。<br />
それって、CAPTCHA認証をクリアするための労力を考えるとコメントを投稿するのを放棄してしまうと言う行動を選択させてしまうと言う実に、運営者にとっても閲覧者にとってもちっともありがたくないという結末をもたらせてしまいます。<br />
そんなわけで、おいらのポリシーは『CAPTCHAは使わない』と言うことでやっております。</p>
<p>まあ、ごくまれに、コメントを受け付けなくなっているエントリーがあったりしますが、それはスパムに狙われてコメントを禁止にしたエントリーなのです。<br />
あ、古いエントリーが主なので最近のは問題ないでしょ？<br />
古いエントリーと言えば、WordPressのディスカッションの設定に</p>
<ul>
<li>『 』日以上前の投稿のコメントフォームを自動的に閉じる</li>
</ul>
<p>という項目があります。<br />
スパムは割と古いエントリーに取り憑きやすいので、これを有効すると、効果がさらにアップするかもしれませんね。<br />
ちなみに、このサイトでは有効にしていません。<br />
そこまで深刻じゃないし、おいら程度のサイトはこれをすると『コメントは一切付かない』という恐ろしい結末が待っているからですｗ</p>
<script src="http://www.gdgd.ebiplan.com/wp-content/plugins/hello-claudia/flexplayer/jquery.flexplayer.min.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
var player;
jQuery(function() {player = new jQuery(".claudia").flexplayer({ swfPath : "http://www.gdgd.ebiplan.com/wp-content/plugins/hello-claudia/flexplayer/flexplayer.swf" });});
function playStart(media_url){player.play({type: "mp3", path: media_url, volume: 100});}
// ]]&gt;
</script>
<div class="claudia2"><div class="claudia3"> </div><div class="claudia4"><span style="color: #000000;">まあ、あまり参考にもならないかもしれませんが、スパムに困っているサイト運営者さんにちょっとでも恩恵があれば…。</span></p>
<p>お疲れ様♪</div></div><div class="claudia" onclick="playStart('http://www.gdgd.ebiplan.com/wp-content/plugins/hello-claudia/media/38otsukare.mp3')">&nbsp;</div><div class="claudia5"><p style="padding:0;"><small>&copy; 2011 Microsoft Corp. All Rights Reserved.</small></p></div>

<ol class="footnotes">
	<li class="footnote" id="wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-1"><strong><sup>[1]</sup></strong> <a href="http://ja.wikipedia.org/wiki/Captcha">CAPTCHA &#8211; Wikipedia</a> <a class="note-return" href="#to-wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-1">&#x21A9;</a></li>
	<li class="footnote" id="wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-2"><strong><sup>[2]</sup></strong> Googleの使っているCAPTCHAは酷い。 <a class="note-return" href="#to-wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96-n-2">&#x21A9;</a></li></ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/10/wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/10/wordpress%e3%81%ae%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%91%e3%83%a0%e5%af%be%e7%ad%96/" />
	</item>
		<item>
		<title>Shiwordとwp-lightpopの関係</title>
		<link>http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a8wp-lightpop%e3%81%ae%e9%96%a2%e4%bf%82/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a8wp-lightpop%e3%81%ae%e9%96%a2%e4%bf%82/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 15:53:21 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[shiword]]></category>
		<category><![CDATA[wp-lightpop]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1137</guid>
		<description><![CDATA[画像や動画をlightbox風にして表示してくれるプラグイン『WordPress Plugins/JSeries » WP-lightpop (画像、動画ハイライト表示)』を使っていますが、Shiwordテーマとはちょっ [...]]]></description>
			<content:encoded><![CDATA[<p>画像や動画をlightbox風にして表示してくれるプラグイン『<a href="http://wppluginsj.sourceforge.jp/wp-lightpop/">WordPress Plugins/JSeries » WP-lightpop (画像、動画ハイライト表示)</a>』を使っていますが、Shiwordテーマとはちょっとだけ相性がよろしくないようです。</p>
<p><a href="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/06/sh_lpop_1.png"><img src="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/06/sh_lpop_1_thumb.png" border="0" alt="sh_lpop_1" title="sh_lpop_1" width="240" height="179" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" /></a></p>
<p>本来ならば、lightpopの表示が最前面に位置しなければいけないのですが、Shiwordの外枠フレームとの間に表示されてしまっています。<br />
理由は簡単な話で、エレメントを表示する順番を指定するz-indexの値をShiwordではなぜか300台の数値を使用しているためです。<br />
それに対してlightpopの方は100台の数値ですので、当然Shiwordのとりわけ外フレーム(主にheader部とフッター部)とアニメーテッドメニューの下に表示されてしまうのです。</p>
<p>なぜにShiwordではこのような値を使っているのか判りませんが、何らかの理由があるためにこの値を採用しているのだと思われます。<br />
なので、むやみに変えてしまうのもどうかと思うのですが、とりわけ、おいらのところでは他への影響がなさそうなので、Shiwordの方の数値に手を加えてしまうことにしました。</p>
<p>なぜShiwordの方か？というと、lightpopの方はjavascriptでz-indexの値を定義しているようでしたので、プラグイン本体に手を加えざるを得なくなってしまいます。<br />
そうやってしまうと、プラグインのアップデートの際に影響を喰らってしまいます。<br />
なので、他に影響が出ないのであれば、Shiwordの方をいじってしまった方が簡単である…というわけなのです。</p>
<p>ソースをあさった結果、lightpopの方は一番下の値でも『90』でしたので、Shiwordの方でこの値より下の値に変更すればうまくいくはずです。<br />
Shiwordの方はchildテーマにしてしまえばオリジナルに手を加えなくても良くなりますから一番手っ取り早くしかも安全です。</p>
<p><span style="background-color: #ffff00;">siword_ch/style.css</span></p>
<pre>﻿/*
Theme Name: Shiword child
Theme URI: http://www.gdgd.ebiplan.com
Description: Simple dark theme with lots of features, like a "quick links" menu, an "easy navigation" bar, header and footer sidebars or print preview. Shiword is fully customizable (there's also a skin builder!), with one or two columns and up to 5 widgets areas. Supports WP 3.0 new menu tool and post thumbnails.
Version: 1.11c0
Author: gdgd
Author URI: http://www.gdgd.ebiplan.com
Template: shiword

License: GNU General Public License, version 2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* standard tags
----------------------------------------------------------*/
@import url('../shiword/style.css');

#fixedfoot_cont {
z-index: 80;
}
#head_cont {
z-index: 81;
}
.ani_meta:hover {
z-index: 80;
}
.ani_meta_js:hover {
z-index: 80;
}
</pre>

]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a8wp-lightpop%e3%81%ae%e9%96%a2%e4%bf%82/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a8wp-lightpop%e3%81%ae%e9%96%a2%e4%bf%82/" />
	</item>
		<item>
		<title>ShiwordでQuick Commentsを使うのだ</title>
		<link>http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 15:16:12 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[QuickCommentsプラグイン]]></category>
		<category><![CDATA[shiword]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1120</guid>
		<description><![CDATA[ShiwordでAjaxを使ってコメントの投稿・反映を高速化してくれるQuickCommentsを使ってみた。 Shiwordテーマはコメントフォームの要素がWordPressのデフォルトと同じ要素名を使用しているような [...]]]></description>
			<content:encoded><![CDATA[<p>ShiwordでAjaxを使ってコメントの投稿・反映を高速化してくれるQuickComments<sup>[<a href="#shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0-n-1" class="footnoted" id="to-shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0-n-1">1</a>]</sup>を使ってみた。</p>
<p>Shiwordテーマはコメントフォームの要素がWordPressのデフォルトと同じ要素名を使用しているようなのでほぼデフォルトのままで動作が可能なのですが、コメントのための項目などをPHPの配列で渡す状態で記述されているのでちょっと一工夫(？)が必要だったので、その辺をメモ書き。</p>
<p>QuickCommentsプラグインでは拡張機能として新たなコメントが付いたときにメールやTwitterにお知らせを入れる機能があるのですが、Twitterでお知らせする機能のみを使用するための記述のみを行いました。</p>
<p>書き換える場所はcomments.phpの31行目から39行目まで。<br />
<span style="background-color: #ffff00;">変更前</span></p>
<pre>&lt;?php
$sw_fields =  array(
	&#039;author&#039; =&gt; &#039;&lt;p class=&quot;comment-form-author&quot;&gt;&#039; . &#039;&lt;input id=&quot;author&quot; name=&quot;author&quot; type=&quot;text&quot; value=&quot;&#039; . esc_attr( $commenter[&#039;comment_author&#039;] ) . &#039;&quot; size=&quot;30&quot; aria-required=&quot;true&quot; /&gt;&#039; .
	            &#039;&lt;label for=&quot;author&quot;&gt;&#039; . __( &#039;Name&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt; &#039; . ( $req ? &#039;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&#039; : &#039;&#039; ) .&#039;&lt;/p&gt;&#039;,
	&#039;email&#039;  =&gt; &#039;&lt;p class=&quot;comment-form-email&quot;&gt;&#039; . &#039;&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot; value=&quot;&#039; . sanitize_email(  $commenter[&#039;comment_author_email&#039;] ) . &#039;&quot; size=&quot;30&quot; aria-required=&quot;true&quot; /&gt;&#039; .
	            &#039;&lt;label for=&quot;email&quot;&gt;&#039; . __( &#039;Email&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt; &#039; . ( $req ? &#039;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&#039; : &#039;&#039; ) .&#039;&lt;/p&gt;&#039;,
	&#039;url&#039;    =&gt; &#039;&lt;p class=&quot;comment-form-url&quot;&gt;&#039; . &#039;&lt;input id=&quot;url&quot; name=&quot;url&quot; type=&quot;text&quot; value=&quot;&#039; . esc_url( $commenter[&#039;comment_author_url&#039;] ) . &#039;&quot; size=&quot;30&quot; /&gt;&#039; .
	            &#039;&lt;label for=&quot;url&quot;&gt;&#039; . __( &#039;Website&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt;&#039; .&#039;&lt;/p&gt;&#039;,
); ?&gt;
</pre>
<p><span style="background-color: #ff0000;">変更後</span></p>
<pre>&lt;?php global $comment_author_twitter_ID;
	if (isset($comment_author_twitter_ID))
	{
	$sw_fields =  array(
		&#039;author&#039; =&gt; &#039;&lt;p class=&quot;comment-form-author&quot;&gt;&#039; . &#039;&lt;input id=&quot;author&quot; name=&quot;author&quot; type=&quot;text&quot; value=&quot;&#039; . esc_attr( $commenter[&#039;comment_author&#039;] ) . &#039;&quot; size=&quot;30&quot; aria-required=&quot;true&quot; /&gt;&#039; .
		            &#039;&lt;label for=&quot;author&quot;&gt;&#039; . __( &#039;Name&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt; &#039; . ( $req ? &#039;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&#039; : &#039;&#039; ) .&#039;&lt;/p&gt;&#039;,
		&#039;email&#039;  =&gt; &#039;&lt;p class=&quot;comment-form-email&quot;&gt;&#039; . &#039;&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot; value=&quot;&#039; . sanitize_email(  $commenter[&#039;comment_author_email&#039;] ) . &#039;&quot; size=&quot;30&quot; aria-required=&quot;true&quot; /&gt;&#039; .
		            &#039;&lt;label for=&quot;email&quot;&gt;&#039; . __( &#039;Email&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt; &#039; . ( $req ? &#039;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&#039; : &#039;&#039; ) .&#039;&lt;/p&gt;&#039;,
		&#039;url&#039;    =&gt; &#039;&lt;p class=&quot;comment-form-url&quot;&gt;&#039; . &#039;&lt;input id=&quot;url&quot; name=&quot;url&quot; type=&quot;text&quot; value=&quot;&#039; . esc_url( $commenter[&#039;comment_author_url&#039;] ) . &#039;&quot; size=&quot;30&quot; /&gt;&#039; .
		            &#039;&lt;label for=&quot;url&quot;&gt;&#039; . __( &#039;Website&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt;&#039; .&#039;&lt;/p&gt;&#039;,
		&#039;twitterID&#039;=&gt;	&#039;&lt;p class=&quot;comment-form-email&quot;&gt;&#039; . &#039;&lt;input id=&quot;twitterID&quot; name=&quot;twitterID&quot; type=&quot;text&quot; value=&quot;&#039; .  $comment_author_twitter_ID . &#039;&quot; /&gt;&#039; .
						&#039;&lt;label for=&quot;twitterID&quot;&gt;Twitter アカウント(コメントが追加されたら＠リプライでお知らせします。)&lt;/label&gt;&#039; . &#039;&lt;/p&gt;&#039;,
	);
	} else {
	$sw_fields =  array(
		&#039;author&#039; =&gt; &#039;&lt;p class=&quot;comment-form-author&quot;&gt;&#039; . &#039;&lt;input id=&quot;author&quot; name=&quot;author&quot; type=&quot;text&quot; value=&quot;&#039; . esc_attr( $commenter[&#039;comment_author&#039;] ) . &#039;&quot; size=&quot;30&quot; aria-required=&quot;true&quot; /&gt;&#039; .
		            &#039;&lt;label for=&quot;author&quot;&gt;&#039; . __( &#039;Name&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt; &#039; . ( $req ? &#039;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&#039; : &#039;&#039; ) .&#039;&lt;/p&gt;&#039;,
		&#039;email&#039;  =&gt; &#039;&lt;p class=&quot;comment-form-email&quot;&gt;&#039; . &#039;&lt;input id=&quot;email&quot; name=&quot;email&quot; type=&quot;text&quot; value=&quot;&#039; . sanitize_email(  $commenter[&#039;comment_author_email&#039;] ) . &#039;&quot; size=&quot;30&quot; aria-required=&quot;true&quot; /&gt;&#039; .
		            &#039;&lt;label for=&quot;email&quot;&gt;&#039; . __( &#039;Email&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt; &#039; . ( $req ? &#039;&lt;span class=&quot;required&quot;&gt;*&lt;/span&gt;&#039; : &#039;&#039; ) .&#039;&lt;/p&gt;&#039;,
		&#039;url&#039;    =&gt; &#039;&lt;p class=&quot;comment-form-url&quot;&gt;&#039; . &#039;&lt;input id=&quot;url&quot; name=&quot;url&quot; type=&quot;text&quot; value=&quot;&#039; . esc_url( $commenter[&#039;comment_author_url&#039;] ) . &#039;&quot; size=&quot;30&quot; /&gt;&#039; .
		            &#039;&lt;label for=&quot;url&quot;&gt;&#039; . __( &#039;Website&#039;, &#039;shiword&#039; ) . &#039;&lt;/label&gt;&#039; .&#039;&lt;/p&gt;&#039;,
	);} ?&gt;
</pre>
<p>テーマ本体を書き換えるのも良いですが、子テーマを作ってそこに入れてしまう方が推奨されています。<br />
ああ、日本語を直接書いているのでutf-8Nで保存しないと文字化けします(^_^;<br />
まあ、簡単に言っちゃうとQuickCommentsのTwitterのオプションが有効だったらこの配列を返して、無効だったらこの配列を渡す…みたいな感じです。<br />
難しい話じゃないんだけど、テーマのアップデートで書き換えないといけないときに面倒なので…備忘録だなｗ<br />
一応、動いて居るっぽいので…これでいいのだろうと楽観視してますがorz<br />
動かなかったりしたら<a href="http://www.gdgd.ebiplan.com/contactform/">Contact form « まいにち＠ぐだぐだ</a>からお知らせください<(_ _)></p>

<ol class="footnotes">
	<li class="footnote" id="shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0-n-1"><strong><sup>[1]</sup></strong> <a href="http://wppluginsj.sourceforge.jp/quick-comments/">WordPress Plugins/JSeries » Quick Comments (コメント投稿 Ajax 化)</a> <a class="note-return" href="#to-shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0-n-1">&#x21A9;</a></li></ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/06/shiword%e3%81%a7quick-comments%e3%82%92%e4%bd%bf%e3%81%86%e3%81%ae%e3%81%a0/" />
	</item>
		<item>
		<title>Shiword 2.08 translation files</title>
		<link>http://www.gdgd.ebiplan.com/2011/06/shiword-2-08-translation-files/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/06/shiword-2-08-translation-files/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 05:14:13 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[shiword]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[日本語化]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1095</guid>
		<description><![CDATA[Shiwordテーマの日本語翻訳ファイル。解凍して出てきたja.poとja.moの2つのファイルをテーマのlanguagesフォルダの中に入れればok。意味があってる？or解釈が違うだろ！などは随時受付しまふorz sh [...]]]></description>
			<content:encoded><![CDATA[<p>Shiwordテーマの日本語翻訳ファイル。解凍して出てきたja.poとja.moの2つのファイルをテーマのlanguagesフォルダの中に入れればok。意味があってる？or解釈が違うだろ！などは随時受付しまふorz<br />
<a href="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/06/shiword_2_08ja2.zip">shiword_2_08ja2</a>※自己責任でお願いします。</p>

]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/06/shiword-2-08-translation-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/06/shiword-2-08-translation-files/" />
	</item>
		<item>
		<title>Shiwordが2.08にアップデート</title>
		<link>http://www.gdgd.ebiplan.com/2011/05/shiword%e3%81%8c2-08%e3%81%ab%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/05/shiword%e3%81%8c2-08%e3%81%ab%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88/#comments</comments>
		<pubDate>Fri, 27 May 2011 10:40:24 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[shiword]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=1047</guid>
		<description><![CDATA[Padタイプの端末に雰囲気が似ているWPのテーマShiwordが2.08にアップデート。なんか、機能が増えている気がするんですけど…poファイルのアップデートが大変そうですorz]]></description>
			<content:encoded><![CDATA[<p>Padタイプの端末に雰囲気が似ているWPのテーマShiwordが2.08にアップデート。なんか、機能が増えている気がするんですけど…poファイルのアップデートが大変そうですorz</p>

]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/05/shiword%e3%81%8c2-08%e3%81%ab%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/05/shiword%e3%81%8c2-08%e3%81%ab%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88/" />
	</item>
		<item>
		<title>サムネイル画像もreflectしてみた</title>
		<link>http://www.gdgd.ebiplan.com/2011/03/%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/03/%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 13:14:27 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[reflect]]></category>
		<category><![CDATA[shiword]]></category>
		<category><![CDATA[アイキャッチ画像]]></category>
		<category><![CDATA[サムネイル画像]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=923</guid>
		<description><![CDATA[ただいまお気に入りのテーマ『shiword』。 実は、エントリーのサムネイル画像(アイキャッチ画像)に対応している。 テーマに同梱のデフォルト画像がリフレクト効果を施したモノなので、フロントページではアイキャッチ画像がち [...]]]></description>
			<content:encoded><![CDATA[<p>ただいまお気に入りのテーマ『shiword』。<br />
実は、エントリーのサムネイル画像(アイキャッチ画像)に対応している。</p>
<p>テーマに同梱のデフォルト画像がリフレクト効果を施したモノなので、フロントページではアイキャッチ画像がちゃっちく見えてしまう。</p>
<p>そんなわけで、何とかしてみようと思って探してみました。<br />
<a href="http://plugins.jquery.com/project/reflect">Reflect jQuery | jQuery Plugins</a></p>
<p>おいらは、子テーマ<sup>[<a href="#%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f-n-1" class="footnoted" id="to-%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f-n-1">1</a>]</sup>を使って運用しているので、今回もその手法で何とかならんか挑んでみました。</p>
<p>子テーマのフォルダは本来、何でもいいのですがｗ<br />
reflectのスクリプトファイルをロードする際に、子テーマのurl位置を取得する方法が判らなかったので苦肉の策で『shiword_ch』にしました。<br />
なぜ？かは、テーマのurl位置を取得するテーマファンクションに<span style="color: #00ccff;"><em><strong>bloginfo(&#8216;template_url&#8217;);</strong></em></span>と言うモノがあります。<br />
これを使うと例えばおいらのところだと『<span style="color: #00ccff;"><em><strong>http://www.gdgd.ebiplan.com/wp-content/themes/shiword</strong></em></span>』までを返してくれます。<br />
なので、単純に<span style="color: #00ccff;"><em><strong>bloginfo(&#8216;template_url&#8217;);</strong></em></span>の後に『<span style="color: #ff0000;"><em><strong>_ch</strong></em></span>』をくっつけてあげて、子テーマのフォルダ名にでっち上げたと言う顛末です。<br />
もしかしたら、子テーマのurl位置を取得するファンクションがあるかもしれません。<br />
突っ込みをお待ちしております&lt;(_ _)&gt;</p>
<p>さて、ではいよいよカスタムテーマの作成と参りましょう。<br />
用意するのはheader.phpとindex.phpです。<br />
そして、最初にダウンロードしたリフレクト用のjQuery用のプラグイン。<br />
必要なのは<span style="color: #ff0000;"><em><strong>jquery.reflect.js</strong></em></span>だけです。<br />
あー、style.cssも必要ですが、今回は作成済みなので割愛します(ヲイ)</p>
<p>まず、リフレクト効果を付加するためのスクリプトをロードさせなきゃいけませんね。<br />
で、ロードしたついでに実行させます。<br />
header.phpを書き換えました。</p>
<pre>    &lt;?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?&gt;
&lt;?php wp_head(); ?&gt;

&lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;_ch/jquery.reflect.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
jQuery(document).ready(function() {
jQuery('img.reflect').reflect({height: 0.2, opacity: 0.1});
});
&lt;/script&gt;
&lt;/head&gt;
</pre>
<p>28行目から33行目までを付け足しました。<br />
31行目のheightでリフレクト効果の高さ、opacityで透明度を設定します。<br />
小数点以下の数値でなければならないみたいです。注意してくださいね。<br />
ちなみに、opacityは0.1か0.2くらいがちょうどいいみたいです(デフォルトの画像と比較して)。</p>
<p>次はindex.phpです。</p>
<pre>            // Post thumbnail
if( $shiword_opt['shiword_pthumb'] ==1 ) {
if( has_post_thumbnail() ) {
the_post_thumbnail( array( 120,120 ), array( 'class' =&gt; 'alignleft reflect' ) );
} else {
echo '&lt;img class="alignleft wp-post-image" alt="thumb" src="' . get_template_directory_uri() . '/images/thumb_120.png" /&gt;';
}
}
</pre>
<p>ここは、部分的な追記です。<br />
33行目のarray内のclassの値に『<span style="color: #ff0000;"><em><strong> reflect</strong></em></span>』を追記します。<br />
実は、このclassの値のところに『<span style="color: #00ffff;"><em>rheight30 ropacity60</em></span>』と言う風に追記してあげても効果を付けられるようなのですが、なぜか、これ以外の値を設定しても反映されません。<br />
どこかでコンフリクトでもしているのかもしれませんね。</p>
<p><a title="reflect" href="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/03/reflect.png"><img src="http://www.gdgd.ebiplan.com/wp-content/uploads/2011/03/reflect-150x150.png" title="reflect" width="150" height="150" class="alignleft size-thumbnail wp-image-924" /></a>これで、フロントページに表示されるサムネイル(キャッチアップ)画像と、デフォルトのアイコンで統一感が少し生まれます。<br />
まあ、左に寄ってしまうのが何ともいけていないのですが…とりあえず、今回はここまでで満足と言うことで。</p>
<p>&nbsp;</p>
<p>追記(2011/05/25):<br />
Shiwordテーマがバージョンアップしました。子テーマのままでは正しく表示されないと言うことが判明しましたので、一時、オリジナルでの表示に切り替えています。近日中にカスタマイズを施すつもりです。</p>

<ol class="footnotes">
	<li class="footnote" id="%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f-n-1"><strong><sup>[1]</sup></strong> <a href="http://wpdocs.sourceforge.jp/Child_Themes">子テーマ &#8211; WordPress Codex 日本語版</a> <a class="note-return" href="#to-%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f-n-1">&#x21A9;</a></li></ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/03/%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/03/%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e7%94%bb%e5%83%8f%e3%82%82reflect%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f/" />
	</item>
		<item>
		<title>待ち焦がれたテーマファイル『shiword』リリース！</title>
		<link>http://www.gdgd.ebiplan.com/2011/02/%e5%be%85%e3%81%a1%e7%84%a6%e3%81%8c%e3%82%8c%e3%81%9f%e3%83%86%e3%83%bc%e3%83%9e%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%80%8eshiword%e3%80%8f%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9%ef%bc%81/</link>
		<comments>http://www.gdgd.ebiplan.com/2011/02/%e5%be%85%e3%81%a1%e7%84%a6%e3%81%8c%e3%82%8c%e3%81%9f%e3%83%86%e3%83%bc%e3%83%9e%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%80%8eshiword%e3%80%8f%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9%ef%bc%81/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 13:39:52 +0000</pubDate>
		<dc:creator>ぐだぐだ＠ひらひら</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[shiword]]></category>
		<category><![CDATA[文字化け]]></category>
		<category><![CDATA[日付表記]]></category>

		<guid isPermaLink="false">http://www.gdgd.ebiplan.com/?p=855</guid>
		<description><![CDATA[気に入って使っていたWordPressのテーマ『Fastfood』。 このテーマの開発チーム『TwoBeers Project &#8211; artigiani del byte』の新しいテーマ『Tema per Wo [...]]]></description>
			<content:encoded><![CDATA[<p>気に入って使っていたWordPressのテーマ『Fastfood』。    <br />このテーマの開発チーム『<a href="http://www.twobeers.net/">TwoBeers Project &#8211; artigiani del byte</a>』の新しいテーマ『<a href="http://www.twobeers.net/annunci/shiword">Tema per WordPress: Shiword | TwoBeers Project</a>』は、「Fastfood』を使っていた頃からリリースを心待ちにしていたものです。</p>
<p><span id="more-855"></span>で、1月ほど前のエントリー『<a href="http://www.gdgd.ebiplan.com/2011/01/quick-bar%e3%81%ae%e6%96%87%e5%ad%97%e5%8c%96%e3%81%91%e5%af%be%e7%ad%96%e3%82%92%e3%81%97%e3%81%9f%e3%83%a1%e3%83%a2/">Quick-barの文字化け対策をしたメモ « まいにち＠ぐだぐだ</a>』で紹介した問題がやはり含まれていましたので、とりあえず修正してみました。
<p>今日は、このiPad風の面構えの最下部に表示されている<font color="#3342ff">『today is …』</font>の部分の表記を考えてみました。     <br />前述の文字化けの問題はfunction.phpに外部ファイルを読み込んだり、アクションフックの仕掛けがしてあったり…と、子テーマという便利な仕組みを使うと正しく動作しないので直接書き換えるしかなかったのですが、この問題はfooter.phpだけの問題なので、子テーマという仕組みが使えます。</p>
<p>なので、まず、子テーマ用のフォルダーを用意します。    <br />で、テーマを認識させるためにテーマの情報を書き込んだstyle.cssを用意します。     
<pre>/*
Theme Name: Shiword child
Theme URI: http://www.gdgd.ebiplan.com
Description: Simple dark theme with lots of features, like a "quick links" menu, an "easy navigation" bar, header and footer sidebars or print preview. Shiword is fully customizable (there's also a skin builder!), with one or two columns and up to 5 widgets areas. Supports WP 3.0 new menu tool and post thumbnails.
Version: 1.11c0
Author: gdgd
Author URI: http://www.gdgd.ebiplan.com
Template: shiword

License: GNU General Public License, version 2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* standard tags
----------------------------------------------------------*/
@import url('../shiword/style.css');
</pre>
<p>まあ、内容のほどはオリジナルをコピーしてきて、スタイルシートの部分をそぎ落として、適当に書き換えただけです。    <br />子テーマで有ることを明示する『<font color="#ff0000">Template: shiword</font>』と言う項目を追加して、最後の『<font color="#ff0000">@import url(&#8216;../shiword/style.css&#8217;);</font>』を追記します。     <br />子テーマの詳細については『<a href="http://wpdocs.sourceforge.jp/Child_Themes">子テーマ &#8211; WordPress Codex 日本語版</a>』を参照してください。</p>
<p>次は、オリジナルのfooter.phpを子テーマのフォルダーにコピーして、変更を加えます。    <br />変更が必要な部分は125行目     
<pre>
&lt;div id=&quot;statusbar&quot;&gt;
&lt;?php _e( &#039;Welcome&#039;, &#039;shiword&#039; ); ?&gt; &lt;?php if ( is_user_logged_in() ) { echo $current_user-&gt;display_name; } ?&gt;, &lt;?php _e( &#039;today is &#039;, &#039;shiword&#039; ); echo date_i18n( &#039;l&#039; ); ?&gt; &lt;?php echo date_i18n( __( &#039;F j, Y&#039;, &#039;shiword&#039; ) ); ?&gt;
&lt;/div&gt;</pre>
<p>です。     <br />『<font color="#3342ff">echo date_i18n( &#8216;l&#8217; );</font>』の部分で『<font color="#ff0000">曜日</font>』を表示して、『<font color="#3342ff">echo date_i18n( __( &#8216;F j, Y&#8217;, &#8216;shiword&#8217; ) );</font>』の部分で『<font color="#ff0000">日付</font>』を表示しています。     <br />日本では『<font color="#3342ff">○○年○○月○○日(曜日)</font>』という表記方法が一般的ですので、このままだと『<font color="#ff0000">曜日 ○○月○○,○○</font>』という形で表示されてしまいます。     <br />ただし、デフォルトでは日本語用の翻訳ファイルはありませんからすべて英文表記です。     <br />『○○月○○,○○』の部分は翻訳ファイルで『Y年n月j日』と翻訳を当ててあげれば解決するのでいいのですが、それでも『曜日 ○○年○○月○○日』と曜日が先に表示されてしまいます。     <br />日本で一般的な表記にしたいと言う場合には、前述の『<font color="#3342ff">echo date_i18n( &#8216;l&#8217; );</font>』と『<font color="#3342ff">echo date_i18n( __( &#8216;F j, Y&#8217;, &#8216;shiword&#8217; ) );</font>』を入れ替える必要があります。     
<pre>&lt;div id=&quot;statusbar&quot;&gt;
&lt;?php _e( &#039;Welcome&#039;, &#039;shiword&#039; ); ?&gt; &lt;?php if ( is_user_logged_in() ) { echo $current_user-&gt;display_name; } ?&gt;, &lt;?php _e( &#039;today is &#039;, &#039;shiword&#039; ); echo date_i18n( __( &#039;F j, Y&#039;, &#039;shiword&#039; ) ); ?&gt; &lt;?php echo date_i18n( &#039;(D)&#039; ); ?&gt;
&lt;/div&gt;</pre>
<p>と言う風に書き換えます。     <br />これで『○○年○○月○○日(曜日)』という表記になります。</p>
<p>試していないのですが、『echo date_i18n( __( <font color="#ff0000"><strong>&#8216;l F j, Y&#8217;</strong></font>, &#8216;shiword&#8217; ) );』として曜日を含めてしまえば、すべて翻訳を当てるだけで解決できるのではないのだろうか…と思っていますが…果たしてどうでしょうね？     <br />気が向いたら試してみたいと思います。</p>

]]></content:encoded>
			<wfw:commentRss>http://www.gdgd.ebiplan.com/2011/02/%e5%be%85%e3%81%a1%e7%84%a6%e3%81%8c%e3%82%8c%e3%81%9f%e3%83%86%e3%83%bc%e3%83%9e%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%80%8eshiword%e3%80%8f%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9%ef%bc%81/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.gdgd.ebiplan.com/2011/02/%e5%be%85%e3%81%a1%e7%84%a6%e3%81%8c%e3%82%8c%e3%81%9f%e3%83%86%e3%83%bc%e3%83%9e%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%80%8eshiword%e3%80%8f%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9%ef%bc%81/" />
	</item>
	</channel>
</rss>

