<?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>GoodUse</title>
	<atom:link href="http://g.azucar.jp/feed" rel="self" type="application/rss+xml" />
	<link>http://g.azucar.jp</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 08 Mar 2010 03:35:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>drupalのurlを変更する</title>
		<link>http://g.azucar.jp/drupal%e3%81%aeurl%e3%82%92%e5%a4%89%e6%9b%b4%e3%81%99%e3%82%8b</link>
		<comments>http://g.azucar.jp/drupal%e3%81%aeurl%e3%82%92%e5%a4%89%e6%9b%b4%e3%81%99%e3%82%8b#comments</comments>
		<pubDate>Mon, 08 Mar 2010 03:35:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/drupal%e3%81%aeurl%e3%82%92%e5%a4%89%e6%9b%b4%e3%81%99%e3%82%8b</guid>
		<description><![CDATA[
念のため、ファイル、データーベースのバックアップをすべて取る
ftpなどを使用し、ファイルをすべて、希望のアドレスに移動する
settings.phpで、$base_urlを使用している場合は、あたらしいＵＲＬに変更する
以上

詳しくは

http://drupal.org/node/140714

]]></description>
			<content:encoded><![CDATA[<ol>
<li>念のため、ファイル、データーベースのバックアップをすべて取る</li>
<li>ftpなどを使用し、ファイルをすべて、希望のアドレスに移動する</li>
<li>settings.phpで、$base_urlを使用している場合は、あたらしいＵＲＬに変更する</li>
<li>以上</li>
</ol>
<p>詳しくは</p>
<ul>
<li><a title="http://drupal.org/node/140714" href="http://drupal.org/node/140714">http://drupal.org/node/140714</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/drupal%e3%81%aeurl%e3%82%92%e5%a4%89%e6%9b%b4%e3%81%99%e3%82%8b/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hetemlサーバーで、httpをhttpsにリダイレクトする</title>
		<link>http://g.azucar.jp/heteml%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%80%81http%e3%82%92https%e3%81%ab%e3%83%aa%e3%83%80%e3%82%a4%e3%83%ac%e3%82%af%e3%83%88%e3%81%99%e3%82%8b</link>
		<comments>http://g.azucar.jp/heteml%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%80%81http%e3%82%92https%e3%81%ab%e3%83%aa%e3%83%80%e3%82%a4%e3%83%ac%e3%82%af%e3%83%88%e3%81%99%e3%82%8b#comments</comments>
		<pubDate>Thu, 25 Feb 2010 07:27:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[server]]></category>
		<category><![CDATA[heteml]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/heteml%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%80%81http%e3%82%92https%e3%81%ab%e3%83%aa%e3%83%80%e3%82%a4%e3%83%ac%e3%82%af%e3%83%88%e3%81%99%e3%82%8b</guid>
		<description><![CDATA[あるディレクトリーを、独自ssl契約をし、そのドメインについて、すべてhttpsにするとする。もともとあったサイトをそのまま、ssl化したので、http-&#62;httpsに自動にしたい。その場合は、
.htaccess
に以下の情報を挿入する
RewriteEngine On    RewriteCond %{SERVER_PORT} !^443$     RewriteRule ^(.*?)$ https://%{HTTP_HOST}/$1 [L,R]
]]></description>
			<content:encoded><![CDATA[<p>あるディレクトリーを、独自ssl契約をし、そのドメインについて、すべてhttpsにするとする。もともとあったサイトをそのまま、ssl化したので、http-&gt;httpsに自動にしたい。その場合は、</p>
<p>.htaccess</p>
<p>に以下の情報を挿入する</p>
<p>RewriteEngine On    <br />RewriteCond %{SERVER_PORT} !^443$     <br />RewriteRule ^(.*?)$ <a href="https://%{HTTP_HOST}/">https://%{HTTP_HOST}/</a>$1 [L,R]</p>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/heteml%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%a7%e3%80%81http%e3%82%92https%e3%81%ab%e3%83%aa%e3%83%80%e3%82%a4%e3%83%ac%e3%82%af%e3%83%88%e3%81%99%e3%82%8b/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordPressのカスタムデータを取り出す</title>
		<link>http://g.azucar.jp/wordpress%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%96%e3%82%8a%e5%87%ba%e3%81%99</link>
		<comments>http://g.azucar.jp/wordpress%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%96%e3%82%8a%e5%87%ba%e3%81%99#comments</comments>
		<pubDate>Fri, 05 Feb 2010 09:20:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[wordPress]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/wordpress%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%96%e3%82%8a%e5%87%ba%e3%81%99</guid>
		<description><![CDATA[
以下の関数が用意されている
Custom field (postmeta)

add_post_meta&#160;&#160; 
delete_post_meta&#160;
get_post_custom&#160;
get_post_custom_keys&#160; 
get_post_custom_values
get_post_meta
update_post_meta

特定のpostのデータを取り出すのであれば、get_post_customで
以下のように取り出す
$post_custom = get_post_custom() ;
$post_custom['customfielddata'][0] ;

]]></description>
			<content:encoded><![CDATA[<p><b></b></p>
<p><b>以下の関数が用意されている</b></p>
<p><b>Custom field (postmeta)</b></p>
<ul>
<li><tt><a href="http://codex.wordpress.org/Function_Reference/add_post_meta">add_post_meta</a>&#160;&#160; </tt></li>
<li><tt></tt><tt><a href="http://codex.wordpress.org/Function_Reference/delete_post_meta">delete_post_meta</a>&#160;</tt></li>
<li><tt></tt><tt><a href="http://codex.wordpress.org/Function_Reference/get_post_custom">get_post_custom</a>&#160;</tt></li>
<li><tt><a href="http://codex.wordpress.org/Function_Reference/get_post_custom_keys">get_post_custom_keys</a>&#160; </tt></li>
<li><tt><a href="http://codex.wordpress.org/Function_Reference/get_post_custom_values">get_post_custom_values</a></tt></li>
<li><tt><a href="http://codex.wordpress.org/Function_Reference/get_post_meta">get_post_meta</a></tt></li>
<li><tt><a href="http://codex.wordpress.org/Function_Reference/update_post_meta">update_post_meta</a></tt></li>
</ul>
<p>特定のpostのデータを取り出すのであれば、get_post_customで</p>
<p>以下のように取り出す</p>
<blockquote><p>$post_custom = get_post_custom() ;</p>
<p>$post_custom['customfielddata'][0] ;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/wordpress%e3%81%ae%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e5%8f%96%e3%82%8a%e5%87%ba%e3%81%99/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordPressデータベースにアクセスする</title>
		<link>http://g.azucar.jp/wordpress%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%ab%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%99%e3%82%8b</link>
		<comments>http://g.azucar.jp/wordpress%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%ab%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%99%e3%82%8b#comments</comments>
		<pubDate>Mon, 01 Feb 2010 05:30:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[wordPress]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/wordpress%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%ab%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%99%e3%82%8b</guid>
		<description><![CDATA[データベースの構造
は以下を参照
http://codex.wordpress.org/Database_Description
＊直接アクセスする場合は、バージョンアップによる、データベース構造の変更を要注意
SELECT文を実行する

テーブル名は使用せず、wpbpオブジェクトのプロパティを使用する
通常はget_resultsメソッドを使用する

$wpdb-&#62;get_results(SELECT文)

一行のみ読み込みたい場合はget_rowメソッドを使用する
フォームから入れられたデータを使用する場合は、prepareメソッドを使う

$user = $wpdb-&#62;get_results($wpdb-&#62;prepare(&#34;SELECT * FROM $wpdb-&#62;users WHERE user_login = %s&#34;,$username));       *%sは入力された文字列、数字の場合は%d



例
最新公開投稿１０件
$posts = $wpdb-&#62;get_results(&#34;SELECT * FROM $wpdb-&#62;posts WHERE post_type = &#8216;post&#8217; AND post_status = &#8216;piblish&#8217; ORDER BY post_date DESC limit 10&#34;);

最近90日間でコメントが多くついた投稿ベスト10
&#60;?php     &#160;&#160;&#160; // 集計期間を得る      &#160;&#160;&#160; $to = time();    [...]]]></description>
			<content:encoded><![CDATA[<h2>データベースの構造</h2>
<p>は以下を参照</p>
<p><a title="http://codex.wordpress.org/Database_Description" href="http://codex.wordpress.org/Database_Description">http://codex.wordpress.org/Database_Description</a></p>
<p>＊直接アクセスする場合は、バージョンアップによる、データベース構造の変更を要注意</p>
<h2>SELECT文を実行する</h2>
<ul>
<li>テーブル名は使用せず、wpbpオブジェクトのプロパティを使用する</li>
<li>通常はget_resultsメソッドを使用する</li>
<ul>
<li>$wpdb-&gt;get_results(SELECT文)</li>
</ul>
<li>一行のみ読み込みたい場合はget_rowメソッドを使用する</li>
<li>フォームから入れられたデータを使用する場合は、prepareメソッドを使う</li>
<ul>
<li>$user = $wpdb-&gt;get_results($wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;users WHERE user_login = %s&quot;,$username));       <br />*%sは入力された文字列、数字の場合は%d</li>
</ul>
<li></li>
</ul>
<h3>例</h3>
<h3>最新公開投稿１０件</h3>
<blockquote><p>$posts = $wpdb-&gt;get_results(&quot;SELECT * FROM $wpdb-&gt;posts WHERE post_type = &#8216;post&#8217; AND post_status = &#8216;piblish&#8217; ORDER BY post_date DESC limit 10&quot;);</p>
</blockquote>
<h3>最近90日間でコメントが多くついた投稿ベスト10</h3>
<blockquote><p>&lt;?php     <br />&#160;&#160;&#160; // 集計期間を得る      <br />&#160;&#160;&#160; $to = time();      <br />&#160;&#160;&#160; $from = $to &#8211; 86400 * 90;      <br />?&gt;      <br />&lt;li&gt;&lt;h2&gt;最近90日間でコメントが多くついた投稿ベスト10&lt;/h2&gt;      <br />&lt;p&gt;(集計期間：&lt;?php echo date(&#8216;Y/m/d H:i:s&#8217;, $from) ?&gt; &#8211; &lt;?php echo date(&#8216;Y/m/d H:i:s&#8217;, $to) ?&gt;)&lt;/p&gt;      <br />&lt;?php      <br />&#160;&#160;&#160; // 現在から90日前の日時をSQL用に変形する      <br />&#160;&#160;&#160; $from_sql = date(&#8216;Y-m-d H:i:s&#8217;, $from);      <br />&#160;&#160;&#160; // SQL文を作る      <br />&#160;&#160;&#160; $sql = &lt;&lt;&lt; HERE      <br />SELECT p.* , c.recent_count      <br />FROM $wpdb-&gt;posts p, (      <br />&#160;&#160;&#160; SELECT comment_post_ID, count(*) AS recent_count      <br />&#160;&#160;&#160; FROM $wpdb-&gt;comments      <br />&#160;&#160;&#160; WHERE comment_date &gt;= &#8216;$from_sql&#8217;      <br />&#160;&#160;&#160; AND comment_approved = 1      <br />&#160;&#160;&#160; GROUP BY comment_post_ID      <br />) c      <br />WHERE p.ID = c.comment_post_ID      <br />AND p.post_status = &#8216;publish&#8217;      <br />ORDER BY c.recent_count DESC      <br />LIMIT 10      <br />HERE;      <br />// SQLを実行する      <br />$posts = $wpdb-&gt;get_results($sql);      <br />// コメントがついた投稿があるときのみ、投稿のリストを出力する      <br />if ($posts) : ?&gt;      <br />&#160;&#160;&#160; &lt;ul&gt;      <br />&#160;&#160;&#160; &lt;?php foreach ($posts as $post) : setup_postdata($post); ?&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;(&lt;?php echo $post-&gt;recent_count; ?&gt;)&lt;/li&gt;      <br />&#160;&#160;&#160; &lt;?php endforeach; ?&gt;      <br />&#160;&#160;&#160; &lt;/ul&gt;      <br />&lt;?php else : ?&gt;      <br />&#160;&#160;&#160; &lt;p&gt;この期間にコメントがついた投稿はありません。&lt;/p&gt;      <br />&lt;?php endif; ?&gt;      <br />&lt;/li&gt;</p>
</blockquote>
<p>車のサイトで、カスタムキーが、メーカー、モデル、年度に定義されていて、フォード車について検索、ソートする場合</p>
<blockquote><pre>&lt;?php
$meta_key1 = 'model';
$meta_key2 = 'year';
$meta_key3 = 'manufacturer';
$meta_key3_value = 'Ford';

$postids=$wpdb-&gt;get_col($wpdb-&gt;prepare(&quot;
SELECT      key3.post_id
FROM        $wpdb-&gt;postmeta key3
INNER JOIN  $wpdb-&gt;postmeta key1
            on key1.post_id = key3.post_id
            and key1.meta_key = %s
INNER JOIN  $wpdb-&gt;postmeta key2
            on key2.post_id = key3.post_id
            and key2.meta_key = %s
WHERE       key3.meta_key = %s
            and key3.meta_value = %s
ORDER BY    key1.meta_value, key2.meta_value&quot;,$meta_key1, $meta_key2, $meta_key3, $meta_key3_value)); 

if ($postids) {
  echo 'List of $meta_key3_value . '(s), sorted by ' . $meta_key1 . ', ' . $meta_key2;
  foreach ($postids as $id) {
    $post=get_post(intval($id));
    setup_postdata($post);?&gt;
    &lt;p&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/p&gt;
    &lt;?php
  }
}
?&gt;</pre>
</blockquote>
<p>参考</p>
<ul>
<li><a title="http://codex.wordpress.org/Function_Reference/wpdb_Class" href="http://codex.wordpress.org/Function_Reference/wpdb_Class">http://codex.wordpress.org/Function_Reference/wpdb_Class</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/wordpress%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%ab%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%99%e3%82%8b/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressの携帯用にリッチエディターをfontで出力させたい</title>
		<link>http://g.azucar.jp/wordpress%e3%81%ae%e6%90%ba%e5%b8%af%e7%94%a8%e3%81%ab%e3%83%aa%e3%83%83%e3%83%81%e3%82%a8%e3%83%87%e3%82%a3%e3%82%bf%e3%83%bc%e3%82%92font%e3%81%a7%e5%87%ba%e5%8a%9b%e3%81%95%e3%81%9b%e3%81%9f</link>
		<comments>http://g.azucar.jp/wordpress%e3%81%ae%e6%90%ba%e5%b8%af%e7%94%a8%e3%81%ab%e3%83%aa%e3%83%83%e3%83%81%e3%82%a8%e3%83%87%e3%82%a3%e3%82%bf%e3%83%bc%e3%82%92font%e3%81%a7%e5%87%ba%e5%8a%9b%e3%81%95%e3%81%9b%e3%81%9f#comments</comments>
		<pubDate>Sun, 24 Jan 2010 13:16:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordPress]]></category>
		<category><![CDATA[携帯]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/wordpress%e3%81%ae%e6%90%ba%e5%b8%af%e7%94%a8%e3%81%ab%e3%83%aa%e3%83%83%e3%83%81%e3%82%a8%e3%83%87%e3%82%a3%e3%82%bf%e3%83%bc%e3%82%92font%e3%81%a7%e5%87%ba%e5%8a%9b%e3%81%95%e3%81%9b%e3%81%9f</guid>
		<description><![CDATA[WordPressのリッチエディターは、TinyMCEらしい。このエディターは最近フォントの色の修飾は以下のようなコードを吐き出す。
&#60;span style=&#34;color: rgb(255, 204, 0);&#34;&#62;★&#60;/span&#62;

これは、xhtmlへの対応と思われるが、おそらく古い携帯では対応できない。すると安全簡単なのは、以下のようなコードとなる
&#60;font color=&#34;#008000&#34;&#62;ボーダーのBIGロゴ&#60;/font&#62;

対応としては何個か方法があるとおもう。

tinyMCEの設定を変える

ちょっと難しそうだが、学習しておいて損がなさそう 


spanをfontに正規表現などをつかって変換してしまう

プラグインでトリッキーだが、正規表現を覚えるいい機会 


リッチエディターを変える

これはできたら避けたい 



である。
ちなみにtinyMCE.initに
force_hex_style_colors : true      ＊初期設定のrgbの１０進を１６進に変更と想像がつく

を追加してみると、１６進数で出力されている。こうなると単純な置換なので、
&#60;span style=&#34;color: #ff6600;&#34;&#62;teste&#60;/span&#62;
↓
&#60;font color=&#34;#ff6600&#34;&#62;teste&#60;/font&#62;

これをcontentにたいするテンプレートのフィルターとしてfunction.phpに追加すればいいので、以下を追加する

function ks_content_filter($content) {
    $pattern = &#8216;&#60;span style=&#34;color: (.*?);(.*?)&#60;/span&#62;&#8217;; 
$replease =&#8217;&#60;font color=&#34;\\1\\2&#60;/font&#62;&#8217;; 
return mberegi_replace($pattern,$replease,$content); 
} 
add_filter(&#8216;the_content&#8217;,'ks_content_filter&#8217;);

これでとりあえず、携帯でもfontタグが出力された
&#160;
課題

本来なら携帯のテンプレートに対して行うべきだったが、携帯サイトでプログラム化されていて、変更がむずかしそうだったので、タグ全体を置換した 
phpの正規表現で置換処理というのがいいソースがみつからず、試行錯誤になった 

参考

http://homepage2.nifty.com/sak/w_sak3/doc/sysbrd/php_k09.htm 
http://www.rider-n.sakura.ne.jp/regexp/regexp.php 
http://www.mtblue.org/pc/web/regular_expression.php 

]]></description>
			<content:encoded><![CDATA[<p>WordPressのリッチエディターは、TinyMCEらしい。このエディターは最近フォントの色の修飾は以下のようなコードを吐き出す。</p>
<blockquote><p>&lt;span style=&quot;color: rgb(255, 204, 0);&quot;&gt;★&lt;/span&gt;</p>
</blockquote>
<p>これは、xhtmlへの対応と思われるが、おそらく古い携帯では対応できない。すると安全簡単なのは、以下のようなコードとなる</p>
<blockquote><p>&lt;font color=&quot;#008000&quot;&gt;ボーダーのBIGロゴ&lt;/font&gt;</p>
</blockquote>
<p>対応としては何個か方法があるとおもう。</p>
<ul>
<li>tinyMCEの設定を変える
<ul>
<li>ちょっと難しそうだが、学習しておいて損がなさそう </li>
</ul>
</li>
<li>spanをfontに正規表現などをつかって変換してしまう
<ul>
<li>プラグインでトリッキーだが、正規表現を覚えるいい機会 </li>
</ul>
</li>
<li>リッチエディターを変える
<ul>
<li>これはできたら避けたい </li>
</ul>
</li>
</ul>
<p>である。</p>
<p>ちなみにtinyMCE.initに</p>
<blockquote><p>force_hex_style_colors : true      <br />＊初期設定のrgbの１０進を１６進に変更と想像がつく</p>
</blockquote>
<p>を追加してみると、１６進数で出力されている。こうなると単純な置換なので、</p>
<blockquote><pre>&lt;span style=&quot;color: #ff6600;&quot;&gt;teste&lt;/span&gt;</pre>
<p>↓</p>
<p>&lt;font color=&quot;#ff6600&quot;&gt;teste&lt;/font&gt;</p>
</blockquote>
<p>これをcontentにたいするテンプレートのフィルターとしてfunction.phpに追加すればいいので、以下を追加する</p>
<blockquote>
<p>function ks_content_filter($content) {<br />
    <br />$pattern = &#8216;&lt;span style=&quot;color: (.*?);(.*?)&lt;/span&gt;&#8217;; </p>
<p>$replease =&#8217;&lt;font color=&quot;\\1\\2&lt;/font&gt;&#8217;; </p>
<p>return mberegi_replace($pattern,$replease,$content); </p>
<p>} </p>
<p>add_filter(&#8216;the_content&#8217;,'ks_content_filter&#8217;);</p>
</blockquote>
<p>これでとりあえず、携帯でもfontタグが出力された</p>
<p>&#160;</p>
<p>課題</p>
<ul>
<li>本来なら携帯のテンプレートに対して行うべきだったが、携帯サイトでプログラム化されていて、変更がむずかしそうだったので、タグ全体を置換した </li>
<li>phpの正規表現で置換処理というのがいいソースがみつからず、試行錯誤になった </li>
</ul>
<p>参考</p>
<ul>
<li><a title="http://homepage2.nifty.com/sak/w_sak3/doc/sysbrd/php_k09.htm" href="http://homepage2.nifty.com/sak/w_sak3/doc/sysbrd/php_k09.htm">http://homepage2.nifty.com/sak/w_sak3/doc/sysbrd/php_k09.htm</a> </li>
<li><a title="http://www.rider-n.sakura.ne.jp/regexp/regexp.php" href="http://www.rider-n.sakura.ne.jp/regexp/regexp.php">http://www.rider-n.sakura.ne.jp/regexp/regexp.php</a> </li>
<li><a title="http://www.mtblue.org/pc/web/regular_expression.php" href="http://www.mtblue.org/pc/web/regular_expression.php">http://www.mtblue.org/pc/web/regular_expression.php</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/wordpress%e3%81%ae%e6%90%ba%e5%b8%af%e7%94%a8%e3%81%ab%e3%83%aa%e3%83%83%e3%83%81%e3%82%a8%e3%83%87%e3%82%a3%e3%82%bf%e3%83%bc%e3%82%92font%e3%81%a7%e5%87%ba%e5%8a%9b%e3%81%95%e3%81%9b%e3%81%9f/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>プラグインのメモ</title>
		<link>http://g.azucar.jp/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%83%a1%e3%83%a2</link>
		<comments>http://g.azucar.jp/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%83%a1%e3%83%a2#comments</comments>
		<pubDate>Sun, 24 Jan 2010 00:00:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordPress]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%83%a1%e3%83%a2</guid>
		<description><![CDATA[プラグインには以下用法がある
アクション
wordPressの関数にフック
&#60;?php      /*       Plugin Name:       Plugin URI:       Description:       Version: 
Author:      Author URI:       */ 
function add_meta_keyword() { [...]]]></description>
			<content:encoded><![CDATA[<p>プラグインには以下用法がある</p>
<h2>アクション</h2>
<p>wordPressの関数にフック</p>
<blockquote><p>&lt;?php      <br />/*       <br />Plugin Name:       <br />Plugin URI:       <br />Description:       <br />Version: </p>
<p>Author:      <br />Author URI:       <br />*/ </p>
<p>function add_meta_keyword() {      <br />&#160;&#160;&#160; global $wp_query; </p>
<p>&#160;&#160;&#160; // 単体投稿ページでなければ何もしない      <br />&#160;&#160;&#160; if (!is_single()) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;       <br />&#160;&#160;&#160; }       <br />&#160;&#160;&#160; // カスタムフィールドの値を得る       <br />&#160;&#160;&#160; $post = $wp_query-&gt;get_queried_object();       <br />&#160;&#160;&#160; $custom = get_post_custom($post-&gt;ID);       <br />&#160;&#160;&#160; // 「keywords」カスタムフィールドに値があれば、それをmetaタグとして出力する       <br />&#160;&#160;&#160; if ($custom['keywords']) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo &#8216;&lt;meta name=&quot;keywords&quot; content=&quot;&#8217; . implode(&#8216;,&#8217;, $custom['keywords']) . &quot;\&quot; /&gt;\n&quot;;       <br />&#160;&#160;&#160; }       <br />} </p>
<p>add_action(&#8216;wp_head&#8217;, &#8216;add_meta_keyword&#8217;);      <br />?&gt;</p>
</blockquote>
<h2>フィルター</h2>
<p>wordPressの関数に文字列のフィルターをかける</p>
<blockquote><blockquote>
<p>&lt;?php        <br />/*         <br />Plugin Name:         <br />Plugin URI: </p>
<p>Description: </p>
<p>Author:        <br />Author URI:         <br />*/ </p>
<p>function conv_zen_han($content) {        <br />&#160;&#160;&#160; return mb_convert_kana($content, &#8216;a&#8217;, &#8216;utf-8&#8242;);         <br />} </p>
<p>add_filter(&#8216;the_title&#8217;, &#8216;conv_zen_han&#8217;);        <br />?&gt;</p>
</blockquote>
</blockquote>
<h2>テンプレート内での利用</h2>
<p>共通関数として、プラグイン内に書き利用できる</p>
<h2>プラグイン自体をフィルターに対応させる</h2>
<p>以下を関数内に出力前に記述する</p>
<blockquote><p>$out = apply_filters(&#8217;same_category_posts&#8217;, $out);</p>
<p>//$outがそのプラグイン関数の出力とする</p>
</blockquote>
<h2>ＪavaScriptライブラリーを読み込む</h2>
<p>initにフックさせる</p>
<blockquote><p>&lt;?php      <br />/*       <br />Plugin Name: Clock       <br />Plugin URI: <a href="http://www.h-fj.com/blog/wpplgdoc/">http://www.h-fj.com/blog/wpplgdoc/</a>       <br />Description: 各ページの先頭に現在時刻を表示します       <br />Version: 1.0       <br />Author: 藤本 壱       <br />Author URI: <a href="http://www.h-fj.com/blog/">http://www.h-fj.com/blog/</a>       <br />*/ </p>
<p>function add_clock_js() {      <br />&#160;&#160;&#160; // jQueryを使うことをWordPressに伝える       <br />&#160;&#160;&#160; wp_enqueue_script(&#8216;jquery&#8217;);       <br />&#160;&#160;&#160; // clock.jsのアドレスを求める       <br />&#160;&#160;&#160; $plugin_dir = str_replace(basename(__FILE__), &quot;&quot;, plugin_basename(__FILE__));       <br />&#160;&#160;&#160; $clock_js = WP_PLUGIN_URL . &#8216;/&#8217; . $plugin_dir . &#8216;js/clock.js&#8217;;       <br />&#160;&#160;&#160; // clock.jsを読み込む       <br />&#160;&#160;&#160; wp_enqueue_script(&#8216;clockscript&#8217;, $clock_js, array(&#8216;jquery&#8217;));       <br />} </p>
<p>add_action(&#8216;init&#8217;, &#8216;add_clock_js&#8217;);      <br />?&gt;</p>
</blockquote>
<p>参考</p>
<ul>
<li><a title="http://wpdocs.sourceforge.jp/%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3_API" href="http://wpdocs.sourceforge.jp/%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3_API">http://wpdocs.sourceforge.jp/%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3_API</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e3%83%a1%e3%83%a2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>データベースから直接データをとりだす</title>
		<link>http://g.azucar.jp/%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%8b%e3%82%89%e7%9b%b4%e6%8e%a5%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e3%81%a8%e3%82%8a%e3%81%a0%e3%81%99</link>
		<comments>http://g.azucar.jp/%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%8b%e3%82%89%e7%9b%b4%e6%8e%a5%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e3%81%a8%e3%82%8a%e3%81%a0%e3%81%99#comments</comments>
		<pubDate>Sat, 23 Jan 2010 01:27:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%8b%e3%82%89%e7%9b%b4%e6%8e%a5%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e3%81%a8%e3%82%8a%e3%81%a0%e3%81%99</guid>
		<description><![CDATA[
wordPressのテーブル名は以下のようになる
$wpdb-&#62;posts
$wpdb-&#62;categories


クエリを送信 
$wpdb-&#62;query("…");


データベースから変数をとりだす
&#60;?php
$user_count = $wpdb-&#62;get_var($wpdb-&#62;prepare("SELECT COUNT(*) FROM $wpdb-&#62;users;"));
echo '&#60;p&#62;現ユーザー数は、' . $user_count . '人です。&#60;/p&#62;';
?&#62;


レコードを1行だけ取得
$mylink = $wpdb-&#62;get_row("SELECT * FROM $wpdb-&#62;links WHERE link_id = 10");

複数行のレコードを取得
$rows = $wpdb-&#62;get_results("SELECT * FROM …");
foreach ($rows as $row) {
  echo $row-&#62;post_title;
}

参考

http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/wpdb_Class

&#160;
]]></description>
			<content:encoded><![CDATA[<blockquote></blockquote>
<pre><code>wordPressのテーブル名は以下のようになる</code></pre>
<blockquote><pre><code>$wpdb-&gt;posts
$wpdb-&gt;categories
</code></pre>
</blockquote>
<h4>クエリを送信 </h4>
<blockquote><pre><code>$wpdb-&gt;query("…");
</code></pre>
</blockquote>
<p>データベースから変数をとりだす</p>
<blockquote><pre>&lt;?php
$user_count = $wpdb-&gt;get_var($wpdb-&gt;prepare("SELECT COUNT(*) FROM $wpdb-&gt;users;"));
echo '&lt;p&gt;現ユーザー数は、' . $user_count . '人です。&lt;/p&gt;';
?&gt;
</pre>
</blockquote>
<p>レコードを1行だけ取得</p>
<blockquote><pre><code>$mylink = $wpdb-&gt;get_row("SELECT * FROM $wpdb-&gt;links WHERE link_id = 10");</code></pre>
</blockquote>
<pre>複数行のレコードを取得</pre>
<blockquote><pre><code>$rows = $wpdb-&gt;get_results("SELECT * FROM …");
foreach ($rows as $row) {
  echo $row-&gt;post_title;
}</code></pre>
</blockquote>
<p>参考</p>
<ul>
<li><a title="http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/wpdb_Class" href="http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/wpdb_Class">http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/wpdb_Class</a></li>
</ul>
<pre>&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%8b%e3%82%89%e7%9b%b4%e6%8e%a5%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e3%81%a8%e3%82%8a%e3%81%a0%e3%81%99/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>特定のカテゴリの最新５件タイトルを表示する</title>
		<link>http://g.azucar.jp/%e7%89%b9%e5%ae%9a%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%81%ae%e6%9c%80%e6%96%b0%ef%bc%95%e4%bb%b6%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b</link>
		<comments>http://g.azucar.jp/%e7%89%b9%e5%ae%9a%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%81%ae%e6%9c%80%e6%96%b0%ef%bc%95%e4%bb%b6%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b#comments</comments>
		<pubDate>Sat, 23 Jan 2010 00:30:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[template]]></category>
		<category><![CDATA[wordPress]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/%e7%89%b9%e5%ae%9a%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%81%ae%e6%9c%80%e6%96%b0%ef%bc%95%e4%bb%b6%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b</guid>
		<description><![CDATA[カテゴリーid 5の場合
&#60;h2&#62;最新ニュース&#60;/h2&#62;     &#60;ul class=&#34;list&#34;&#62;      &#60;?php $posts = get_posts(&#8216;numberposts=5&#38;orderby=post_date&#38;category=9&#8242;);      foreach($posts as $post):      setup_postdata($post); ?&#62;      &#60;li&#62;&#60;a href=&#34;&#60;?php the_permalink(); ?&#62;&#34; id=&#34;post-&#60;?php the_ID(); ?&#62;&#34;&#62;&#60;?php the_title(); ?&#62;&#60;/a&#62; &#60;?php the_time(&#8216;y年m月d日&#8217;); ?&#62;&#60;/li&#62;      &#60;?php [...]]]></description>
			<content:encoded><![CDATA[<p>カテゴリーid 5の場合</p>
<blockquote><p>&lt;h2&gt;最新ニュース&lt;/h2&gt;     <br />&lt;ul class=&quot;list&quot;&gt;      <br />&lt;?php $posts = get_posts(&#8216;numberposts=5&amp;orderby=post_date&amp;category=9&#8242;);      <br />foreach($posts as $post):      <br />setup_postdata($post); ?&gt;      <br />&lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;?php the_time(&#8216;y年m月d日&#8217;); ?&gt;&lt;/li&gt;      <br />&lt;?php endforeach; ?&gt;      <br />&lt;div class=&quot;next&quot;&gt;&lt;a href=&quot;&lt;?php bloginfo(&#8217;siteurl&#8217;); ?&gt;/?cat=9&quot;&gt;&lt;/a&gt;&lt;/div&gt;      <br />&lt;/ul&gt;      </p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/%e7%89%b9%e5%ae%9a%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%81%ae%e6%9c%80%e6%96%b0%ef%bc%95%e4%bb%b6%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>投稿をアルファベット順にならべインデックス化する</title>
		<link>http://g.azucar.jp/%e6%8a%95%e7%a8%bf%e3%82%92%e3%82%a2%e3%83%ab%e3%83%95%e3%82%a1%e3%83%99%e3%83%83%e3%83%88%e9%a0%86%e3%81%ab%e3%81%aa%e3%82%89%e3%81%b9%e3%82%a4%e3%83%b3%e3%83%87%e3%83%83%e3%82%af%e3%82%b9%e5%8c%96</link>
		<comments>http://g.azucar.jp/%e6%8a%95%e7%a8%bf%e3%82%92%e3%82%a2%e3%83%ab%e3%83%95%e3%82%a1%e3%83%99%e3%83%83%e3%83%88%e9%a0%86%e3%81%ab%e3%81%aa%e3%82%89%e3%81%b9%e3%82%a4%e3%83%b3%e3%83%87%e3%83%83%e3%82%af%e3%82%b9%e5%8c%96#comments</comments>
		<pubDate>Thu, 14 Jan 2010 01:19:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordPress]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/%e6%8a%95%e7%a8%bf%e3%82%92%e3%82%a2%e3%83%ab%e3%83%95%e3%82%a1%e3%83%99%e3%83%83%e3%83%88%e9%a0%86%e3%81%ab%e3%81%aa%e3%82%89%e3%81%b9%e3%82%a4%e3%83%b3%e3%83%87%e3%83%83%e3%82%af%e3%82%b9%e5%8c%96</guid>
		<description><![CDATA[記事をインデックスをつけてアルファベット順一覧にしたい。
例によってwordpress.orgでサーチすると、以下がよさそうだ。
http://wordpress.org/extend/plugins/azindex/
しかし、こちらは一ページにすべてのタイトルを表示するので、量が多い場合醜くなる場合があり、用語解説的な用途と思われ、今回はパス
その他を検討した結果こちらのプラグインに
http://wordpress.org/extend/plugins/wp-snap/
&#160;
こちらのプラグインの欠点としてページングの機能がない。そして、すべてを表示のとき、アルファベット順に表示される。すべて表示は時系列にさせたい。なぜなら、アルファベット順はタグ化されるのでいらないから。３っ箇所強引に変更することにした。
１．RECENT指定のときは、wordPressの標準の機能をつかう
$wp_query-&#62;post_count = count($all_posts);     &#160;&#160;&#160;&#160;&#160;&#160;&#160; $wp_query-&#62;posts = $all_posts;
を
if ($this-&#62;first_letters !== NULL) { 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; $wp_query-&#62;post_count = count($all_posts);     &#160;&#160;&#160;&#160;&#160;&#160;&#160; $wp_query-&#62;posts = $all_posts;      &#160;&#160;&#160; }
上記の処理によって、アルファベット指定されていないとき、配列のポインター処理がスキップされる。すなわちwordPressの標準機能で動作する。

２．すべて表示の場合は、wordPressの標準のページング機能を使用する
以下のコードと適当なテンプレートに挿入する
&#60;?php if($_GET[&#34;snap&#34;]==NULL){ ?&#62;     &#60;div class=&#34;navigation&#34;&#62;      &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;div class=&#34;alignleft&#34;&#62;&#60;?php next_posts_link(&#8216;&#38;laquo; Older Entries&#8217;) ?&#62;&#60;/div&#62;  [...]]]></description>
			<content:encoded><![CDATA[<p>記事をインデックスをつけてアルファベット順一覧にしたい。</p>
<p>例によってwordpress.orgでサーチすると、以下がよさそうだ。</p>
<p><a title="http://wordpress.org/extend/plugins/azindex/" href="http://wordpress.org/extend/plugins/azindex/">http://wordpress.org/extend/plugins/azindex/</a></p>
<p>しかし、こちらは一ページにすべてのタイトルを表示するので、量が多い場合醜くなる場合があり、用語解説的な用途と思われ、今回はパス</p>
<p>その他を検討した結果こちらのプラグインに</p>
<p><a title="http://wordpress.org/extend/plugins/wp-snap/" href="http://wordpress.org/extend/plugins/wp-snap/">http://wordpress.org/extend/plugins/wp-snap/</a></p>
<p>&#160;</p>
<p>こちらのプラグインの欠点としてページングの機能がない。そして、すべてを表示のとき、アルファベット順に表示される。すべて表示は時系列にさせたい。なぜなら、アルファベット順はタグ化されるのでいらないから。３っ箇所強引に変更することにした。</p>
<p>１．RECENT指定のときは、wordPressの標準の機能をつかう</p>
<blockquote><p>$wp_query-&gt;post_count = count($all_posts);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $wp_query-&gt;posts = $all_posts;</p>
<p>を</p>
<p>if ($this-&gt;first_letters !== NULL) { </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; $wp_query-&gt;post_count = count($all_posts);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $wp_query-&gt;posts = $all_posts;      <br />&#160;&#160;&#160; }</p>
<p>上記の処理によって、アルファベット指定されていないとき、配列のポインター処理がスキップされる。すなわちwordPressの標準機能で動作する。</p>
</blockquote>
<p>２．すべて表示の場合は、wordPressの標準のページング機能を使用する</p>
<blockquote><p>以下のコードと適当なテンプレートに挿入する</p>
<p>&lt;?php if($_GET[&quot;snap&quot;]==NULL){ ?&gt;     <br />&lt;div class=&quot;navigation&quot;&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link(&#8216;&amp;laquo; Older Entries&#8217;) ?&gt;&lt;/div&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link(&#8216;Newer Entries &amp;raquo;&#8217;) ?&gt;&lt;/div&gt;</p>
<p>これによってアルファベット指定されていないとき、wordPressの標準ページング機能が動作する</p>
</blockquote>
<p>３．ALLの表示をタブに追加する</p>
<p>&#160;</p>
<blockquote><p>// Check if ALL posts are to be displayed on first load     <br />&#160;&#160;&#160; if ($this-&gt;firstload == &#8216;ALL&#8217;) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $results .= $num_tabs . &quot;\t&lt;li&quot;;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($this-&gt;first_letters == &#8216;#0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8217;) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $results .= &#8216; class=&quot;&#8217; . $wp_snap_options['csscls2'] . &#8216;&quot;&#8217;;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $results .= &#8216;&gt;&lt;a href=&quot;&#8217; . $url . &#8216;&quot;&#8217;;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $results .= &#8216;&gt;ALL&#8217;;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ($this-&gt;first_letters !== &#8216;#0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8217;) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $results .= &#8216;&lt;/a&gt;&#8217;;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $results .= &quot;&lt;/li&gt;\n&quot;;      <br />&#160;&#160;&#160; }</p>
<p>&#160;</p>
<p>を以下に変更する</p>
<p>$results .= $num_tabs . &quot;\t&lt;li&quot;;     <br />if ($this-&gt;first_letters == &#8216;#0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8217;) {      <br />&#160;&#160;&#160; $results .= &#8216; class=&quot;&#8217; . $wp_snap_options['csscls2'] . &#8216;&quot;&#8217;;      <br />} else {      <br />&#160;&#160;&#160; $results .= &#8216;&gt;&lt;a href=&quot;&#8217; . $url . &#8216;&quot;&#8217;;      <br />}      <br />$results .= &#8216;&gt;ALL&#8217;;      <br />if ($this-&gt;first_letters !== &#8216;#0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8217;) {      <br />&#160;&#160;&#160; $results .= &#8216;&lt;/a&gt;&#8217;;      <br />}      <br />$results .= &quot;&lt;/li&gt;\n&quot;;</p>
</blockquote>
<h2>&#160;</h2>
<h2>課題</h2>
<p>アルファベット指定されたときのページング機能はない。おそらく配列ポインターの指定を解析し、修正すればできると思う。また、jQueryなどを使用して、ページ推移なしにページング機能を実現するのもよさそうだ。だが、アルファベット指定されたとき、全て表示されるのにクライアント側が希望したので、そのままにしておいた。ちなみにこの作者のコメントによると「ページングか、問題あるのしっているけど、時間がないんだ」だそうだ。</p>
<p>&#160;</p>
<p>参考</p>
<ul>
<li><a title="http://wordpress.org/extend/plugins/tags/alphabetical" href="http://wordpress.org/extend/plugins/tags/alphabetical">http://wordpress.org/extend/plugins/tags/alphabetical</a> </li>
<li><a title="http://www.nateomedia.com/wares/downloads/wordpress/wp-snap/" href="http://www.nateomedia.com/wares/downloads/wordpress/wp-snap/">http://www.nateomedia.com/wares/downloads/wordpress/wp-snap/</a> </li>
<li><a title="http://minhd.net/2009/10/13/jquery-pagination-system/" href="http://minhd.net/2009/10/13/jquery-pagination-system/">http://minhd.net/2009/10/13/jquery-pagination-system/</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/%e6%8a%95%e7%a8%bf%e3%82%92%e3%82%a2%e3%83%ab%e3%83%95%e3%82%a1%e3%83%99%e3%83%83%e3%83%88%e9%a0%86%e3%81%ab%e3%81%aa%e3%82%89%e3%81%b9%e3%82%a4%e3%83%b3%e3%83%87%e3%83%83%e3%82%af%e3%82%b9%e5%8c%96/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>user warning: Duplicate entry ***</title>
		<link>http://g.azucar.jp/user-warning-duplicate-entry</link>
		<comments>http://g.azucar.jp/user-warning-duplicate-entry#comments</comments>
		<pubDate>Thu, 31 Dec 2009 02:08:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://g.azucar.jp/user-warning-duplicate-entry</guid>
		<description><![CDATA[Drupalをコピーして、他のサイトでコピーして、ポストしようとすると下記のようなエラーがでたりする。
 
この場合は、投稿のID管理のシークエンスが狂っている可能があり、Mysqlのデータ
_sequences の_node_nid、dru_node_revisions_vidを最新nodeのidより大きくすればいい
http://drupal.org/node/140102
]]></description>
			<content:encoded><![CDATA[<p>Drupalをコピーして、他のサイトでコピーして、ポストしようとすると下記のようなエラーがでたりする。</p>
<p><a href="http://g.azucar.jp/wp-content/uploads/2009/12/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://g.azucar.jp/wp-content/uploads/2009/12/image_thumb.png" width="484" height="231" /></a> </p>
<p>この場合は、投稿のID管理のシークエンスが狂っている可能があり、Mysqlのデータ</p>
<p>_sequences の_node_nid、dru_node_revisions_vidを最新nodeのidより大きくすればいい</p>
<p><a title="http://drupal.org/node/140102" href="http://drupal.org/node/140102">http://drupal.org/node/140102</a></p>
]]></content:encoded>
			<wfw:commentRss>http://g.azucar.jp/user-warning-duplicate-entry/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
