<?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>WordPress Note &#187; トラックバック</title>
	<atom:link href="http://www.df-cue.com/wp/tag/trackback/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.df-cue.com/wp</link>
	<description>WordPressのプラグイン・カスタマイズ覚え書きノート</description>
	<lastBuildDate>Sat, 27 Feb 2010 03:38:44 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Commented entry list Plugin : 最近のコメントと最近のトラックバックを表示するプラグイン</title>
		<link>http://www.df-cue.com/wp/2009/06/20/commented-entry-list-plugin/</link>
		<comments>http://www.df-cue.com/wp/2009/06/20/commented-entry-list-plugin/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 03:30:54 +0000</pubDate>
		<dc:creator>ナカグマ</dc:creator>
				<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[Commented entry list Plugin]]></category>
		<category><![CDATA[コメント]]></category>
		<category><![CDATA[トラックバック]]></category>

		<guid isPermaLink="false">http://www.df-cue.com/wp/?p=87</guid>
		<description><![CDATA[				最近のコメントをサイドバーなどに表示することは、Movable Type なら訳のないことなのですが、こと WordPress に限っては、独自に用意しないといけなくてちょっとめんどくさい。それでも、最近のバージ [...]]]></description>
			<content:encoded><![CDATA[				<p>最近のコメントをサイドバーなどに表示することは、Movable Type なら訳のないことなのですが、こと WordPress に限っては、独自に用意しないといけなくてちょっとめんどくさい。それでも、最近のバージョンでは「ウィジェット」を使って設定できるようになっており、WordPress も進化しています。</p>
				<p>ただ「ウィジェット」を使う場合は、限られたスタイルでしか表示できないので、こだわる人にはあまり魅力的にはうつらないのではないでしょうか。それに「ウィジェット」に対応させたテーマでないと、使うことはできません。<br />
				「ウィジェット」に対応していないテーマを使っているときや、表示スタイルにもこだわりたい…、そんなときに使いたいプラグインです。<br />
				また、最近のコメントと最近のトラックバックに分けて表示ができるのも魅力。</p>
				<dl>
				<dt>Commented entry list Plugin</dt>
				<dd>
				<p>最近のコメントと最近のトラックバックを表示するプラグイン。<br />
				個別記事ページで、コメントとトラックバックを分けて表示もできる。<br />
				配布元 : <a title="Commented entry list Plugin" href="http://hirobee.jp/archives/2005/05/commented-entry-list-11/">Commented entry list Plugin（Ver. 1.2）</a></p>
				</dd>
				</dl>
				<p><span id="more-87"></span></p>
				<h3>使い方</h3>
				<ol>
				<li>
				<p>配布元より、<a title="Commented entry list Plugin" href="http://hirobee.jp/archives/2005/05/commented-entry-list-11/">Commented entry list Plugin（Ver. 1.2）</a>をダウンロードします。（commented-entry-list_1.2.zip）</p>
				</li>
				<li>
				<p>解凍すると「commented-entry-list_1.2」というフォルダが展開されるので、フォルダの中の「commented-entry-list.php」を wp-content/plugins にアップロードします。</p>
				</li>
				<li>
				<p>「プラグイン」の画面で、「Commented entry list」を有効化します。（※「使用する」をクリック）</p>
				</li>
				<li>
				<p>最近のコメントを入れたいところに、<em>&lt;?php get_recently_commented(); ?&gt;</em> を、<br />
				最近のトラックバックを入れたいところに <em>&lt;?php get_recently_trackbacked(); ?&gt;</em> を挿入します。<br />
				()の中に数字を入れると、その数字分のコメントとトラックバックが表示されます。</p>
				<p>例）最近のコメントを10件ずつ表示する場合</p>
				<pre class="brush: php;">
&lt;ul&gt;
	&lt;?php get_recently_commented(10); ?&gt;
&lt;/ul&gt;
</pre>
				</li>
				<li>
				<p>また、同梱されている「comments.php」を、使用中のテーマのものと入れ替えると、個別記事ページでコメントとトラックバックを別に表示させることができます。</p>
				</li>
				</ol>
				<h3>注意点</h3>
				<p>同梱されている「comments.php」ですが、119行目付近のコメント本文入力欄をしめす &lt;textarea&gt; タグの前に <em>&lt;?php wp_grins(); ?&gt;</em> というソースが入っています。でも、これはスマイリーアイコンを使用できるようにするプラグイン「<a href="http://wordpress.org/extend/plugins/wp-grins/">WP Grins</a>」を呼び出すためのソースなので、そのプラグインを入れていない人は削除しておくと良いです。<br />
				（たしか、私は最初これでエラーが出ました）</p>
				<pre class="brush: xml; first-line: 117; highlight: [119];">
&lt;!--&lt;p&gt;&lt;small&gt;&lt;strong&gt;XHTML:&lt;/strong&gt; You can use these tags: &lt;?php echo allowed_tags(); ?&gt;&lt;/small&gt;&lt;/p&gt;--&gt;

&lt;?php wp_grins(); ?&gt;&lt;p&gt;&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;

&lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; tabindex=&quot;5&quot; value=&quot;Submit Comment&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;comment_post_ID&quot; value=&quot;&lt;?php echo $id; ?&gt;&quot; /&gt;
&lt;?php do_action('comment_form', $post-&gt;ID); ?&gt;
</pre>
				<h3>カスタマイズ</h3>
				<p>「commented-entry-list.php」を変更することで、表示のカスタマイズがいろいろと可能です。</p>
				<h4>時刻、日付の書式の変更</h4>
				<p>38行目、78行目</p>
				<pre class="brush: plain;">$comment_date = mysql2date('H:i', $comment_date);</pre>
<p>40行目、80行目</p>
<pre class="brush: plain;">$comment_date = mysql2date('m/d', $comment_date);</pre>
				<p>の&#8217;H:i&#8217;、&#8217;m/d&#8217;を変更すると、時刻、日付の書式が変更できます。（<a href="http://jp2.php.net/manual/ja/function.date.php" target="_blank">PHPの日付・時刻書式を参照</a>）</p>
				<h4>投稿者名のリンクのはずし方</h4>
				<p>デフォルトでは、投稿者名のリンクをクリックすると、投稿者が記入したURLにジャンプしてしまい、コメントにジャンプするつもりだった人には使いにくいです。そんなとき、以下の方法でリンクをはずします。</p>
				<p>最後の方、105行目より以下の部分の「$ret .= $author;」だけを残して、それ以外を削除します。</p>
				<pre class="brush: php; auto-links: false; first-line: 105; highlight: [108];">
	$url = str_replace('http://url', '', $url);
	$url = preg_replace('|[^a-z0-9-_.?#=&amp;;,/:~]|i', '', $url);
	if (empty($url)/* &amp;&amp; empty($email)*/) {
		$ret .= $author;
	}else{
		$ret .= '&lt;a href=&quot;';
			if ($url) {
				$url = str_replace(';//', '://', $url);
				$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
				$url = preg_replace('/&amp;([^#])(?![a-z]{2,8};)/', '&amp;$1', $url);
				$ret .= $url;
//			} else {
//				$ret .= 'mailto:'.antispambot($email);
			}
			$ret .= '&quot; rel=&quot;external&quot;&gt;' . $author . '&lt;/a&gt;';
	}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.df-cue.com/wp/2009/06/20/commented-entry-list-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
