<?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>www.hbirds.net &#187; WP-PostViews</title> <atom:link href="http://www.hbirds.net/tag/wp-postviews/feed" rel="self" type="application/rss+xml" /><link>http://www.hbirds.net</link> <description>５０歳にして５０の手習いに挑戦。なんて無理！ だけど、いつも新しいことに興味を持って挑戦する心を忘れないようにしたい。　　そんなオヤジの挑戦の日々・・・・・・</description> <lastBuildDate>Wed, 01 Feb 2012 20:52:58 +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>WP-PostViewsの抜粋文字数削減</title><link>http://www.hbirds.net/wpcustomize/wp-postviews%e3%81%ae%e6%8a%9c%e7%b2%8b%e6%96%87%e5%ad%97%e6%95%b0%e5%89%8a%e6%b8%9b/3427</link> <comments>http://www.hbirds.net/wpcustomize/wp-postviews%e3%81%ae%e6%8a%9c%e7%b2%8b%e6%96%87%e5%ad%97%e6%95%b0%e5%89%8a%e6%b8%9b/3427#comments</comments> <pubDate>Sat, 06 Jun 2009 05:18:56 +0000</pubDate> <dc:creator>hbirds</dc:creator> <category><![CDATA[WPカスタマイズ]]></category> <category><![CDATA[excerpt]]></category> <category><![CDATA[WP-PostViews]]></category> <category><![CDATA[抜粋文字数削減]]></category> <guid
isPermaLink="false">http://www.hbirds.net/?p=3427</guid> <description><![CDATA[WP-PostViewsは、記事の閲覧回数やその記事の抜粋を表示してくれる便利なプラグインですが、抜粋される文字数をWPのデフォルトの数より少なくできるようにしてみました。 wp-postviews.phpを以下のように修正します。 １．先頭の著作権関係のコメントの直後２８行目あたりに以下の関数を定義します。 ２．以下のコードを４か所に挿入します。 挿入する位置は、以下のコード(同じコードが４か所にあります）の直後です。 ※使い方 ウィジェットやテーマ内に以下のように書けば抜粋文字数が20文字になります。 $mb_exc_words=0とすれば抜粋文字数が0になります。]]></description> <content:encoded><![CDATA[<p>WP-PostViewsは、記事の閲覧回数やその記事の抜粋を表示してくれる便利なプラグインですが、抜粋される文字数をWPのデフォルトの数より少なくできるようにしてみました。</p><p>wp-postviews.phpを以下のように修正します。</p><p>１．先頭の著作権関係のコメントの直後２８行目あたりに以下の関数を定義します。</p><pre class="brush: php; title: ; notranslate">### Function: mb_wordraps
function mb_wordwraps($mb_words, $txt) {
   $pointer = 0;
   $result_text = &quot;&quot;;
   while ($pointer &lt; mb_strlen($txt)) {
       $this_char = mb_substr($txt,$pointer,1);
       if (is_singlebytechar($this_char)){
	       $mb_words++; // Do not count single byte char;
	   } elseif ($pointer &gt; $mb_words) {
	   	   return mb_substr($txt,0,$pointer);
       }
       $pointer++;
    }
    return $txt; //Since length not exceeded return whole text
}
</pre><p>２．以下のコードを４か所に挿入します。</p><pre class="brush: php; title: ; notranslate">				if ($mb_exc_words &gt; 0 ) {
				$post_excerpt = mb_wordwraps($mb_exc_words,$post_excerpt).'...';
				} else {
				$post_excerpt = &quot;&quot;;
			    }</pre><p>挿入する位置は、以下のコード(同じコードが４か所にあります）の直後です。</p><pre class="brush: php; title: ; notranslate">$post_excerpt = views_post_excerpt($post-&gt;post_excerpt, $post-&gt;post_content, $post-&gt;post_password);</pre><p>※使い方<br
/> ウィジェットやテーマ内に以下のように書けば抜粋文字数が20文字になります。</p><pre class="brush: php; title: ; notranslate">&lt;ul&gt;
&lt;?php if (function_exists('get_most_viewed')): ?&gt;
 &lt;?php $mb_exc_words = 20;  ?&gt;
&lt;?php get_most_viewed('post',5); ?&gt;
&lt;?php endif; ?&gt;
&lt;/ul&gt;</pre><p>$mb_exc_words=0とすれば抜粋文字数が0になります。</p> ]]></content:encoded> <wfw:commentRss>http://www.hbirds.net/wpcustomize/wp-postviews%e3%81%ae%e6%8a%9c%e7%b2%8b%e6%96%87%e5%ad%97%e6%95%b0%e5%89%8a%e6%b8%9b/3427/feed</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>WP-PostViewsプラグイン（追記）</title><link>http://www.hbirds.net/wpcustomize/wp-postviews%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%ef%bc%88%e8%bf%bd%e8%a8%98%ef%bc%89/1993</link> <comments>http://www.hbirds.net/wpcustomize/wp-postviews%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%ef%bc%88%e8%bf%bd%e8%a8%98%ef%bc%89/1993#comments</comments> <pubDate>Wed, 04 Mar 2009 11:35:53 +0000</pubDate> <dc:creator>hbirds</dc:creator> <category><![CDATA[WPカスタマイズ]]></category> <category><![CDATA[WP-PostViews]]></category> <category><![CDATA[プラグイン]]></category> <guid
isPermaLink="false">http://www.hbirds.net/uncategorized/wp-postviews%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%ef%bc%88%e8%bf%bd%e8%a8%98%ef%bc%89/1993</guid> <description><![CDATA[とりあえず動くことは動いてるけど、 ・管理画面でページのカウント等を非表示にするoptionをセットしても反映しない ・index.phpでは表示されない ・Multibyte_Excerpt プラグインで表示文字数を変えたのに反映しない 等の不具合が生じています。 時間がなくてちゃんと検証してないので、一部（特に2番目）は自分のミスの可能性もあります。 週末にちゃんとチェックしてみます。]]></description> <content:encoded><![CDATA[<p>とりあえず動くことは動いてるけど、<br
/> ・管理画面でページのカウント等を非表示にするoptionをセットしても反映しない<br
/> ・index.phpでは表示されない<br
/> ・Multibyte_Excerpt プラグインで表示文字数を変えたのに反映しない<br
/> 等の不具合が生じています。<br
/> 時間がなくてちゃんと検証してないので、一部（特に2番目）は自分のミスの可能性もあります。<br
/> 週末にちゃんとチェックしてみます。</p> ]]></content:encoded> <wfw:commentRss>http://www.hbirds.net/wpcustomize/wp-postviews%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%ef%bc%88%e8%bf%bd%e8%a8%98%ef%bc%89/1993/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>WP-PostViewsプラグイン</title><link>http://www.hbirds.net/wpcustomize/wp-postviews%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3/1971</link> <comments>http://www.hbirds.net/wpcustomize/wp-postviews%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3/1971#comments</comments> <pubDate>Mon, 02 Mar 2009 11:48:42 +0000</pubDate> <dc:creator>hbirds</dc:creator> <category><![CDATA[WPカスタマイズ]]></category> <category><![CDATA[WP-PostViews]]></category> <category><![CDATA[プラグイン]]></category> <guid
isPermaLink="false">http://www.hbirds.net/?p=1971</guid> <description><![CDATA[個別記事の閲覧数をカウントして、ランキングリストを作ってくれるプラグインです。 インストールは通常のプラグインと同様です。 WP-PostViews と WP-PostViewsWidget の二つのプラグインができていますが、WP-PostViewsWidget を有効化するとウィジェットにMost Viewedというウィジェットが追加されますが、サイドバーにMost Viewed を表示したくない場合は、後者の方は有効化しなくてもかまいません。 これだけでは、カウントはしてくれても表示してくれていないので、index.php などの個別記事を表示するテンプレートの適当な位置に以下のスクリプトを追記します。 また、このサイトでは、トップページの下の方に人気の記事として、トップ１０件（デフォルト）の記事タイトルを載せていますが、以下のスクリプトをtop_page.php に追記しています。 ↑のままだと、ページも含めて閲覧回数が表示されてしまうので、記事に限定して、かつ上位５件のリスト表示をするようにしました。]]></description> <content:encoded><![CDATA[<p>個別記事の閲覧数をカウントして、ランキングリストを作ってくれるプラグインです。<br
/> インストールは通常のプラグインと同様です。<br
/> WP-PostViews と WP-PostViewsWidget の二つのプラグインができていますが、WP-PostViewsWidget を有効化するとウィジェットにMost Viewedというウィジェットが追加されますが、サイドバーにMost Viewed を表示したくない場合は、後者の方は有効化しなくてもかまいません。</p><p>これだけでは、カウントはしてくれても表示してくれていないので、index.php などの個別記事を表示するテンプレートの適当な位置に以下のスクリプトを追記します。</p><pre class="brush: php; title: ; notranslate">&lt;?php if(function_exists('the_views')) { the_views(); } ?&gt;</pre><p>また、このサイトでは、トップページの下の方に人気の記事として、トップ１０件（デフォルト）の記事タイトルを載せていますが、以下のスクリプトをtop_page.php に追記しています。</p><pre class="brush: php; title: ; notranslate">&lt;?php if (function_exists('get_most_viewed')): ?&gt;
&lt;?php get_most_viewed(); ?&gt;
&lt;?php endif; ?&gt;</pre><p>↑のままだと、ページも含めて閲覧回数が表示されてしまうので、記事に限定して、かつ上位５件のリスト表示をするようにしました。</p><pre class="brush: xml; title: ; notranslate">    &lt;li&gt;&lt;h2&gt;人気の記事リスト&lt;/h2&gt;
    &lt;ul&gt;
    &lt;?php if (function_exists('get_most_viewed')): ?&gt;
    &lt;?php get_most_viewed('post',5); ?&gt;
    &lt;?php endif; ?&gt;
    &lt;/ul&gt;&lt;/li&gt;
</pre>]]></content:encoded> <wfw:commentRss>http://www.hbirds.net/wpcustomize/wp-postviews%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3/1971/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
