<?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>GettingOUT &#187; WordPress</title>
	<atom:link href="http://mori.moripower.jp/category/eqwip/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://mori.moripower.jp</link>
	<description>ロングボーダー社長のブログ</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:48:21 +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>MoriP Star Rating プラグイン？</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/1561.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/1561.html#comments</comments>
		<pubDate>Mon, 26 Dec 2011 16:14:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=1561</guid>
		<description><![CDATA[コメントに☆でレーティング（評価）をつけるプラグインを探しまくったのですが、なかなか良いものが無く、結局プラグインを自作することになりました。 記事やページに、☆でレーティングを付けるものはあるんですが、コメントに付ける [...]]]></description>
			<content:encoded><![CDATA[<p>コメントに☆でレーティング（評価）をつけるプラグインを探しまくったのですが、なかなか良いものが無く、結局プラグインを自作することになりました。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/12/m20111227-1.jpg" rel="lightbox[1561]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/12/m20111227-1-300x166.jpg" alt="" title="m20111227-1" width="300" height="166" class="alignnone size-medium wp-image-1568" /></a></p>
<p>記事やページに、☆でレーティングを付けるものはあるんですが、コメントに付けるコレは！というプラグインは探しきれませんでした。</p>
<p>このブログでも使えるようにしろよ！って感じかもしれませんが、ゴリゴリ下記のサイト用に作っているので、汎用化されてません・・・。（それはプラグインと言わんだろう。）</p>
<p><a href="http://mp.gamelearning.jp/gcs/" target="_blank">ＧＣＳ学生ゲーム投稿サイト</a></p>
<p>正月中にプラグイン化できるか？</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/1561.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressをむりやり復旧</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/1532.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/1532.html#comments</comments>
		<pubDate>Tue, 06 Dec 2011 15:41:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=1532</guid>
		<description><![CDATA[自分のブログサイト（このブログ）で、いろいろ実験をしていたら、Wordpressのテーブル(options)を誤って削除してしまった。 サイトはもちろん、管理画面も表示できず。バックアップ取ってなかったので、真っ青・・・ [...]]]></description>
			<content:encoded><![CDATA[<p>自分のブログサイト（このブログ）で、いろいろ実験をしていたら、Wordpressのテーブル(options)を誤って削除してしまった。</p>
<p>サイトはもちろん、管理画面も表示できず。バックアップ取ってなかったので、真っ青・・・。</p>
<p>別のWordpressサイトから、optionsテーブルをそのまま持ってきてsiteurlをとりあえず直接修正したら管理画面が表示された。</p>
<p>サイトは表示されなかったので、何故？</p>
<p>と思いつつ・・・、管理画面を良く見たらテーマが変だったようで、テーマを管理画面から指定しなおしたら、このブログサイトも無事表示されました。</p>
<p>削除してしまったのがoptionsテーブルで幸いだった。これがpostsテーブルだったらアウトでした。（このサイト結構アクセスあるし）</p>
<p>これに懲りて、<a href="http://wordpress.org/extend/plugins/wp-dbmanager/" title="WP-DBManager" target="_blank">WP-DBManager</a>プラグインを導入しました。<br />
どんな場合もバックアップは必要だね。やっぱり。</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/1532.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressの画像等の直リンクを禁止する</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/1296.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/1296.html#comments</comments>
		<pubDate>Wed, 22 Jun 2011 13:42:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=1296</guid>
		<description><![CDATA[WordPressで、会員サイトを作る場合、まず必ずログインさせ必ず認証させる必要があります。このあたりは、WordPressに認証をつけるで方法を紹介しています。 しかし、この方法だとWordpressのアップデートを [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressで、会員サイトを作る場合、まず必ずログインさせ必ず認証させる必要があります。このあたりは、<a href="http://mori.moripower.jp/eqwip/wordpress/753.html">WordPressに認証をつける</a>で方法を紹介しています。</p>
<p>しかし、この方法だとWordpressのアップデートをする度に、コードが上書きされてしまいログインしないでコンテンツが見られてしまうという「うっかりミス」が起こることがあります。一番よいのは、themeのテンプレートのヘッダーで、下記のコードを記述するのが良いのですが・・・・</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_user_logged_in<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
auth_redirect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>
<p>この難点は、アップロードした画像やPDFファイルが直リンクで見られてしまうことです。ヘッダーでログインリダイレクトを記述するということは、theme以降でログイン制御が走ることになるので、themeフォルダに関連しないものはログインしないで見られてしまうようです。</p>
<p>そこで、themeからリンクされて見ること以外に直リンクで閲覧を禁止する必要が出てきます。具体的には、uploadsフォルダに「.htaccess」を置き、直リンクでの閲覧を禁止するようにします。</p>
<p>サーバによって記載の仕方は2通りあるようです。レンタルサーバにより異なります。</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SetEnvIf Referer <span style="color: #0000ff;">&quot;^http://mori\.moripower\.jp&quot;</span> ShowOK<br />
order deny<span style="color: #339933;">,</span>allow<br />
deny from all<br />
allow from env<span style="color: #339933;">=</span>ShowOK</div></div>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">RewriteEngine On<br />
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_REFERER<span style="color: #009900;">&#125;</span> <span style="color: #339933;">!</span>^http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//mori\.moripower\.jp[NC]</span><br />
RewriteRule \<span style="color: #339933;">.</span><span style="color: #009900;">&#40;</span>jpg<span style="color: #339933;">|</span>png<span style="color: #339933;">|</span>gif<span style="color: #339933;">|</span>txt<span style="color: #339933;">|</span>pdf<span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">-</span> <span style="color: #009900;">&#91;</span>F<span style="color: #009900;">&#93;</span></div></div>
<p><span style="color: #ff0000; font-weight: bolder;">テスト</span><br />
ちなみに、下記の画像はクリックで見れますが、ＵＲＬをブラウザに直接貼り付けては見ることができません。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/06/mp20110622.jpg" rel="lightbox[1296]"><img class="alignnone size-medium wp-image-1305" title="mp20110622" src="http://mori.moripower.jp/wp-content/uploads/2011/06/mp20110622-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>URL：　http://mori.moripower.jp/wp-content/uploads/2011/06/mp20110622.jpg<br />
ブラウザキャッシュをクリアしてから実験してね。</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/1296.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress プラグイン制作　その３</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/1253.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/1253.html#comments</comments>
		<pubDate>Wed, 20 Apr 2011 11:04:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=1253</guid>
		<description><![CDATA[(1) form内に、編集しpostするためのinputタグを作ります。 &#60;form method=&#34;post&#34; action=&#34;&#60;?php echo str_replace&# [...]]]></description>
			<content:encoded><![CDATA[<p>(1) form内に、編集しpostするためのinputタグを作ります。</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:450px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;form method=&quot;post&quot; action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%7E'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'~'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<br />
&nbsp; &nbsp; &lt;ul&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;行番号：&lt;input disabled type=&quot;text&quot; id=&quot;disp_id&quot; size=&quot;3&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;hidden&quot; id=&quot;id&quot; name=&quot;id&quot; /&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;氏名：&lt;input type=&quot;text&quot; id=&quot;name&quot; name=&quot;name&quot; /&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;年令：&lt;input type=&quot;text&quot; id=&quot;age&quot; name=&quot;age&quot; size=&quot;3&quot; /&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;社員番号：&lt;input type=&quot;text&quot; id=&quot;employee_no&quot; name=&quot;employee_no&quot; /&gt;&lt;/li&gt;<br />
&nbsp; &nbsp; &lt;/ul&gt;<br />
&nbsp; &nbsp; &lt;div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;radio&quot; id=&quot;edit&quot; value=&quot;1&quot; name=&quot;radio&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;Label for=&quot;edit&quot;&gt;更新&lt;/Label&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;radio&quot; id=&quot;add&quot; value=&quot;2&quot; name=&quot;radio&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;Label for=&quot;add&quot;&gt;追加&lt;/Label&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;radio&quot; id=&quot;delete&quot; value=&quot;3&quot; name=&quot;radio&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;Label for=&quot;delete&quot;&gt;削除&lt;/Label&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;実行&quot; /&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&quot;button&quot; value=&quot;クリア&quot; onclick=&quot;clear_field();&quot; /&gt;<br />
&nbsp; &nbsp; &lt;/div&gt;<br />
&lt;/form&gt;</div></div>
<p>・field_copy() javascirtで、form内のinputにそれぞれコピーし適宜変更します。<br />
・ラジオボタンで、更新、追加、削除をつけて、テーブル操作を指定します。<br />
・post先は、この関数自身です。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/04/m20110420-2.jpeg" rel="lightbox[1253]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/04/m20110420-2-300x71.jpg" alt="m20110420-2" title="m20110420-2" width="300" height="71" class="alignnone size-medium wp-image-1271" /></a></p>
<p><strong>(2) postで呼ばれた時の処理を作ります。</strong></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #666666; font-style: italic;">//POSTデータの設定</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/strcmp"><span style="color: #990000;">strcmp</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <a href="http://www.php.net/strcmp"><span style="color: #990000;">strcmp</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'radio'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$data</span> <span style="color: #339933;">+=</span> <a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> ? <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span> &nbsp; <br />
<span style="color: #666666; font-style: italic;">//実行ボタンを押した場合</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; 〜実行ボタンを押してデータが渡されたときの処理〜<br />
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&lt;table&gt;<br />
&nbsp; &nbsp; 〜WordPress プラグイン制作　その２ (3)省略〜<br />
&lt;/table&gt;<br />
&lt;form&gt;<br />
&nbsp; &nbsp; 〜上記(1)省略〜<br />
&lt;/form&gt;</div></div>
<p>・postで渡されたデータ（$_POST）を配列にして $dataにまとめます。（submitとradioは除く）<br />
・$dataがある場合は、渡されたデータによりテーブルを更新します。</p>
<p>(3) テーブルを更新します</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//実行ボタンを押した場合</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'radio'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">//更新</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">update</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$table</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;更新しました。&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">//追加</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">insert</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$table</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;追加しました。&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">//削除</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DELETE FROM &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$table</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; WHERE id = &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;削除しました。&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;操作を指定して下さい。&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>・radioボタンの状態により、更新・追加・削除を行います。</p>
<p>※これまでのコードは、細かいところは省略して書いてますので、そのままでは動作しないです。大体こんな感じということで、理解して下さい。</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/1253.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress プラグイン制作　その２</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/1212.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/1212.html#comments</comments>
		<pubDate>Tue, 19 Apr 2011 14:30:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=1212</guid>
		<description><![CDATA[前回までは、ダッシュボードに管理画面メニューを表示してみました。メニューをクリックすると真っ白でしたが、今回はその中身を作ってみます。 (1) 処理を記述するファイルを作って読み込みます。 function moripo [...]]]></description>
			<content:encoded><![CDATA[<p>前回までは、ダッシュボードに管理画面メニューを表示してみました。メニューをクリックすると真っ白でしたが、今回はその中身を作ってみます。</p>
<p><strong>(1) 処理を記述するファイルを作って読み込みます。</strong></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">function</span> moripower_table_manager<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'moripower-table-manager-admin.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>読み込むファイル（moripower-table-manager-admin.php）には、表示するHTMLを記述します。</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>p style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;font-size:200p&quot;</span><span style="color: #339933;">&gt;</span>あ<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span></div></div>
<p>めっちゃ、でかい「あ」を表示する。これはこれで面白いプラグインかも・・・。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/04/m20110419-11.png" rel="lightbox[1212]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/04/m20110419-11-288x300.png" alt="m20110419-11" title="m20110419-11" width="288" height="300" class="alignnone size-medium wp-image-1220" /></a></p>
<p><strong>(2) テーブルを作成します</strong><br />
・「あ」ではやっぱり悲しいので、テーブルの内容を表示してみましょう。早速、テーブルを作ります。<br />
・WordPressでWP-phpMyAdminというプラグインを入れるとダッシュボードから直接テーブル操作できるから便利です。下記のようなテーブルを作ってください。<br />
・ちょと CakePHPを意識して、主キーは「id」でauto-incrementで。</p>
<table border="1">
<tbody>
<tr>
<th>field</th>
<th>type</th>
<th>null</th>
<th>etc</th>
</tr>
<tr>
<td>id</td>
<td>int(11)</td>
<td>no</td>
<td>unsigned auto-increment</td>
</tr>
</tbody>
</table>
<p style="_dummy">
<p><strong>(3) 適当にデータを入れて下さい。次に、テーブルを読み込みます。</strong><br />
・$wpdbオブジェクトを使うと、接続処理とか既にWordPressがやっているので、簡単にデータを持ってこれます。</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;h2&gt;モリパワー社員一覧&lt;/h2&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$table</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test_table&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> get_results<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$table</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ARRAY_A&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/print_r"><span style="color: #990000;">print_r</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$results</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>・こんな感じで、テーブルの内容が表示されるはず。</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">モリパワー社員<br />
<a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">Array</span></a> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#91;</span>id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#91;</span>name<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> モリパワー社員あいう<br />
　　　　　　　　 <span style="color: #009900;">&#91;</span>age<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">50</span> <span style="color: #009900;">&#91;</span>employee_no<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">192000</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span></div></div>
<p>・表示されるのは分かったので、もっと表らしくtableタグで表示します。</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &lt;table class=&quot;widefat&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;thead&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ID'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mtm_poedit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'氏名'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mtm_poedit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'年令'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mtm_poedit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'社員番号'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mtm_poedit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;th&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'操作'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mtm_poedit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/th&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/thead&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$results</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$i</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;age&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'age'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;employee_no&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'employee_no'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;input type=&quot;button&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'copy'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mtm_poedit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; onclick=&quot;copy_field(<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$i</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>)&quot; /&gt;&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>・こんな感じで表示されるはず。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/04/m20110420-1.jpeg" rel="lightbox[1212]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/04/m20110420-1-300x47.jpg" alt="m20110420-1" title="m20110420-1" width="300" height="47" class="alignnone size-medium wp-image-1251" /></a><br />
・class を widefat とするとダッシュボードでよく見る表デザインになるみたい。<br />
・ループさせて行を表示して、id名に $i をつけて判別できるようにしました。javascriptのfield_copyという関数で、formのinputにコピーさせようと思います。</p>
<p style="text-align:right;">＝＞ <a href="http://mori.moripower.jp/eqwip/wordpress/1253.html">WordPress プラグイン制作　その３</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/1212.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress プラグイン制作　その１</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/1174.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/1174.html#comments</comments>
		<pubDate>Tue, 19 Apr 2011 09:40:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=1174</guid>
		<description><![CDATA[WordPressのプラグイン機能でダッシュボードに管理画面を作成します。第１回目は、ダッシュボードにプラグインの枠を作るところまでです。 (1) プラグインの基本的なフォルダーとファイルを作ります ・プラグインフォルダ [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressのプラグイン機能でダッシュボードに管理画面を作成します。第１回目は、ダッシュボードにプラグインの枠を作るところまでです。</p>
<p><strong>(1) プラグインの基本的なフォルダーとファイルを作ります</strong></p>
<p>・プラグインフォルダは、wp-content/plugins/　配下に作ります。<br />
　　　⇒　例えば、moripower-table-manager フォルダとします。<br />
・ここに、phpファイルを作りましょう。<br />
　　　⇒　例えば、moripower-table-manager.php とします。</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; Plugin Name: MoriPower Table Manager<br />
&nbsp; &nbsp; Plugin URI: http://www.moripower.jp<br />
&nbsp; &nbsp; Description: Plugin for Database Table CRUD<br />
&nbsp; &nbsp; Author: Tsukasa Morinaga<br />
&nbsp; &nbsp; Version: 0.1<br />
&nbsp; &nbsp; Author URI: http://www.moripower.jp<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>これだけでプラグインの一覧に、題のみですが表示されます。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419.jpg" rel="lightbox[1174]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419-300x206.jpg" alt="m20100419" title="m20100419" width="300" height="206" class="alignnone size-medium wp-image-1179" /></a></p>
<p><strong>(2) ダッシュボードのメニューに、項目を表示させまます</strong></p>
<p>先ほどの、moripower-table-manager.php に下記のコードを記述しましょう。<br />
・add_actionの説明は、<a href="http://www.kantenna.com/pg/2010/03/wordpress_2.php" target="_blank">WordPress プラグイン作成前の基礎知識</a>が理解しやすいです。<br />
・フックの種類を調べるには、<a href="http://adambrown.info/p/wp_hooks" target="_blank">WordPress Hooks Database</a> が非常に便利です。<br />
・フックってVBとかAccessのイベントプローシジャみたいなものかな？ まさに引っ掛けるって感じがぴったり！</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//　管理パネルにメニュー項目を追加する</span><br />
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'moripower_table_manager_addmenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//　メニュー項目を追加</span><br />
<span style="color: #000000; font-weight: bold;">function</span> moripower_table_manager_addmenu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'モリパワー社員管理'</span><span style="color: #339933;">;</span><br />
add_management_page<span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <a href="http://www.php.net/basename"><span style="color: #990000;">basename</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'moripower_table_manager'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>早速、プラグインを有効化してみましょう！<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419-1.jpg" rel="lightbox[1174]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419-1-300x24.jpg" alt="m20100419-1" title="m20100419-1" width="300" height="24" class="alignnone size-medium wp-image-1182" /></a></p>
<p>ダッシュボードのメニューに、表示されたはずです。</p>
<p class="clearfix">
<a href="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419-2.jpg" rel="lightbox[1174]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419-2.jpg" alt="m20100419-2" title="m20100419-2" width="149" height="307" class="alignleft size-full wp-image-1184" /></a><br />
管理画面に自分のメニュー項目が表示されて何だかうれしい・・・。</p>
<div style="clear:both"></div>
<p>「モリパワー社員管理」をクリックしてみます。当然、まだ何も作ってないので、真っ白！<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419-3.jpg" rel="lightbox[1174]"><img src="http://mori.moripower.jp/wp-content/uploads/2011/04/m20100419-3-300x206.jpg" alt="m20100419-3" title="m20100419-3" width="300" height="206" class="alignnone size-medium wp-image-1186" /></a></p>
<p>※次回は、中身を作ってみます。予定としては、データベースにテーブルを作って、それを更新する感じの管理画面です・・・。</p>
<p style="text-align:right;">＝＞ <a href="http://mori.moripower.jp/eqwip/wordpress/1212.html">WordPress プラグイン制作　その２</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/1174.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress で動画貼付け YouTube</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/995.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/995.html#comments</comments>
		<pubDate>Sat, 04 Dec 2010 03:04:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=995</guid>
		<description><![CDATA[ワードプレスでYoutubeなどタグを直接貼付ける場合、&#60;object&#62;タグ等の強力な除去機能により、うまく貼り付けられないことがあります。こんなとき、Viper&#8217;s Video Quicktag [...]]]></description>
			<content:encoded><![CDATA[<p>ワードプレスでYoutubeなどタグを直接貼付ける場合、&lt;object&gt;タグ等の強力な除去機能により、うまく貼り付けられないことがあります。こんなとき、<strong>Viper&#8217;s Video Quicktags</strong> を導入することで、動画投稿時のストレスがかなり減ります。</p>
<p>(1) プラグイン導入</p>
<p>・ダッシュボード、プラグインで検索　「Viper&#8217;s Video Quictags」</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube01.gif" rel="lightbox[995]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube01-300x80.gif" alt="youtube01" title="youtube01" width="300" height="80" class="alignnone size-medium wp-image-996" /></a></p>
<p>・四★</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube02.gif" rel="lightbox[995]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube02-300x80.gif" alt="youtube02" title="youtube02" width="300" height="80" class="alignnone size-medium wp-image-998" /></a></p>
<p>・編集の際に、アイコンガ出る</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube03.gif" rel="lightbox[995]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube03.gif" alt="youtube03" title="youtube03" width="295" height="144" class="alignnone size-full wp-image-999" /></a></p>
<p>(2) Youtube貼付け</p>
<p>・貼り付けたいYouTubeを探して、そのURLをコピー</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube04.gif" rel="lightbox[995]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube04-300x113.gif" alt="youtube04" title="youtube04" width="300" height="113" class="alignnone size-medium wp-image-997" /></a></p>
<p>・編集にて、Youtubeボタンをおして、下記の部分に貼付け</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube05.gif" rel="lightbox[995]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube05-300x99.gif" alt="youtube05" title="youtube05" width="300" height="99" class="alignnone size-medium wp-image-1000" /></a></p>
<p>・Youtubeのショートコードが入力される</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube06.gif" rel="lightbox[995]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/12/youtube06-300x83.gif" alt="youtube06" title="youtube06" width="300" height="83" class="alignnone size-medium wp-image-1001" /></a></p>
<p>※動画投稿、楽になりました。<br />
※管理画面から動画サイトも色々選べるようです。 Flash,QuickTime等のタグもOKのよう。</p>
<p>以上です。</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/995.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress にツイッター、jtweetsanywhere</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/961.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/961.html#comments</comments>
		<pubDate>Fri, 05 Nov 2010 08:35:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=961</guid>
		<description><![CDATA[WordPress内に、twitterを表示するということで、Twitterで提供している@AnywhereサービスをJQueryで表示するプラグインを利用。 １．ダウンロード jtweetsanywhereからまずは、 [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress内に、twitterを表示するということで、Twitterで提供している@AnywhereサービスをJQueryで表示するプラグインを利用。</p>
<p>１．ダウンロード<br />
<a href="http://thomasbillenstein.com/jTweetsAnywhere/" target="_blank">jtweetsanywhere</a>からまずは、スクリプトをゲット。</p>
<p>２．twitterにアプリ登録<br />
@Anywhereサービスを利用するには、登録してkeyコードを発行する必要あり。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2010/11/m2010110501.jpg" rel="lightbox[961]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/11/m2010110501-162x300.jpg" alt="m2010110501" title="m2010110501" width="162" height="300" class="alignnone size-medium wp-image-962" /></a><br />
各項目は、適宜、入力してOK。</p>
<p>自分のアカウントに下記のように登録されるので、「consumer key」を控えておく。<br />
<a href="http://mori.moripower.jp/wp-content/uploads/2010/11/m2010110502.jpg" rel="lightbox[961]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/11/m2010110502-300x213.jpg" alt="m2010110502" title="m2010110502" width="300" height="213" class="alignnone size-medium wp-image-965" /></a></p>
<p>３．jtweetsanywhereの読み込み<br />
Wordpressでは、既に多くのJavaScriptを読み込んでおり、整然とロードする関数(wp_enqueue_script)が用意されている。<br />
(1) functions.php</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$jtweets = get_bloginfo('home') . &quot;/wp-content/themes/bp-moripower/js/jquery.jtweetsanywhere-1.2.0.js&quot;;<br />
wp_enqueue_script('jquery.jtweetsanywhere', $jtweets, array('jquery'), &quot;1.2.0&quot;);</div></div>
<p>(2) header.php<br />
・jtweetsanywhereで用意されているcssを読み込み<br />
・上記２で登録したconsumer keyをkeyコードに記載</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;all&quot; href=&quot;&amp;lt;?php get_bloginfo('home'); ?&amp;gt;/wp-content/themes/bp-moripower/js/jquery.jtweetsanywhere-1.2.0.css&quot; /&amp;gt;<br />
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://platform.twitter.com/anywhere.js?id=keyコード&amp;v=1&quot;&amp;gt;&amp;lt;/script&amp;gt;</div></div>
<p>(3) JavaScript<br />
・表示パターンは色々有り。</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;<br />
jQuery(document).ready(function(){<br />
&nbsp; &nbsp; jQuery('#jTweetsAnywhereSample1').jTweetsAnywhere({<br />
&nbsp; &nbsp; &nbsp; &nbsp; username: ['user1', 'user2'],<br />
&nbsp; &nbsp; &nbsp; &nbsp; count: 5,<br />
&nbsp; &nbsp; &nbsp; &nbsp; showTweetFeed: {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; paging: { mode: 'prev-next' }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; });<br />
});<br />
&amp;lt;/script&amp;gt;</div></div>
<p>以上です。</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/961.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress3.0 BuddyPress Capability Manager</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/895.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/895.html#comments</comments>
		<pubDate>Wed, 11 Aug 2010 07:16:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=895</guid>
		<description><![CDATA[WordPress3.0 にBuddyPressを導入し複数サイトタイプに変え、そこにCapabilityManagerプラグインを入れてみました。 ①　まずは、検索する。 ②　ダウンロードしてインストール、その後、「ネ [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress3.0 にBuddyPressを導入し複数サイトタイプに変え、そこにCapabilityManagerプラグインを入れてみました。</p>
<p>①　まずは、検索する。</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080901.jpg" rel="lightbox[895]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080901-300x100.jpg" alt="m2010080901" title="m2010080901" width="300" height="100" class="alignnone size-medium wp-image-899" /></a></p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080902.jpg" rel="lightbox[895]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080902-300x86.jpg" alt="m2010080902" title="m2010080902" width="300" height="86" class="alignnone size-medium wp-image-900" /></a></p>
<p>②　ダウンロードしてインストール、その後、「ネットワークで有効化」をクリック。</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080903.jpg" rel="lightbox[895]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080903-300x85.jpg" alt="m2010080903" title="m2010080903" width="300" height="85" class="alignnone size-medium wp-image-901" /></a></p>
<p>③　ユーザのメニューに「Capabilities」が表示される。</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080904.gif" rel="lightbox[895]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080904.gif" alt="m2010080904" title="m2010080904" width="156" height="235" class="alignnone size-full wp-image-902" /></a></p>
<p>④　該当の権限グループを選ぶ。</p>
<p>別の権限グループを作る際は、一旦、元になる権限グループを表示させ、それをコピーすると良い。<br />
「Copy New Row」</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080905.gif" rel="lightbox[895]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080905-300x178.gif" alt="m2010080905" title="m2010080905" width="300" height="178" class="alignnone size-medium wp-image-903" /></a></p>
<p>⑤　必要な権限をチェックしたり、外したりして調整する。</p>
<p>ちなみに、private、publish、othersというキーワードがあるが、それぞれ非公開、公開、他ユーザが所有という意味だと思う。特にOthesは、うまく使うと「ユーザごとに、記事・ページを分散管理できる」と思われる。</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080906.gif" rel="lightbox[895]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m2010080906-300x152.gif" alt="m2010080906" title="m2010080906" width="300" height="152" class="alignnone size-medium wp-image-898" /></a></p>
<p> </p>
<p>以上です。</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/895.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TinyMCE Advance のスタイル設定</title>
		<link>http://mori.moripower.jp/eqwip/wordpress/877.html</link>
		<comments>http://mori.moripower.jp/eqwip/wordpress/877.html#comments</comments>
		<pubDate>Tue, 10 Aug 2010 16:03:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mori.moripower.jp/?p=877</guid>
		<description><![CDATA[TinyMCEは便利なんですが、下記のスタイル・ドロップダウンリストボックスに追加でCSSクラスを追加できると、もっと便利になるはず。 マニュアルでは、wp-content/plugins/tinymce-advance [...]]]></description>
			<content:encoded><![CDATA[<p>TinyMCEは便利なんですが、下記のスタイル・ドロップダウンリストボックスに追加でCSSクラスを追加できると、もっと便利になるはず。</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m20100811-1.gif" rel="lightbox[877]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m20100811-1-300x81.gif" alt="m20100811-1" title="m20100811-1" width="300" height="81" class="alignnone size-medium wp-image-881" /></a></p>
<p>マニュアルでは、wp-content/plugins/tinymce-advanced/css　の「tadv-mce.css」にクラスを追加すると、スタイル・ドロップダウンに、指定したクラスが出てくると書かれてます。</p>
<p><span style="color: #dc0303;">しかし、FireFox系ではＯＫですが、IE系では出たり出なかったり・・・・。</span></p>
<p>このドロップダウンに表示されているのは、TinyMCEのテーマCSSにあるクラス「.～～」だけのようで、「div.～～」のように指定したクラスや「p」など普通のタグは設定されない。</p>
<p>とりあえず、TinyMCEのテーマCSS　に手を入れる。　↓<br />
wp-includes/js/tinymce/themes/advanced/skins/wp_theme　の「content.css」を修正する。<br />
これで、IEもキチント表示され、スタイル・ドロップダウンに表示される順番も変えられる。</p>
<p><a href="http://mori.moripower.jp/wp-content/uploads/2010/08/m20100811-2.gif" rel="lightbox[877]"><img src="http://mori.moripower.jp/wp-content/uploads/2010/08/m20100811-2-300x247.gif" alt="m20100811-2" title="m20100811-2" width="300" height="247" class="alignnone size-medium wp-image-882" /></a><br />
「alignclear」　を追加してみた。</p>
<p>以上です。</p>
]]></content:encoded>
			<wfw:commentRss>http://mori.moripower.jp/eqwip/wordpress/877.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

