<?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>Nakatta blog &#187; プラグイン</title>
	<atom:link href="http://blog.nakatta.net/archives/tag/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.nakatta.net</link>
	<description>日々の出来事をただ書き綴る</description>
	<lastBuildDate>Sun, 06 Jun 2010 13:55:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/tag/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3/feed" />
		<item>
		<title>Google Analyticsでモバイル解析</title>
		<link>http://blog.nakatta.net/archives/2009/02/google-analytics-mobile.html</link>
		<comments>http://blog.nakatta.net/archives/2009/02/google-analytics-mobile.html#comments</comments>
		<pubDate>Wed, 04 Feb 2009 03:58:01 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[WEB]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[ktai style]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://blog.nakatta.net/?p=1084</guid>
		<description><![CDATA[				アクセス解析は色々ありますが、高機能で人気なのがGoogle Analytics。Googleっていうネームバリューもしかり、使いやすくて自分も気に入ってます。でもJavaScriptを埋め込んで情報を送る仕組み [...]]]></description>
			<content:encoded><![CDATA[				<p>アクセス解析は色々ありますが、高機能で人気なのがGoogle Analytics。Googleっていうネームバリューもしかり、使いやすくて自分も気に入ってます。でもJavaScriptを埋め込んで情報を送る仕組みなため、携帯とかモバイル関連の解析ができないのが難点。</p>
				<p>そこでエクスブリッジからSELENE.GA4KというGoogle Analyticsを携帯サイトで利用するためのライブラリが登場しました。</p>
				<p>で、Wordpressのktai styleプラグイン利用環境に導入する手順の覚書です。</p>
				<p><span id="more-1084"></span></p>
				<h2>SELENE.GA4Kの設置</h2>
				<p>まず<a href="http://eos.exbridge.jp/projects/show/ga4k" target="_blank">こちら</a>からSELENE.GA4Kをダウンロードして解凍。</p>
				<p>Configフォルダ内のanalytics_config.phpファイルを修正。<br />
				21,22行目先頭のコメントアウトを消して有効にし、自分の環境に書き換える。</p>
				<pre name="code" class="php:firstLine[21]" style="margin:18px 0;">
define(&#039;ANALYTICS_ID&#039;,      &#039;XX-XXXXXXX-X&#039;);
define(&#039;WEBSITE_DOMAIN&#039;,    &#039;http://muda.info&#039;);
</pre>
				<p>Google Analyticsフォルダごとktai styleのテーマファイルのある場所にアップロード。<br />
				次にktai styleのテーマファイルheader.phpファイルを編集。<br />
				headタグの中あたりに以下のコードを追加。</p>
				<pre name="code" class="php" style="margin:18px 0;">
&lt;?php
require_once (dirname(__FILE__) . &#039;/../GoogleAnalytics/Config/analytics_config.php&#039;);
require_once (dirname(__FILE__) . &#039;/../GoogleAnalytics/Service/analytics.php&#039;);
sendGoogleAnalytics(ANALYTICS_ID, WEBSITE_DOMAIN);
?&gt;
</pre>
				<p>ちなみにフォルダ構成はこんな感じです。<br />
				wp-content/ktai-themes/GoogleAnalitics/Service/<br />
				wp-content/ktai-themes/GoogleAnalitics/Config/<br />
				wp-content/ktai-themes/muda.info/header.php</p>
				<p>パスはheader.phpファイルからの相対パスで。<br />
				dirname(__FILE__)は後ろに/付かないので入れ忘れないように注意。</p>
				<p>一応これだけで解析そのものはできるようになります。</p>
				<h2>記事タイトルの解析</h2>
				<p>このままだと記事のタイトルが記録されず、すべてハイフンになるので使いづらいです。<br />
				なので記事タイトルもGoogle Analyticsに送信するようにします。</p>
				<p>analytics.phpファイルの53行目に以下を追加</p>
				<pre name="code" class="php:firstLine[53]" style="margin:18px 0;">
$ptitle  = urlencode(ks_title()); //page title
</pre>
				<p>その下の$urchinUrlにセットする処理でutmdtに$ptitleを記述。<br />
				つまり以下↓</p>
				<pre name="code" class="php" style="margin:18px 0;">
$urchinUrl = &#039;http://www.google-analytics.com/__utm.gif?utmwv=1&amp;utmn=&#039;.$utmn.&#039;&amp;utmsr=-&amp;utmsc=-&amp;utmul=-&amp;utmje=0&amp;utmfl=-&amp;utmdt=&#039;.$ptitle.&#039;&amp;utmhn=&#039;.$utmhn.&#039;&amp;utmr=&#039;.$referer.&#039;&amp;utmp=&#039;.$utmp.&#039;&amp;utmac=&#039;.$utmac.&#039;&amp;utmcc=__utma%3D&#039;.$cookie.&#039;.&#039;.$random.&#039;.&#039;.$today.&#039;.&#039;.$today.&#039;.&#039;.$today.&#039;.2%3B%2B__utmb%3D&#039;.$cookie.&#039;%3B%2B__utmc%3D&#039;.$cookie.&#039;%3B%2B__utmz%3D&#039;.$cookie.&#039;.&#039;.$today.&#039;.2.2.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B__utmv%3D&#039;.$cookie.&#039;.&#039;.$uservar.&#039;%3B&#039;;
</pre>
				<p>別にいちいち変数かまさなくてもいいと思いますが、わかりづらいので一応。</p>
				<h2>検索エンジンクローラー対策</h2>
				<p>ktai styleはそもそもモバイル端末しか来ない(PCからのアクセスではSELENE.GA4Kは実行されない)のでPC用クローラーは心配ありません。さらにSELENE.GA4KはPC用のクローラー防御対策を備えています。なのでもし仮に通っても記録されません。</p>
				<p>でも携帯に模した検索クローラーはすごい数やってくる。。。<br />
				なので対策。</p>
				<p>クローラー対策については<a href="http://ke-tai.org/blog/2008/11/11/crawler/" target="_blank">ke-tai.org</a>さんの記事を参考にしました。</p>
				<p>isCrawler関数をanalytics.phpに追加。</p>
				<pre name="code" class="php" style="margin:18px 0;">
/**
 * クローラ判定
 * @return	bool	true:クローラ、false:非クローラ
 */
function isCrawler()
{
	$crawler_arr = array(
		&#039;Googlebot-Mobile&#039;,
		&#039;moba-crawler&#039;,
		&#039;mobile goo&#039;,
		&#039;LD_mobile_bot&#039;,
		&#039;froute.jp&#039;,
		&#039;Y!J-SRD&#039;,
		&#039;Y!J-MRD&#039;
	);

	foreach ($crawler_arr as $val) {
		if (false !== strpos($_SERVER[&#039;HTTP_USER_AGENT&#039;], $val)) {
			return true;
		}
	}

	return false;
}
</pre>
				<p>isMobile関数内のユーザーエージェント判定処理をisCrawlerの判定文で囲む。<br />
				つまり、クローラーだったら情報をGoogle Analyticsに送信しない。</p>
				<pre name="code" class="php" style="margin:18px 0;">
if(!isCrawler()){
	if(eregi(USER_AGENT_PATTERN_DOCOMO, $user_agent)){
		//echo(&quot;ドコモ&quot;);
		$mobile_flg = true;
	}else if(eregi(USER_AGENT_PATTERN_SOFTBANK, $user_agent)){
		//echo(&quot;SoftBank&quot;);
		$mobile_flg = true;
	}else if(isset($_SERVER[&quot;HTTP_X_JPHONE_MSNAME&quot;])){
		//echo(&quot;旧 J-Phone&quot;);
		$mobile_flg = true;
	}else if(eregi(USER_AGENT_PATTERN_AU, $user_agent)){
		//echo(&quot;au&quot;);
		$mobile_flg = true;
	}else if(eregi(USER_AGENT_PATTERN_WILLCOM, $user_agent)){
		//echo(&quot;WILLCOM&quot;);
		$mobile_flg = true;
	}else{
		//echo(&quot;PC&quot;);
		$mobile_flg = false;
	}
}
</pre>
				<p>こんな感じです。正直これやらないとクローラーきまくりで使い物にならないかと。<br />
				有用なクローラー判定処理を作成していただいた<a href="http://ke-tai.org/blog/2008/11/11/crawler/" target="_blank">ke-tai.org</a>さんに感謝です。</p>
				<p>一応手順は以上ですがこの方法、サーバー内でJavaScrit送信処理を生成して送る方式なのでGoogle Analyticsの規約としては正直微妙だと思います。</p>
				<p>なので試す方は自己責任でお願いします。</p>
				<p>【追記】<br />
				Ver1.1.1でクローラー対策などが改善された模様です。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2009/02/google-analytics-mobile.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2009/02/google-analytics-mobile.html" />
	</item>
		<item>
		<title>関連記事の表示(改)</title>
		<link>http://blog.nakatta.net/archives/2009/01/near_posts.html</link>
		<comments>http://blog.nakatta.net/archives/2009/01/near_posts.html#comments</comments>
		<pubDate>Fri, 23 Jan 2009 15:08:24 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Similar Posts]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/?p=494</guid>
		<description><![CDATA[				以前にも記事で書きましたが、エントリーの後に関連記事を表示するプラグインの話。「Simple TAGS」から「Similar Posts」に切り替えました。
				「Simple TAGS」は日本語で手軽だし悪 [...]]]></description>
			<content:encoded><![CDATA[				<p>以前にも記事で書きましたが、エントリーの後に関連記事を表示するプラグインの話。「Simple TAGS」から「Similar Posts」に切り替えました。</p>
				<p>「Simple TAGS」は日本語で手軽だし悪くないんですが、どうも精度がいまいちな気がする。</p>
				<p>そこんとこ「Similar Posts」は細かい設定が可能でそこそこ自分の理想に近づける事ができそうなのでいい感じです。…というか、そもそも「Simple TAGS」はタグ管理がメインだから関連記事の表示機能はおまけ的なんでしょうね。</p>
				<p>とりあえず、「Similar Posts」の導入方法を覚書です。</p>
				<p><span id="more-578"></span></p>
				<p>「Similar Posts」本体を<a href="http://wordpress.org/extend/plugins/similar-posts/" target="_blank">こちら</a>からダウンロード。<br />
				次に動作に必要なプラグイン「Post-Plugin Library」を<a href="http://wordpress.org/extend/plugins/post-plugin-library/" target="_blank">ココ</a>からダウンロード。</p>
				<p>両方をプラグインフォルダにアップロードして有効化。</p>
				<p>設定メニューに「Similar Posts」が追加されているので設定開始。</p>
				<p>・Manage the Index<br />
				「Handle extended characters」と「Treat as Chinese, Korean, or Japanese」の２つをYESに。<br />
				日本語を扱うのに必要。</p>
				<p>・Placement<br />
				「Output after post」をYESにするとエントリー下に表示されます。</p>
				<p>好きなところに出したい時はテンプレートに</p>
				<pre name="code" class="php" style="margin:18px 0;">
&lt;?php similar_posts(); ?&gt;
</pre>
				<p>を追加。</p>
				<p>とりあえずこれで使えるようになります。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2009/01/near_posts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2009/01/near_posts.html" />
	</item>
		<item>
		<title>WP-Cacheプラグイン導入</title>
		<link>http://blog.nakatta.net/archives/2008/12/post_333.html</link>
		<comments>http://blog.nakatta.net/archives/2008/12/post_333.html#comments</comments>
		<pubDate>Thu, 11 Dec 2008 14:48:49 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ktai style]]></category>
		<category><![CDATA[WP-Cache]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/?p=333</guid>
		<description><![CDATA[				どーもムダブログの表示が遅いので、なんとかしようと「WP-Cache」プラグインを導入。
				Wordpressは表示が遅いとよく言われます。
				アクセスがある度にページを動的生成する仕組みのためしょう [...]]]></description>
			<content:encoded><![CDATA[				<p>どーもムダブログの表示が遅いので、なんとかしようと「<a href="http://mnm.uib.es/gallir/wp-cache-2/">WP-Cache</a>」プラグインを導入。<br />
				Wordpressは表示が遅いとよく言われます。<br />
				アクセスがある度にページを動的生成する仕組みのためしょうがないところ。<br />
				エントリーが増えてきたらそれはそれでアドバンテージがあるんですが。<br />
				MovableTypeとか標準は静的ファイルで表示する半面、再構築が結構手間ですからね。</p>
				<p>…と、前置きはこれぐらいにして導入メモ。<br />
				<span id="more-568"></span><br />
				そのまま有効にすると「<a href="http://wppluginsj.sourceforge.jp/ktai_style/">Ktai Style</a>」と競合します。<br />
				なので少し作業が必要。</p>
				<p>まず「<a href="http://mnm.uib.es/gallir/wp-cache-2/">WP-Cache</a>」からダウンロード。</p>
				<p>解凍したら中にある「wp-cache-config-sample.php」を「wp-cache-config.php」にリネームしてコピー。</p>
				<pre name="code" class="php" style="margin:18px 0;">
&lt;?php
/*
WP-Cache Config Sample File

See wp-cache.php for author details.
*/

$cache_enabled = false; //Added by WP-Cache Manager
$cache_max_time = 3600; //in seconds
//$use_flock = true; // Set it tru or false if you know what to use
$cache_path = ABSPATH . &#039;wp-content/cache/&#039;;
$file_prefix = &#039;wp-cache-&#039;;

// Array of files that have &#039;wp-&#039; but should still be cached
$cache_acceptable_files = array( &#039;wp-atom.php&#039;, &#039;wp-comments-popup.php&#039;, &#039;wp-commentsrss2.php&#039;, &#039;wp-links-opml.php&#039;, &#039;wp-locations.php&#039;, &#039;wp-rdf.php&#039;, &#039;wp-rss.php&#039;, &#039;wp-rss2.php&#039;);

$cache_rejected_uri = array(&#039;wp-&#039;);
$cache_rejected_user_agent = array ( 0 =&gt; &#039;bot&#039;, 1 =&gt; &#039;ia_archive&#039;, 2 =&gt; &#039;slurp&#039;, 3 =&gt; &#039;crawl&#039;, 4 =&gt; &#039;spider&#039;);

if (file_exists(ABSPATH. &#039;wp-content/plugins/ktai_style/patch-wpcache.php&#039;)) {
	include ABSPATH. &#039;wp-content/plugins/ktai_style/patch-wpcache.php&#039;;
}

// Just modify it if you have conflicts with semaphores
$sem_id = 5419;

if ( &#039;/&#039; != substr($cache_path, -1)) {
	$cache_path .= &#039;/&#039;;
}

?&gt;
</pre>
				<p>20行目のところに３行追加。</p>
				<p>つまり、$cache_rejected_user_agentのところの下に</p>
				<pre name="code" class="php" style="margin:18px 0;">
if (file_exists(ABSPATH. &#039;wp-content/plugins/ktai_style/patch-wpcache.php&#039;)) {
	include ABSPATH. &#039;wp-content/plugins/ktai_style/patch-wpcache.php&#039;;
}
</pre>
				<p>を追加。</p>
				<p>で、その「wp-cache-config.php」をwp-contentフォルダ直下においてプラグインを有効にする。</p>
				<p>以上です。</p>
				<p>一度キャッシュされると多少は体感速度変わる…かな<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/coldsweats01.gif" alt="(^_^;" style="border:0 none;" /><br />
				とりあえず使ってみます<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/punch.gif" alt="[パンチ]" style="border:0 none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/12/post_333.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/12/post_333.html" />
	</item>
		<item>
		<title>それなりになってきた？</title>
		<link>http://blog.nakatta.net/archives/2008/11/post_289.html</link>
		<comments>http://blog.nakatta.net/archives/2008/11/post_289.html#comments</comments>
		<pubDate>Thu, 20 Nov 2008 14:39:09 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/?p=289</guid>
		<description><![CDATA[				ほしい機能は大体そろったかな
				次はデザインの作りこみっすね
]]></description>
			<content:encoded><![CDATA[				<p>ほしい機能は大体そろったかな<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/eye.gif" alt="[目]" style="border:0 none;" /><br />
				次はデザインの作りこみっすね<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/punch.gif" alt="[パンチ]" style="border:0 none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/11/post_289.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/11/post_289.html" />
	</item>
		<item>
		<title>Syntax Highlighter for WordPressを少し改造</title>
		<link>http://blog.nakatta.net/archives/2008/11/post_283.html</link>
		<comments>http://blog.nakatta.net/archives/2008/11/post_283.html#comments</comments>
		<pubDate>Wed, 19 Nov 2008 15:39:59 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Syntax Highlighter]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/?p=283</guid>
		<description><![CDATA[				自分なりの問題点は以下。
				wp.Vicunaとの相性が問題だと思う。
				１．ＩＥで行番号位置がおかしい。
				２．Firefoxでクリップボードコピー機能が効かない。
				３．Firefox [...]]]></description>
			<content:encoded><![CDATA[				<p>自分なりの問題点は以下。<br />
				wp.Vicunaとの相性が問題だと思う。</p>
				<p>１．ＩＥで行番号位置がおかしい。<br />
				２．Firefoxでクリップボードコピー機能が効かない。<br />
				３．Firefoxでクリップボードコピーを押すと一番下の体裁がくずれる。</p>
				<p>の３つです。<br />
				<span id="more-559"></span><br />
				まず1つ目はCSSでul要素にlist-style-positionでinsideを指定してるのがだめなので修正。</p>
				<p>2つ目と３つ目ははめんどくさいからクリップボードコピー機能をIE以外表示させないことで解決。</p>
				<p>ちょー手抜きだけどよしとしよう<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/coldsweats01.gif" alt="(^_^;" style="border:0 none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/11/post_283.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/11/post_283.html" />
	</item>
		<item>
		<title>Lightbox不具合の修正</title>
		<link>http://blog.nakatta.net/archives/2008/11/post_279.html</link>
		<comments>http://blog.nakatta.net/archives/2008/11/post_279.html#comments</comments>
		<pubDate>Wed, 19 Nov 2008 14:30:17 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/?p=279</guid>
		<description><![CDATA[				SafariやGoogle Chromeでサイズの違う写真を交互に出すとおかしくなる不具合を発見。
				なので修正です。
				
				使用プラグインはWP Lightbox2です。
				444行目を [...]]]></description>
			<content:encoded><![CDATA[				<p>SafariやGoogle Chromeでサイズの違う写真を交互に出すとおかしくなる不具合を発見。<br />
				なので修正です。<br />
				<span id="more-558"></span><br />
				使用プラグインは<a href="http://zeo.unic.net.my/notes/lightbox2-for-wordpress/">WP Lightbox2</a>です。</p>
				<p>444行目を追加。</p>
				<pre name="code" class="php:firstLine[443]" style="margin:18px 0;">
myLightbox.resizeImageContainer(imgPreloader.width, imgPreloader.height);
Element.setWidth(&#039;lightboxImage&#039;, imgPreloader.width);
</pre>
				<p>OK<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/scissors.gif" alt="[チョキ]" style="border:0 none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/11/post_279.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/11/post_279.html" />
	</item>
		<item>
		<title>プログラムコードのハイライト表示</title>
		<link>http://blog.nakatta.net/archives/2008/11/post_245.html</link>
		<comments>http://blog.nakatta.net/archives/2008/11/post_245.html#comments</comments>
		<pubDate>Mon, 17 Nov 2008 09:09:33 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Syntax Highlighter]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/?p=245</guid>
		<description><![CDATA[				昨日の記事でプログラムコードを載せたんですが、せっかくなのでハイライト表示するプラグインを導入してみました。いろいろ試した結果、とりあえず「Syntax Highlighter for WordPress」に。結 [...]]]></description>
			<content:encoded><![CDATA[				<p>昨日の記事でプログラムコードを載せたんですが、せっかくなのでハイライト表示するプラグインを導入してみました。いろいろ試した結果、とりあえず「<a href="http://wppluginsj.sourceforge.jp/syntax-highlighter/">Syntax Highlighter for WordPress</a>」に。結構高機能でプレインテキスト表示したりクリップボードにコピーできたりとなかなかいい感じ<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/flair.gif" alt="[ひらめき]" style="border:0 none;" /></p>
				<p>…と思っていたんです…が<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/wobbly.gif" alt="(x_x)" style="border:0 none;" />ど−も動きがあやしい時がある。<br />
				<span id="more-556"></span><br />
				ていうのも、FirefoxとかGoogleCromeでの話。ＩＥなら全然問題ありません。なのでＩＥ以外の方はソース上部にある機能は使わない方がいいかもです。</p>
				<p>標準だと言語名が頭についたりして気に食わなかったから消してみたり、ちょこちょこいじったのがまずいんですかね？というよりテーマとの相性問題がでかいかな<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/eye.gif" alt="[目]" style="border:0 none;" /></p>
				<p>[追記]<br />
				なんか他のサイトでも同じようなプラグイン使ってる人が同じ症状になってるっぽい。<br />
				のでとりあえずはそのままでいーや<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/bomb.gif" alt="●〜" style="border:0 none;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/11/post_245.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/11/post_245.html" />
	</item>
		<item>
		<title>WordpressでPCから携帯対応の絵文字入力</title>
		<link>http://blog.nakatta.net/archives/2008/11/post_188-2.html</link>
		<comments>http://blog.nakatta.net/archives/2008/11/post_188-2.html#comments</comments>
		<pubDate>Sat, 15 Nov 2008 15:17:28 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ktai style]]></category>
		<category><![CDATA[WP Grings]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/?p=188</guid>
		<description><![CDATA[				せっかくなので手順をメモしときます。
				携帯に絵文字も含めて対応できる「ktai_style」と、PC投稿時に顔アイコンを一覧から選べるようにする「WP Grings」の二つをムリヤリ組み合わせてみます。つ [...]]]></description>
			<content:encoded><![CDATA[				<p>せっかくなので手順をメモしときます。</p>
				<p>携帯に絵文字も含めて対応できる「<a href="http://wppluginsj.sourceforge.jp/ktai_style/">ktai_style</a>」と、PC投稿時に顔アイコンを一覧から選べるようにする「<a href="http://alexking.org/projects/wordpress/readme?project=wp-grins">WP Grings</a>」の二つを<b>ムリヤリ</b>組み合わせてみます。つまり、WP Gringsで使用するアイコンをktai_style互換にしちゃおうって作戦。</p>
				<p>結構いろいろいじってるし、自分のためにやっつけで対応したためチャレンジする人は自己責任でどうぞ。<br />
				<span id="more-555"></span><br />
				まず、なにはともあれ２つのプラグインを普通にインストール。</p>
				<p>標準だとWP GringsはWordpress標準のスマイルマークが使えるようになってます。これはただアイコンタグの入力を補完しているだけっぽい。てことはまるまるktai_styleのアイコンを表示して、クリックしたとき入力されるタグもktai_styleのものに差し替えることができれば目的達成？</p>
				<p>というわけでWP Gringsをいじります。</p>
				<p>wp-grins.phpを4か所修正<br />
				行番号は未編集のVersion1.5のwp-grins.phpを対象にしています。</p>
				<p>まずはktai_styleのタグ用にスペースを排除する処理をコメントアウト。</p>
				<pre name="code" class="php:firstLine[77]" style="margin:18px 0;">
//$tag = str_replace(&#039; &#039;, &#039;&#039;, $tag);
</pre>
				<p>次に画像ファイルのパスをktai_styleのインストール場所に変更。</p>
				<pre name="code" class="php:firstLine[78]" style="margin:18px 0;">
$grins .= &#039;&lt;img src=&quot;&#039;.get_bloginfo(&#039;wpurl&#039;).&#039;/wp-content/plugins/ktai_style/pics/SA/&#039;.$grin.&#039;&quot; alt=&quot;&#039;.$tag.&#039;&quot; onclick=&quot;grin(\&#039;&#039;.$tag.&#039;\&#039;);&quot;/&gt; &#039;;
</pre>
				<p>※パスはインストールした環境によって変わります。</p>
				<p>my-hacks.phpに以下を追加。</p>
				<pre name="code" class="php" style="margin:18px 0;">
&lt;?php
	$wpsmiliestrans = array(
		&#039;&lt;img localsrc=&amp;quot;d140&amp;quot; /&gt;&#039; =&gt; &#039;happy01.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d141&amp;quot; /&gt;&#039; =&gt; &#039;angry.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d142&amp;quot; /&gt;&#039; =&gt; &#039;despair.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d143&amp;quot; /&gt;&#039; =&gt; &#039;sad.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d221&amp;quot; /&gt;&#039; =&gt; &#039;think.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d222&amp;quot; /&gt;&#039; =&gt; &#039;confident.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d223&amp;quot; /&gt;&#039; =&gt; &#039;coldsweats01.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d224&amp;quot; /&gt;&#039; =&gt; &#039;coldsweats02.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d225&amp;quot; /&gt;&#039; =&gt; &#039;pout.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d226&amp;quot; /&gt;&#039; =&gt; &#039;gawk.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d227&amp;quot; /&gt;&#039; =&gt; &#039;lovely.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d229&amp;quot; /&gt;&#039; =&gt; &#039;bleah.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d230&amp;quot; /&gt;&#039; =&gt; &#039;wink.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d231&amp;quot; /&gt;&#039; =&gt; &#039;happy02.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d232&amp;quot; /&gt;&#039; =&gt; &#039;bearing.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d233&amp;quot; /&gt;&#039; =&gt; &#039;catface.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d234&amp;quot; /&gt;&#039; =&gt; &#039;crying.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d235&amp;quot; /&gt;&#039; =&gt; &#039;weep.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d271&amp;quot; /&gt;&#039; =&gt; &#039;delicious.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d272&amp;quot; /&gt;&#039; =&gt; &#039;smile.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d276&amp;quot; /&gt;&#039; =&gt; &#039;shock.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d137&amp;quot; /&gt;&#039; =&gt; &#039;heart02.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d144&amp;quot; /&gt;&#039; =&gt; &#039;wobbly.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d145&amp;quot; /&gt;&#039; =&gt; &#039;up.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d146&amp;quot; /&gt;&#039; =&gt; &#039;note.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d150&amp;quot; /&gt;&#039; =&gt; &#039;shine.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d151&amp;quot; /&gt;&#039; =&gt; &#039;flair.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d152&amp;quot; /&gt;&#039; =&gt; &#039;annoy.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d153&amp;quot; /&gt;&#039; =&gt; &#039;punch.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d154&amp;quot; /&gt;&#039; =&gt; &#039;bomb.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d156&amp;quot; /&gt;&#039; =&gt; &#039;down.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d157&amp;quot; /&gt;&#039; =&gt; &#039;sleepy.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d159&amp;quot; /&gt;&#039; =&gt; &#039;sign02.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d160&amp;quot; /&gt;&#039; =&gt; &#039;sign03.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d162&amp;quot; /&gt;&#039; =&gt; &#039;sweat01.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d163&amp;quot; /&gt;&#039; =&gt; &#039;sweat02.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d164&amp;quot; /&gt;&#039; =&gt; &#039;dash.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d166&amp;quot; /&gt;&#039; =&gt; &#039;sign05.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d240&amp;quot; /&gt;&#039; =&gt; &#039;run.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d084&amp;quot; /&gt;&#039; =&gt; &#039;eye.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d085&amp;quot; /&gt;&#039; =&gt; &#039;ear.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d086&amp;quot; /&gt;&#039; =&gt; &#039;rock.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d087&amp;quot; /&gt;&#039; =&gt; &#039;scissors.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d088&amp;quot; /&gt;&#039; =&gt; &#039;paper.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d091&amp;quot; /&gt;&#039; =&gt; &#039;foot.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d228&amp;quot; /&gt;&#039; =&gt; &#039;good.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d237&amp;quot; /&gt;&#039; =&gt; &#039;clip.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d241&amp;quot; /&gt;&#039; =&gt; &#039;secret.gif&#039;,
		&#039;&lt;img localsrc=&amp;quot;d005&amp;quot; /&gt;&#039; =&gt; &#039;thunder.gif&#039;,
	);
?&gt;
</pre>
				<p>個人的に使いそうなやつだけピックアップしました。<br />
				ここで行を増やすなり減らすなりすれば反映されます。<br />
				あんま多いと重くなるので注意です。</p>
				<p>と、ここまででとりあえず使えるようになるはず。</p>
				<p>ただ、wp.vicunaとか使ってるとこのままではコメント投稿欄にIE以外のブラウザだと反映されません。</p>
				<p>なのでさらにちょっと修正。</p>
				<pre name="code" class="php:firstLine[97]" style="margin:18px 0;">
else if (document.getElementById(&#039;comment&#039;)) {
	var type = &#039;before&#039;;
	var node = $(&#039;comment&#039;);
}
else if (document.getElementById(&#039;comment-text&#039;)) {
	var type = &#039;before&#039;;
	var node = $(&#039;comment-text&#039;);
}
else {
	return;
}
</pre>
				<pre name="code" class="php:firstLine[125]" style="margin:18px 0;">
else if ($(&#039;comment&#039;) &amp;&amp; $(&#039;comment&#039;).type == &#039;textarea&#039;) {
	myField = $(&#039;comment&#039;);
}
else if ($(&#039;comment-text&#039;) &amp;&amp; $(&#039;comment-text&#039;).type == &#039;textarea&#039;) {
	myField = $(&#039;comment-text&#039;);
}
else {
	return false;
}
</pre>
				<p>こんな感じ。</p>
				<p>それと注意事項としてはktai_styleのタグはビジュアルエディタと相性がよくないので使用しないようにしてください。<br />
				というか、そもそも今回のコレはタグの挿入を補完するものなので<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/bomb.gif" alt="●〜" style="border:0 none;" /></p>
				<p>…一応以上ですが、よく要素も確認せずにとりあえず使えるようにしたって感じでなんか不具合あるかもです。</p>
				<p>時間あったらも少しちゃんとしてプラグインにでもしようかな。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/11/post_188-2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/11/post_188-2.html" />
	</item>
		<item>
		<title>暫定PC絵文字入力対応</title>
		<link>http://blog.nakatta.net/archives/2008/11/post_185-2.html</link>
		<comments>http://blog.nakatta.net/archives/2008/11/post_185-2.html#comments</comments>
		<pubDate>Fri, 14 Nov 2008 17:04:31 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[実験]]></category>

		<guid isPermaLink="false">http://muda.info/?p=185</guid>
		<description><![CDATA[				とりあえずできるようにはしてみた
				ちょっとプラグインいじって無理やりだしちゃった感じ
				問題ないかな？？
]]></description>
			<content:encoded><![CDATA[				<p>とりあえずできるようにはしてみた<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/good.gif" alt="[OK]" style="border:0 none;" /><img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/shine.gif" alt="◇" style="border:0 none;" /><br />
				ちょっとプラグインいじって無理やりだしちゃった感じ<img src="http://blog.nakatta.net/wp-content/plugins/ktai_style/pics/SA/bomb.gif" alt="●〜" style="border:0 none;" /><br />
				問題ないかな？？</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/11/post_185-2.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/11/post_185-2.html" />
	</item>
		<item>
		<title>今後の作業メモ</title>
		<link>http://blog.nakatta.net/archives/2008/11/post_172-2.html</link>
		<comments>http://blog.nakatta.net/archives/2008/11/post_172-2.html#comments</comments>
		<pubDate>Fri, 14 Nov 2008 05:36:19 +0000</pubDate>
		<dc:creator>tada</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://muda.info/2008/11/143619.html</guid>
		<description><![CDATA[				○ＰＣ投稿画面からの絵文字入力対応
				○サイドバーに最近のコメントを表示
				○続きを読む機能のＪＳ折畳み
				○デザイン作りこみ
				とりあえずこんなとこ。
]]></description>
			<content:encoded><![CDATA[				<p>○ＰＣ投稿画面からの絵文字入力対応<br />
				○サイドバーに最近のコメントを表示<br />
				○続きを読む機能のＪＳ折畳み<br />
				○デザイン作りこみ</p>
				<p>とりあえずこんなとこ。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nakatta.net/archives/2008/11/post_172-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.nakatta.net/archives/2008/11/post_172-2.html" />
	</item>
	</channel>
</rss>
