<?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/"
	>

<channel>
	<title>半月記 &#187; Mako</title>
	<atom:link href="http://pasero.net/~mako/blog/s/author/mn/feed" rel="self" type="application/rss+xml" />
	<link>http://pasero.net/~mako/blog</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 15:25:41 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress に記述できるプロトコル(スキーム)を拡張する</title>
		<link>http://pasero.net/~mako/blog/s/355</link>
		<comments>http://pasero.net/~mako/blog/s/355#comments</comments>
		<pubDate>Tue, 07 Feb 2012 15:25:41 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[XMPP]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=355</guid>
		<description><![CDATA[WordPress の記事の中などでリンクを記述する場合、特定のスキームしか書くことができません。たとえば http:// や mailto: は書くことができますが、git:// や skype: などと書こうとしても &#8230; <a href="http://pasero.net/~mako/blog/s/355">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress の記事の中などでリンクを記述する場合、特定のスキームしか書くことができません。たとえば <code>http://</code> や <code>mailto:</code> は書くことができますが、<code>git://</code> や <code>skype:</code> などと書こうとしても、自動的に削除され、<code>http://</code> とみなされてしまいます (管理者権限で記事を書いている場合は適用されず、自由に書くことができます。権限が編集者以下の場合です)。</p>
<p>調べてみると、WordPress 3.3 からこの制限は <code>wp-includes/functions.php</code> の <code>wp_allowed_protocols()</code> に書かれています。そこを見てみると、スキーム名を追加するには <code>kses_allowed_protocols</code> というフックを使えばよさそうです。</p>
<p>いま <code>xmpp:</code> というスキームのリンクを記述したいので、テーマの <code>functions.php</code> あたりに</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-2">
<div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> ext_protocols <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$protocols</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0000ff;">$protocols</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'xmpp'</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$protocols</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">add_filter<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'kses_allowed_protocols'</span>, <span style="color: #ff0000;">'ext_protocols'</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></div>
</div></div><br />
<p>と書きました。これで記事中に<a href="xmpp:mako@pasero.net" >xmpp:mako@pasero.net</a> や <a href="xmpp:なんでも談話室@muc.step.im?join" >xmpp:なんでも談話室@muc.step.im?join</a> などのリンクを記述できるようになりました。</p>]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/355/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>カタカナ表記について&#8212;マイクロソフト スタイルガイド</title>
		<link>http://pasero.net/~mako/blog/s/352</link>
		<comments>http://pasero.net/~mako/blog/s/352#comments</comments>
		<pubDate>Sun, 22 Jan 2012 05:20:22 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[ことば]]></category>
		<category><![CDATA[日本語]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=352</guid>
		<description><![CDATA[参考資料として。マイクロソフトスタイルガイド 手軽に参照しにくいので、ここに要点のみをメモ。 次の場合の「か」はひらがな書きとする。カタカナは使わない。 例:「3 か月」 (「3 ケ月」「3 ヶ月」「3 カ月」「3 ヵ月 &#8230; <a href="http://pasero.net/~mako/blog/s/352">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>
参考資料として。<a href="http://www.microsoft.com/Language/ja-jp/StyleGuides.aspx" >マイクロソフトスタイルガイド</a>
</p>
<p>
手軽に参照しにくいので、ここに要点のみをメモ。
</p>
<dl>
  <dt>次の場合の「か」はひらがな書きとする。カタカナは使わない。</dt>
  <dd>例:「3 か月」 (「3 ケ月」「3 ヶ月」「3 カ月」「3 ヵ月」としない)</dd>
  <dt>次の場合の「こ」は漢字とする。カタカナは使わない。</dt>
  <dd>例:「5個」 (「5 ケ」「5 コ」としない)</dd>
</dl>
<h4>長音符号</h4>
<dl>
  <dt>まず規準は、<a href="http://www.bunka.go.jp/kokugo_nihongo/joho/kijun/naikaku/gairai/index.html" >平成3年6月28日 内閣告示第2号「外来語の表記」</a></dt>
  <dd>英語の末尾が -er, -or, -ar のとき、長音符号を付ける</dd>
  <dt>英語の末尾が上記以外(すなわち、-y も)の場合、</dt>
  <dd>カタカナが4字より短い場合(促音「ッ」は1と数える。拗音は数えない)、長音符号を付ける
	<ul>
	  <li>例:「キー」「メニュー」は付ける。「メモリ」「プロシージャ」は付けない</li>
	  <li>英語が接頭語+語幹の場合、語幹で考える。例:「プレ+ビュー」「サブ+ツリー」「インター+フェイス」</li>
	  <li>上記の例外は一覧表を参照</li>
	</ul></dd>
</dl>        

     
        
    
        
            
            
            
]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/352/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>フォントの指定をやめる</title>
		<link>http://pasero.net/~mako/blog/s/348</link>
		<comments>http://pasero.net/~mako/blog/s/348#comments</comments>
		<pubDate>Sun, 18 Dec 2011 13:29:34 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[フォント]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=348</guid>
		<description><![CDATA[久々に Windows を使う機会があって、この自分のページを見てみた。見難い。醜い。明朝体の表示がこうも汚いのは何かの陰謀だろうかと思えるほどだ。WordPress のテーマのカスタマイズの記事などで「まずゴシック系を &#8230; <a href="http://pasero.net/~mako/blog/s/348">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>久々に Windows を使う機会があって、この自分のページを見てみた。見難い。醜い。明朝体の表示がこうも汚いのは何かの陰謀だろうかと思えるほどだ。WordPress のテーマのカスタマイズの記事などで「まずゴシック系を指定して」という記述をよく目にするのはこういう訳だったのかと今更ながら思った。</p>
<p>身の周りにある本らしい本を見てみれば、見出はともかく、本文はたいてい明朝 (serif) 系ではないか、という信念で、この自分のページは明朝 (serif) 系で表示するようにしていたのだが、こんな表示では逆効果なのであった。Windows の設定をいろいろいじればもう少し何とかなるのかもしれないが、普段からしっかり使いこなしている訳でもないから、簡単にできることではなさそうだ。きっと大多数のユーザーもそんなものだろう。</p>
<p>さて、ではなるべく多くの人にきれいに見せるにはページの制作側では <abbr>CSS</abbr> での <var>font-family</var> をどう設定したものか、と考え始めた。いろいろ探しまわって考えているうちに、もうそういうのはやめて見る側にまかせてしまえばいいや、という気になってきた。</p>
<blockquote>
Vista以降の人は見慣れたメイリオで。<br />
XP以前の人は見慣れたMSPゴシックで。<br />
メイリオが気に入った人は、メイリオで。<br />
Macの人はヒラギノ角ゴで。<br />
明朝が好きな人は、明朝で。<br />
へた字とか好きでたまらない特殊なフォントで。<br />
<address style="text-align:right">(<a href="http://cunm-oki.way-nifty.com/blog/2010/04/font-family-41b.html" >流儀　font-familyは指定すべきか</a>)</address>
</blockquote>
<p>WordPress 関連のページを見る機会が多くデザインを重視する記事をたくさん見ていたのですっかり忘れていたけれど、そもそも <abbr>HTML</abbr> というのは、見る側の環境によって違って当たり前なのだった。</p>
<p>「本文は明朝系」という信念の人(私だ)はブラウザのデフォルトを serif に設定しているだろうし、Windows でも自分の好みの表示になるようにがっちり設定している人には、そのフォントで読めるようにしてあげればいいではないか。</p>
<p>という訳で、このページの本文の <var>font-family</var> の指定はやめることにした<sup><a href="#footnote-1-348" id="footnote-link-1-348" title="See the footnote.">1</a>)</sup>。フォントに限らず横幅も何も、本来は見る側の自由なのだという気にだんだんなってきた。</p>
<br /><ol class="footnotes"><li id="footnote-1-348">このページは <a href="http://wordpress.org/extend/themes/coraline/" >coraline</a> というテーマの子テーマで表示している。親テーマで <var>font-family</var> が指定されているので、子テーマでこれを消去はできず、そこで存在しないであろうフォント名を指定して上書きしている。<pre>
body, input, textarea {
        font-family: undefined;
}
</pre>  <a href="#footnote-link-1-348">&#8617;</a></li></ol>]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/348/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>どうしよう日本語入力システム (その2)</title>
		<link>http://pasero.net/~mako/blog/s/345</link>
		<comments>http://pasero.net/~mako/blog/s/345#comments</comments>
		<pubDate>Sun, 18 Sep 2011 05:14:42 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[Wnn]]></category>
		<category><![CDATA[日本語]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=345</guid>
		<description><![CDATA[昔の話をするようになったら歳をとった証拠だ。が、いきがかり上、しばらく昔の話を書いてみよう。 日本語入力システム自分史 UNIX 期 Wnn を使い始めたのは学生だった 1991年頃だ。その前には NEC の PC98  &#8230; <a href="http://pasero.net/~mako/blog/s/345">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>昔の話をするようになったら歳をとった証拠だ。が、いきがかり上、しばらく昔の話を書いてみよう。</p>
<h3>日本語入力システム自分史</h3>
<h4>UNIX 期</h4>
<p>Wnn を使い始めたのは学生だった 1991年頃だ。その前には NEC の PC98 で少しのあいだ ATOK を使っていた。確か「一太郎 Ver.3」だったから、いま調べてみると ATOK6 か ATOK7 だったことになる。</p>
<p>そこに Sun SPARCstation 2 というワークステーションが研究室にやってきて、X Window system で日本語を入力するのに Wnn を使い始めた。確か X11R4 や R5 だったので、これもいま調べてみると、それらに標準添付されていた <a href="http://www.omronsoft.co.jp/SP/mobile/history.html" >Wnn 4.1 や Wnn 4.2</a> を使っていたことになる。その頃にあった別の日本語入力システムの Canna や Sj3 は使ったというより試してみた程度だった。</p>
<p>その後使った HP のワークステーションの HP-UX に VJE だか ATOK だかが付属していたと思うが、このワークステーションはほとんどリモートで使っていたので、日本語入力システムに触れることは滅多になかった (もう当時のバージョンがいくつだかも忘れてしまった)。</p>
<p>Wnn 4.2 の頃はいろいろと情報が出回っていて、辞書を追加したりパラメータを調整することで、標準の状態よりかなり変換精度を上げることができた。</p>
<p>世間で Windows 3.1 や Windows 95 が大流行している頃、私は Sun SPARCclassic を独占してデスクトップで使えるという環境にあったため、その時期を Windows と無縁で過ごした。その後ノート型を含め、いわゆる PC/AT 互換機も使うようになった頃には既に Linux が入手できたため、そこでも Windows を使わずにすんだ。そんな職場を離れたあとも今日に至るまで、トータルで 20 年以上もコンピュータを毎日使っていながら Windows も Mac も常用したことがないという、たぶんかなり珍しい部類の人となった。</p>

<h4>Linux-Wnn 期</h4>
<p>1997 年、<a href="http://www.omronsoft.co.jp/press/wolfv2.html" >Wnn 6 for Linux/BSD</a> が発売されるとすぐに購入した。UNIX 版はその前に出ていたが普通に買える価格ではなかったし、その頃には Sun SPARCclassic は既にサーバーとして裏にまわり、Debian をインストールした PC をデスクトップで使っていた。</p>
<p>Wnn 6 は、それまでのバージョンがフリーソフトだったのに対し、商用ソフトであった。「<a href="http://www.tomo.gr.jp/wnn/wnn.html" >Ｗｎｎについての基礎知識</a>」のページの中ほど、「＊Wnn6 で強化された機能とは」の項にあるように、20万語のシステム辞書、「フレキシブル・インテリジェンス(Flexible Intelligence)機能」により、変換精度は格段によくなった。</p>
<p>2001年、<a href="http://www.omronsoft.co.jp/SP/pcunix/wnn7/" >Wnn 7 for Linux/BSD</a> が発売になり、これもすぐに購入した。</p>

<h4>ATOK 期</h4>
<p>2005年に <a href="http://www.omronsoft.co.jp/SP/pcunix/wnn8/" >Wnn 8 </a>が発売になった際には、Wnn 7 で十分満足していたので購入を見送った。UTF-8 への対応というのが大きな変化だったが、その頃はまだ EUC-JP で使い続けていたので、その必要性も感じなかったのだ。その後 2009年に、別の会社から、その時点の ubuntu に対応したという<a href="http://www.mssolution.co.jp/html/news/n090323.html" > Wnn8 for ubuntu </a> というものが発売されたが、ほぼ1年で販売を止めてしまったようだ。</p>
<p>これらを購入しなかったことを後悔する時がやってきた。2010年頃には、(1) OS のライブラリが新しくなり、依存関係を改変しないとインストールもできなくなってきた。いつか本当に起動しなくなるかもしれない。(2) 最近は UTF-8 でしか動かないアプリケーションがいくつか出てきたが、Wnn 7 (xwnmo) は locale を EUC-JP にしなければならないため、日本語を入力できない。(3) 開発元の情報を見ても、この先、新しいバージョンが出る気配がない。という状況になってしまった。</p>
<p>OSS の Anthy を試してみたものの、あまりの使い勝手の悪さに 1週間ほどで嫌になってしまった。</p>
<p>そこで思い切って <a href="http://www.justsystems.com/jp/products/atok_linux/" >ATOK X3</a> を購入することにした。ATOK X3 は 2007年の製品で、既に時代遅れぎみだが、こちらも次がいつ出るのか(そもそも次はあるのか)見えないので、思い切ることにした。</p>
<p>ATOK X3 が悪いとは言わないが、何しろこちらが Wnn に慣れきっているため、不満に思ってしまう点はいくつかあった。</p>
<p>変換精度が思ったほど高くないと感じるのは、長いあいだ学習させてきた Wnn7 と比較しているからだろうか。それを割り引いても 2001年の製品である Wnn7 のほうが「賢い」ように感じられた。</p>
<p>それに、異体字(いわゆる旧字)を簡単に出せない。Windows 用の新しい ATOK には異体字変換があるようだが、Linux 版 の ATOK X3 にはその機能がない。Wnn7 には標準で「異形字変換辞書」を持っており、いったん仮名から漢字に変換したあと(たとえば「けいざい」→「経済」)、漢字から異形字(「経」→「經」、「済」→「濟」)に変換する、単漢字変換の一種ともいえる機能があった。とりあえず「<a href="http://www.geocities.co.jp/CollegeLife-Library/1959/Data/index.html" >正字正假名辭書</a>」を追加してしのぐことにしたが、これは単語レベルの辞書なので、登録されていない単語(人名など)で旧字を出したいときにはやはり苦労する。</p>
<p><a href="http://memo.officebrook.net/20071210.html#p02" >発売直後から指摘されている不具合</a>が未だ放置されているなど、開発元のやる気のなさも心配だったのだが、<a href="http://pasero.net/~mako/blog/s/336" >前の記事</a>にも書いたように、たった1年ほどで終わりの時が近づいてきたようだ。</p>
<br />
<p>結局、20年ほどの日本語入力システム自分史を振り返ってみると、最近1年の ATOK X3 を除いて、なんと19年が Wnn (そのうち10年ほどが Wnn7) というものであった。</p>
<p>この項さらに続く(たぶん)。</p>]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/345/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress で Google マップを使う (再挑戦)</title>
		<link>http://pasero.net/~mako/blog/s/342</link>
		<comments>http://pasero.net/~mako/blog/s/342#comments</comments>
		<pubDate>Sat, 17 Sep 2011 14:48:22 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=342</guid>
		<description><![CDATA[以前に「Google マップを使う」を書きましたが、その後 WordPress も Google マップもずいぶん進化して、時代遅れになってしまいました。 意図してる使い方は次のようなものです。 固定ページに位置情報を持 &#8230; <a href="http://pasero.net/~mako/blog/s/342">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>以前に「<a href="http://pasero.net/~mako/blog/s/35" >Google マップを使う</a>」を書きましたが、その後 WordPress も <a href="http://maps.google.co.jp/" >Google マップ</a>もずいぶん進化して、時代遅れになってしまいました。</p>
<p>意図してる使い方は次のようなものです。</p>
<ul>
  <li>固定ページに位置情報を持たせる。その固定ページにマップが表示される</li>
  <li>それらのインデックスとなるような、上記の各ページにリンクされたマークが表示された全体図が、別の固定ページがある</li>
</ul>
<p>たとえば、会社案内のサイトで各支店ごとに固定ページを作り、それぞれに案内地図を掲載し、「支店一覧」の全体図が別にもうひとつある、というイメージです。<a href="http://wppluginsj.sourceforge.jp/lightweight-google-maps/" >Lightweight Google Maps</a> はほぼ条件を満たしていますが、その便利な機能がこちらの思惑には合いませんでした。</p>
<p>ざっと探してみましたが、「固定ページに位置情報」というものはなかなかありません。そこで、固定ページではなく投稿に、というプラグイン <a href="http://wordpress.org/extend/plugins/romeluv-google-maps-for-wordpress/" >RomeLuv Google Maps for WordPress</a> を見つけたので、それを改変することにしました。</p>

<h3>RomeLuv Google Maps for WordPress を改変</h3>
<div class="igBar"><span id="ldiff-6"><a href="#" onclick="javascript:showPlainTxt('diff-6'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">DIFF:</span><br /><div id="diff-6">
<div class="diff" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #888822;">--- romeluv-maps.php.orig</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #888822;">+++ romeluv-maps.php</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #440088;">@@ <span style="color:#800000;">-51</span>,<span style="color:#800000;">6</span> <span style="color:#800000;">+51</span>,<span style="color:#800000;">12</span> @@</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'romeluv_maps_inner_custom_box',</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'post' </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; add_meta_box<span style="">&#40;</span> </span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; 'romeluv_maps_sectionid',</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; __<span style="">&#40;</span> 'Maps', 'romeluv_maps_textdomain' <span style="">&#41;</span>,</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; 'romeluv_maps_inner_custom_box',</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; 'page' </span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; <span style="">&#41;</span>;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #440088;">@@ <span style="color:#800000;">-361</span>,<span style="color:#800000;">6</span> <span style="color:#800000;">+367</span>,<span style="color:#800000;">7</span> @@</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;add_action<span style="">&#40;</span>'save_post', 'romeluv_maps_handle_savepost'<span style="">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+add_action<span style="">&#40;</span>'save_page', 'romeluv_maps_handle_savepost'<span style="">&#41;</span>;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #440088;">@@ <span style="color:#800000;">-385</span>,<span style="color:#800000;">7</span> <span style="color:#800000;">+392</span>,<span style="color:#800000;">7</span> @@</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>$romeluv_single_map_done<span style="">&#41;</span> return $post_content_html; else $romeluv_single_map_done=TRUE;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #991111;">-&nbsp; &nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>!is_single<span style="">&#40;</span><span style="">&#41;</span><span style="">&#41;</span> return $post_content_html;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>!is_single<span style="">&#40;</span><span style="">&#41;</span> &amp;&amp; !is_page<span style="">&#40;</span><span style="">&#41;</span><span style="">&#41;</span> return $post_content_html;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//return &quot;&quot;.$post_content_html;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; global $wpdb,$post,$mapheight;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $savepost=$post;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #440088;">@@ <span style="color:#800000;">-552</span>,<span style="color:#800000;">13</span> <span style="color:#800000;">+559</span>,<span style="color:#800000;">25</span> @@</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;global $wpdb,$post;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;$savepost=$post;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; extract<span style="">&#40;</span> shortcode_atts<span style="">&#40;</span> array<span style="">&#40;</span></span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'cat' =&gt; '', // category ID</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp;<span style="">&#41;</span>, $atts <span style="">&#41;</span> <span style="">&#41;</span>;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>esc_attr<span style="">&#40;</span>$cat<span style="">&#41;</span> == ''<span style="">&#41;</span> <span style="">&#123;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>isset<span style="">&#40;</span>$_GET<span style="">&#91;</span>cat<span style="">&#93;</span><span style="">&#41;</span><span style="">&#41;</span> $get_cat = $_GET<span style="">&#91;</span>cat<span style="">&#93;</span>;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp;<span style="">&#125;</span> else <span style="">&#123;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$get_cat = esc_attr<span style="">&#40;</span>$cat<span style="">&#41;</span>;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp;<span style="">&#125;</span>;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;////query all the posts to display on the global map</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; $querystr = &quot;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; SELECT wposts.* </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; FROM $wpdb-&gt;posts wposts </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; WHERE&nbsp; wposts.post_status = 'publish' </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #991111;">-&nbsp; &nbsp; &nbsp; &nbsp;AND wposts.post_type = 'post' &quot;. $whereadditional .&quot;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp;AND <span style="">&#40;</span>wposts.post_type = 'post' OR wposts.post_type = 'page'<span style="">&#41;</span> &quot;. $whereadditional .&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ORDER BY wposts.post_date DESC</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;&quot;;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;//echo $querystr; //useful for debugging your custom query</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #440088;">@@ <span style="color:#800000;">-571</span>,<span style="color:#800000;">9</span> <span style="color:#800000;">+590</span>,<span style="color:#800000;">7</span> @@</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>$result_posts<span style="">&#41;</span>:</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #991111;">-&nbsp; &nbsp; if <span style="">&#40;</span>isset<span style="">&#40;</span>$_GET<span style="">&#91;</span>cat<span style="">&#93;</span><span style="">&#41;</span><span style="">&#41;</span>&nbsp; echo '&lt;h3 id=&quot;map-category-heading&quot;&gt;'.get_cat_name<span style="">&#40;</span>$_GET<span style="">&#91;</span>cat<span style="">&#93;</span><span style="">&#41;</span>.'&lt;/h3&gt;';</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #991111;">-&nbsp; &nbsp; </span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #991111;">-&nbsp; &nbsp; </span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; if <span style="">&#40;</span>isset<span style="">&#40;</span>$get_cat<span style="">&#41;</span><span style="">&#41;</span>&nbsp; echo '&lt;h3 id=&quot;map-category-heading&quot;&gt;'.get_cat_name<span style="">&#40;</span>$get_cat<span style="">&#41;</span>.'&lt;/h3&gt;';</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;$mapwidth=get_option<span style="">&#40;</span>'global_romeluv_mapwidth'<span style="">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;$mapheight=get_option<span style="">&#40;</span>'global_romeluv_mapheight'<span style="">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #440088;">@@ <span style="color:#800000;">-614</span>,<span style="color:#800000;">7</span> <span style="color:#800000;">+631</span>,<span style="color:#800000;">7</span> @@</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $count++;&nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #991111;">-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>isset<span style="">&#40;</span>$_GET<span style="">&#91;</span>cat<span style="">&#93;</span><span style="">&#41;</span><span style="">&#41;</span> if <span style="">&#40;</span>!in_category<span style="">&#40;</span>$_GET<span style="">&#91;</span>cat<span style="">&#93;</span>,$post-&gt;ID<span style="">&#41;</span><span style="">&#41;</span> continue; //this allows category filtering adding the $_GET parameter ?cat=xx</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00b000;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if <span style="">&#40;</span>isset<span style="">&#40;</span>$get_cat<span style="">&#41;</span><span style="">&#41;</span> if <span style="">&#40;</span>!in_category<span style="">&#40;</span>$get_cat,$post-&gt;ID<span style="">&#41;</span><span style="">&#41;</span> continue; //this allows category filtering adding the $_GET parameter ?cat=xx</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if <span style="">&#40;</span>is_category<span style="">&#40;</span><span style="">&#41;</span><span style="">&#41;</span> <span style="">&#123;</span> if <span style="">&#40;</span>!in_category<span style="">&#40;</span>$cat_ID,$post-&gt;ID<span style="">&#41;</span><span style="">&#41;</span> continue;&nbsp; <span style="">&#125;</span>&nbsp; &nbsp;//skip posts if viewing a category page, if those do not match the current category</div></li></ol></div>
</div></div><br />
<p>改変の内容は、</p>
<ul>
  <li>固定ページの作成画面にも「Maps」の入力欄を表示する</li>
  <li>全体図の出力の際に固定ページも対象にする</li>
  <li>全体図を出力するショートコード <code>&#91;GLOBALMAP]</code> に、オプション<code>cat</code> を追加する</li>
</ul>
<p>です。この最後の項目は次のような事情です。</p>
<p><a href="http://www.romeluv.com/maps-plugin-testrun/global-map-example/" >このプラグインのオリジナル版では、全体図を表示させるには</a>、固定ページでショートコード <code>&#91;GLOBALMAP]</code> を用います。特定のカテゴリーに属する投稿だけを全体図に表示するという絞り込みができます。その方法は、カテゴリーの ID をパラメータで付加して、http://www.example.com/map?cat=6 のような形で、全体図のページを呼ぶようにします。</p>
<p>しかし、WordPress 標準のメニュー機能でこのような形式のリンクを作る方法が思い浮かびません。そこで、むしろ複数の全体図のページを用意することにして(たとえば http://www.example.com/map1 と http://www.example.com/map6)、それぞれのページでのショートコードにオプションでカテゴリー ID を付けるようにしました(たとえば <code>&#91;GLOBALMAP cat="1"]</code> と <code>&#91;GLOBALMAP cat="6"]</code>)</p>
<p>さて、ここでは固定ページに位置情報を付加して、全体図を作ることを想定しています。すると固定ページにもカテゴリーが設定されていないと、上記の絞り込みができません。テーマの functions.php か何かで</p>
<div class="igBar"><span id="lphp-7"><a href="#" onclick="javascript:showPlainTxt('php-7'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-7">
<div class="php" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">function</span> add_category_to_page<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; register_taxonomy_for_object_type<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'category'</span>, <span style="color: #ff0000;">'page'</span><span style="color: #66cc66;">&#41;</span>; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">add_action<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'init'</span>, <span style="color: #ff0000;">'add_category_to_page'</span><span style="color: #66cc66;">&#41;</span>;</div></li></ol></div>
</div></div><br />
<p>とやって、固定ページにもカテゴリーを設定できるようにしておく必要があります。</p>

<h3>twentyeleven で Google マップが壊れる</h3>
<p>実際に使用してみると、表示される地図が微妙に壊れていました。タイルの継ぎ目が合わずに道や川がずれているような感じになります。はじめ、自分が使っているブラウザか何かの環境のせいかと思って、いろいろ調べましたがわかりません。ようやく、テーマ twentyeleven にすると壊れて、twentyten にすると正常に表示されることに気がつきました。それから今度は twentyeleven のスタイルシートのどの記述が影響しているのか順に見ていき、ついに <code>img</code> に <code>max-width</code> が付いているとこの現象が起こることがわかりました。これだけで随分と時間を費やしました。</p>
<p>このプラグインの影響下の <code>img</code> のみ <code>max-width</code> を解除するため、</p>
<div class="igBar"><span id="lcss-8"><a href="#" onclick="javascript:showPlainTxt('css-8'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">CSS:</span><br /><div id="css-8">
<div class="css" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">div<span style="color: #cc00cc;">#romeluv-global-map</span> img,</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">div<span style="color: #cc00cc;">#single-post-map</span> img <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">max-width</span>: <span style="color: #993333;">none</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></div>
</div></div><br />
<p>をスタイルシートに書いて、解決しました。</p>
]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/342/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox での印刷時の背景色</title>
		<link>http://pasero.net/~mako/blog/s/337</link>
		<comments>http://pasero.net/~mako/blog/s/337#comments</comments>
		<pubDate>Sat, 27 Aug 2011 04:19:19 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=337</guid>
		<description><![CDATA[Firefox (Iceweasel) で、背景色を白以外(薄い灰色)に指定して使用している。プリンタへの印刷の際には「背景色を印刷しない」設定ができる。そのはずなのだが、しばらく前からこれが印刷されるようになってしまっ &#8230; <a href="http://pasero.net/~mako/blog/s/337">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Firefox (Iceweasel) で、背景色を白以外(薄い灰色)に指定して使用している。プリンタへの印刷の際には「背景色を印刷しない」設定ができる。そのはずなのだが、しばらく前からこれが印刷されるようになってしまっていた。</p>
<p>検索してみて、<a href="http://forum.mozilla.gr.jp/cbbs.cgi?mode=al2&#038;namber=54729" >もじら組フォーラム</a>から <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=652914" >Bug 652914</a> という情報にたどり着いた。いまだ解決されていないようだ。背景色を白以外に設定していて、かつ、プリンタに印刷することのある人というのはかなり少数なのだろうか。</p>
<p>自分の userContent.css に</p>
<pre>
@media print {
        * {background-color: white;}
}
</pre>
<p>と書いたら、とりあえず背景色は印刷されなくなった。この程度で回避できるくらいなら、すぐにも修正されそうな気もするのだが。</p>
]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/337/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>どうしよう日本語入力システム (その1)</title>
		<link>http://pasero.net/~mako/blog/s/336</link>
		<comments>http://pasero.net/~mako/blog/s/336#comments</comments>
		<pubDate>Thu, 04 Aug 2011 05:16:58 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[Wnn]]></category>
		<category><![CDATA[日本語]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=336</guid>
		<description><![CDATA[Debian sid (i386) で、libgtk2.0-0 を 2.24.5-4 にアップデートしたら日本語入力システム ATOK X3 が使えなくなってしまった。2.24.4-3 に戻せば使える。そのあいだのバージ &#8230; <a href="http://pasero.net/~mako/blog/s/336">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Debian sid (i386) で、<a href="http://packages.qa.debian.org/g/gtk+2.0.html" >libgtk2.0-0</a> を 2.24.5-4 にアップデートしたら日本語入力システム <a href="http://www.justsystems.com/jp/products/atok_linux/" >ATOK X3</a> が使えなくなってしまった。2.24.4-3 に戻せば使える。そのあいだのバージョンではどうだかわからないが、いずれにせよ、ほかのアプリケーションとの兼ね合いで libgtk をそのままにしておくわけにもいかないだろうから、ごまかしておけるのも時間の問題だ。</p>
<p>そもそも、それまでずっと使っていた日本語入力システム <a href="http://www.omronsoft.co.jp/SP/pcunix/wnn7/index.html" >Wnn7</a> が、やはりライブラリ (や、日本語文字コード) の問題でうまく動かせなくなり、その代わりにしかたなく ATOK X3 を使い始めたのだった。今度もまた本質的ではないと思われるライブラリの問題で使えなくなるとは非常に残念である。このへんが頻繁にバージョンアップのあるオープンソースと、どうしても対応が緩慢 (この場合、緩慢どころかもう停止してるのだろう) になる商用ソフトの相性の悪いところだ。</p>
<h3>選択肢がない</h3>
<p>日本語を使う者にとって日本語入力システムは必要不可欠だ。ハードウェアがどうとか OS が何であるかよりもっと人間よりのところにあると言ってもいい。キーボードの<a href="http://www.pfu.fujitsu.com/hhkeyboard/" >Happy Hacking Keyboard</a> のページに、</p>
<blockquote>
<p>アメリカ西部のカウボーイたちは、馬が死ぬと馬はそこに残していくが、どんなに砂漠を歩こうとも、鞍は自分で担いで往く。馬は消耗品であり、鞍は自分の体に馴染んだインタフェースだからだ。</p>
<p> いまやパソコンは消耗品であり、キーボードは大切な、生涯使えるインタフェースであることを忘れてはいけない。</p>
<div style="text-align:right">［東京大学 和田英一 名誉教授の談話］</div>
</blockquote>
<p>という言葉が掲げられているが、この「キーボード」を「日本語入力システム」に置き換えても何ら違和感はない。</p>
<p>それにもかかわらず、Windows 環境下ですら現在では選択の幅がほとんどない。その原因は Windows にバンドルされている MS-IME の寡占につきると思う。しばらく前の Web ブラウザ Internet Explorer 寡占問題と同じだ。このときヨーロッパは <a href="http://itpro.nikkeibp.co.jp/article/NEWS/20090119/323003/" >「WindowsとIEの抱き合わせは競争法違反」と異議声明</a>を出した。日本でも MS-IME に対して異議を申し立てるべきだったのだ。それまで多くの日本語入力システムがあって切磋琢磨していたものが、ほとんど姿を消してしまった。</p>
<p>OS のシェアから考えて、Linux 版のみの商用日本語入力システムが開発されるわけもなく、Windows 市場で稼げなければ Linux 版は存在し得ない(もちろん MS-IME の Linux 版が出るわけもないし)。こうして Wnn も Linux 版の ATOK も消えていきつつあるのが現状だ。</p>
<br />
<p>長くなってきたので、<a href="http://pasero.net/~mako/blog/s/345">この項つづく</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/336/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 3.2.1 日本語版への更新</title>
		<link>http://pasero.net/~mako/blog/s/328</link>
		<comments>http://pasero.net/~mako/blog/s/328#comments</comments>
		<pubDate>Thu, 21 Jul 2011 03:11:51 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=328</guid>
		<description><![CDATA[WordPress 3.2.1 日本語版がリリースされました。この案内にもきちんと書かれていますが、読みようによっては誤解したり不安を感じたりする方もあるようですので、ここにやや詳しく書いてみます。 WordPress  &#8230; <a href="http://pasero.net/~mako/blog/s/328">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://ja.wordpress.org/2011/07/20/wordpress-3-2-1-ja/" >WordPress 3.2.1 日本語版</a>がリリースされました。この案内にもきちんと書かれていますが、読みようによっては誤解したり不安を感じたりする方もあるようですので、ここにやや詳しく書いてみます。<p>
<h3>WordPress 日本語版パッケージ</h3>
<p>配布されている<a href="http://ja.wordpress.org/releases/" >WordPress 日本語版パッケージ</a>に含まれているものは</p>
<dl>
  <dt>日本語リソース</dt>
  <dd>本体のメッセージを日本語に置き換えて表示するためのもの</dd>
  <dt>WordPress 本体</dt>
  <dd>日本語リソースでカバーできない変更のため、いくつかのファイルを差し替えている</dd>
</dl>
<p>のほかに、オマケとして</p>
<dl>
  <dt>テーマ Twenty Eleven</dt>
  <dd>日本語版ではこのテーマのメッセージを日本語に置き換える日本語リソースを同梱している</dd>
  <dt>テーマ Twenty Ten</dt>
  <dd>日本語版ではこのテーマのメッセージを日本語に置き換える日本語リソースを同梱している</dd>
  <dt>プラグイン Hello Dolly</dt>
  <dd>日本語版では、「プラグイン」の一覧で表示される説明文を翻訳している</dd>
  <dt>プラグイン Akismet</dt>
  <dd>日本語版では、「プラグイン」の一覧で表示される説明文を翻訳している</dd>
  <dt>プラグイン WP Multibyte Patch</dt>
  <dd>マルチバイト文字の取り扱いに関する不具合の累積的修正と強化を行うもので、日本語版で独自に同梱しているもの</dd>
</dl>
<p>です。</p>

<h3>はじめてのインストールは問題ない</h3>
<p>これまで WordPress を使用していなかったところに、はじめて導入する場合は、何も考えることはありません。<a href="http://ja.wordpress.org/latest-ja.zip" >最新版</a>をダウンロードしてインストールしてください。</p>

<h3>自動更新</h3>
<p>WordPress 日本語版の新しいバージョンがリリースされると、WordPress の管理画面(ダッシュボード)で、その旨の通知があります。案内に従って手順をすすめれば、新しいバージョンに更新されます。従来(3.2まで)は、この手順でパッケージに含まれるすべて、つまり上述の本体とオマケのすべてがパッケージ内のものに更新されていました。</p>

<h4>オマケは更新されなくなった</h4>
<p>3.2.1 以降、自動更新では、<strong>本体のみ</strong>が更新され、<strong>オマケの部分は自動更新されない</strong>ことになりました。たとえばテーマ Twenty Eleven のバージョンは、WordPress 3.2 日本語版では 1.1 で、WordPress 3.2.1 日本語版では 1.2 です。もし 3.2 日本語版で運用しているところで、本体の自動更新を行っても Twenty Eleven は 1.1 のままです。</p>
<p>もし、これらのオマケをまったく利用していなければ、以下の話は読み飛ばしてもかまいません。</p>

<h3>テーマやプラグインは別途に</h3>
<p>オマケのテーマやプラグインに、もし新しいバージョンがリリースされた場合、本体の更新とは別に、個別に「更新」の通知があります。後から独自に導入したテーマやプラグインとまったく同等の扱いになるということです。</p>
<p>オマケのテーマやプラグインであっても、本体のリリースとは無関係に新しいバージョンがリリースされることがあります。</p>

<h4>日本語リソースはさらに別途に</h4>
<p>テーマやプラグインは、本体とまったく別途に更新できます。しかし、ここで注意することがあります。従来のように本体のオマケとして配布されていたときには、それらの日本語リソースや説明文を翻訳していたものを配布できていました。しかし今後、個別に更新される際には、それらの含まれないオリジナル(英語版)になってしまうのです。</p>
<p>テーマ Twenty Eleven を例にとります。「更新」の通知があったら、まずこの Twenty Eleven を更新します。その状態では日本語リソースは存在しません (1.1 のときに存在していても 1.2 に更新したら消えてしまいます)。そこで、日本語リソースを別途入手して、適切に配置します。現時点での最新の日本語リソースは <a href="http://i18n.svn.wordpress.org/ja/branches/3.2/messages/twentyeleven/ja.mo" >http://i18n.svn.wordpress.org/ja/branches/3.2/messages/twentyeleven/ja.mo</a> です (この記事をずっと後にご覧になる方はバージョンやテーマ名にご注意ください)。これをダウンロードして、wp-content/themes/twentyeleven/languages/ の下に置き、サーバーが読める状態にしておきます。</p>
<p>同様に、テーマ Twenty Ten の日本語リソースは<a href="http://i18n.svn.wordpress.org/ja/branches/3.2/messages/twentyten/ja.mo" >http://i18n.svn.wordpress.org/ja/branches/3.2/messages/twentyten/ja.mo</a> にあります。</p>
<p>プラグイン Akismet や Hello Dolly をもし更新した場合は、「プラグイン」一覧に表示される説明文が日本語ではなく英語になってしまいますが、動作には何ら影響はありません (この説明文はそれぞれの php の冒頭にコメントの形で書かれているものです)。どうしても気になる場合は、やはり日本語版の配布元 (<a href="http://i18n.svn.wordpress.org/ja/branches/3.2/dist/wp-content/plugins/" >http://i18n.svn.wordpress.org/ja/branches/3.2/dist/wp-content/plugins/</a> あたりにあります) から、その部分を差し替えたものを入手して、適切に配置してください</p>

<h3>WP Multibyte Patch</h3>
<p><a href="http://eastcoder.com/code/wp-multibyte-patch/" >WP Multibyte Patch</a> は新しい<a href="http://eastcoder.com/2011/07/wp-multibyte-patch-1-5/" >バージョン 1.5</a> で、この自動更新の振る舞いの変更に対応されました。</p>
<blockquote>
<p>WP Multibyte Patch 1.5 をリリースしました。<br />
今回は<strong>重要な変更</strong>があります。設定ファイル (wpmp-config.php) の設置場所が <code>/wp-content</code> の下に変わりました。設定ファイルをサイトでご利用中の方は、以下配置で再設定を行ってください。</p>
<p><code>/wp-content/wpmp-config.php</code></p>
<p>この作業は設定ファイルをご利用中のサイトにおいて 1.5 より古いバージョンから 1.5 以降のバージョンにはじめてアップデートした場合に1度だけ必要となります。設定ファイルをご利用でない場合は作業の必要はありません。</p>
</blockquote>
<p>ということですから、注意してください。</p>
]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/328/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>公開 Jabber/XMPP サーバー</title>
		<link>http://pasero.net/~mako/blog/s/320</link>
		<comments>http://pasero.net/~mako/blog/s/320#comments</comments>
		<pubDate>Tue, 05 Jul 2011 02:57:35 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[Jabber]]></category>
		<category><![CDATA[XMPP]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=320</guid>
		<description><![CDATA[半年ほど前から、Jabber/XMPP サーバー STEP.imを公開しています。 Jabber/XMPP については、しばらく前に記事にしました。Jabber/XMPP をはじめるには、アカウント (JID) が必要で &#8230; <a href="http://pasero.net/~mako/blog/s/320">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>半年ほど前から、Jabber/XMPP サーバー <a href="http://step.im/" >STEP.im</a>を公開しています。</p>
<p><a href="http://pasero.net/~mako/blog/s/168" >Jabber/XMPP については、しばらく前に記事にしました</a>。Jabber/XMPP をはじめるには、アカウント (JID) が必要です (ちょうどメールを使う際にメールアドレスが必要なように)。もし GMail のアカウントや WordPress.com のアカウントをお持ちであれば、それらを JID として使うことができます。これらのアカウントを持っていない、または使いたくない場合はこの <a href="http://step.im/" >STEP.im</a> でアカウントを作ることができます。</p>
<p>また、グループチャット（Multi-user chat, MUC) の談話室をこの <a href="http://step.im/" >STEP.im</a> に開設することができます (STEP.im のアカウントを持っていなくても開設・参加できます)。IRC によく似ていますが、後発なだけに、IRC の欠点を補って使い勝手のいいものです。</p>
<p>数年前から、自分のごく近傍で Jabber/XMPP を利用してきました。なかなか優れていると思うのですが、あまり話題になることがありません (Google トークや Facebook チャットなど、ユーザーに意識させないところで浸透しているようですが)。クライアント <a href="http://www.gajim.org/" >Gajim</a>の日本語訳、サーバー <a href="http://www.ejabberd.im/" >ejabberd</a> の日本語訳のお手伝いなども行ってきました。そしてとうとう公開サーバーを運用することにしたのです。</p>
<p>どうぞよろしくお願いいたします。</p>]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/320/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GNOME でのシャットダウンの禁止&#8212;最近の流儀</title>
		<link>http://pasero.net/~mako/blog/s/308</link>
		<comments>http://pasero.net/~mako/blog/s/308#comments</comments>
		<pubDate>Wed, 29 Jun 2011 02:37:24 +0000</pubDate>
		<dc:creator>Mako</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[gdm]]></category>
		<category><![CDATA[GNOME]]></category>

		<guid isPermaLink="false">http://pasero.net/~mako/blog/?p=308</guid>
		<description><![CDATA[検索で古い記事「gdm でのシャットダウンの禁止」にだどりつく方があるようなので、最近のやり方を書いておきます。 その記事にあるように、私にとってそもそもなぜこの設定をしたいのかというと、うっかりミスの防止です。ログイン &#8230; <a href="http://pasero.net/~mako/blog/s/308">続きを読む <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>検索で古い記事「<a href="http://pasero.net/~mako/blog/s/75" title="gdm でのシャットダウンの禁止">gdm でのシャットダウンの禁止</a>」にだどりつく方があるようなので、最近のやり方を書いておきます。</p>
<p>その記事にあるように、私にとってそもそもなぜこの設定をしたいのかというと、うっかりミスの防止です。ログイン後のメインメニューで、「ログアウト」と隣り合って「シャットダウン」の項目があり、単にログアウトするつもりがシャットダウンしてしまうことがあるのです。</p>
<p>最近の流儀では policykit で設定で行うようです。その方法は<a href="http://lists.debian.org/debian-user/2011/03/msg02101.html" >debian-user メーリングリスト</a>にあるとおりです。要点を簡単に記すと、
<ul>
  <li>/usr/share/polkit-1/actions/org.freedesktop.consolekit.policy を書き換えるという回答もあるが、このファイルはそもそも設定ファイルではないし、バージョンアップによって書き換えられる(元に戻ってしまう)ので、よろしくない。</li>
  <li>/etc/polkit-1/localauthority/50-local.d/ に適当な名前(ただし末尾を .pkla にする)のファイルを作り、その中に次のように書く。
<pre>
[consolekit]
Identity=unix-user:*
Action=org.freedesktop.consolekit.system.*
ResultAny=no
ResultInactive=no
ResultActive=no
[upower]
Identity=unix-user:*
Action=org.freedesktop.upower.*
ResultAny=no
ResultInactive=no
ResultActive=no
</pre>
</li>
</ul>
これで GNOME のメニューから「シャットダウン」の項目が消えます。</p>]]></content:encoded>
			<wfw:commentRss>http://pasero.net/~mako/blog/s/308/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

