<?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>@blog.justoneplanet.info &#187; WordPress</title>
	<atom:link href="http://blog.justoneplanet.info/category/computer/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.justoneplanet.info</link>
	<description>日々勉強</description>
	<lastBuildDate>Wed, 08 Feb 2012 02:57:17 +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>WordPressのカテゴリページで現在のカテゴリID</title>
		<link>http://blog.justoneplanet.info/2009/10/11/wordpress%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%a7%e7%8f%be%e5%9c%a8%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aaid/</link>
		<comments>http://blog.justoneplanet.info/2009/10/11/wordpress%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%a7%e7%8f%be%e5%9c%a8%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aaid/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 22:01:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.justoneplanet.info/?p=2017</guid>
		<description><![CDATA[$cat 以上]]></description>
			<content:encoded><![CDATA[<pre class="brush: php;">
$cat
</pre>
<p>以上</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justoneplanet.info/2009/10/11/wordpress%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%a7%e7%8f%be%e5%9c%a8%e3%81%ae%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aaid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress MUのログインで自動転送がループする</title>
		<link>http://blog.justoneplanet.info/2009/08/11/wordpress-mu%e3%81%ae%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%a7%e8%87%aa%e5%8b%95%e8%bb%a2%e9%80%81%e3%81%8c%e3%83%ab%e3%83%bc%e3%83%97%e3%81%99%e3%82%8b/</link>
		<comments>http://blog.justoneplanet.info/2009/08/11/wordpress-mu%e3%81%ae%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%a7%e8%87%aa%e5%8b%95%e8%bb%a2%e9%80%81%e3%81%8c%e3%83%ab%e3%83%bc%e3%83%97%e3%81%99%e3%82%8b/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 18:50:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.justoneplanet.info/?p=1752</guid>
		<description><![CDATA[再インストールした時に起こる問題のようだ。クッキーを削除したら動作するようになった。]]></description>
			<content:encoded><![CDATA[<p>再インストールした時に起こる問題のようだ。クッキーを削除したら動作するようになった。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justoneplanet.info/2009/08/11/wordpress-mu%e3%81%ae%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%a7%e8%87%aa%e5%8b%95%e8%bb%a2%e9%80%81%e3%81%8c%e3%83%ab%e3%83%bc%e3%83%97%e3%81%99%e3%82%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jopGlobalBlogArchive(WordPress MU Plugin)</title>
		<link>http://blog.justoneplanet.info/2009/04/22/jopglobalblogarchivewordpress-mu-plugin/</link>
		<comments>http://blog.justoneplanet.info/2009/04/22/jopglobalblogarchivewordpress-mu-plugin/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 02:47:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.justoneplanet.info/?p=885</guid>
		<description><![CDATA[WordPress MUで、表示中以外のブログを含めたサイト全体の新着ブログを表示するプラグインです。デフォルトのWordPress MUではできませんが、このプラグインを使えば可能になります。 みなさまのお問い合わせや [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress MUで、表示中以外のブログを含めたサイト全体の新着ブログを表示するプラグインです。デフォルトのWordPress MUではできませんが、このプラグインを使えば可能になります。</p>
<div class="kakomi">
<p>みなさまのお問い合わせやバグの指摘などから「正しい動作の実現」や「機能の追加」ができ、大変ありがたい限りです。是非とも、遠慮なくコメント欄でお問い合わせください。</p>
</div>
<h3>■ダウンロード</h3>
<dl>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.8.zip">version 0.1.8</a>（2009.09.15 latest release）</dt>
<dd>WordPress MU 2.8.3でテスト（運用中）</dd>
<dd>文字数制限機能の追加。</dd>
<dd>ブログIDの指定による表示ブログ・非表示ブログ指定機能の追加。</dd>
<dd>ページのリンク書き出しのにおけるバグを修正。</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.7.zip">version 0.1.7</a>（2009.09.04）</dt>
<dd>WordPress MU 2.8.3でテスト（運用中）</dd>
<dd>&lt;!&#8211;more&#8211;&gt;タグ以降の表示をオプションで設定できるように改良。</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.6.zip">version 0.1.6</a>（2009.08.28）</dt>
<dd>WordPress MU 2.8.3でテスト</dd>
<dd>インストール後に全ての記事で「投稿を更新」のボタンを押すことなく、記事を表示できるように改良。</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.5.zip">version 0.1.5</a>（2009.08.27）</dt>
<dd>WordPress MU 2.8.3でテスト</dd>
<dd>JopGlobalBlogIndex::the_timeメソッドにおいて、Wordpressと同じ引数が指定できるように改良。</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.4.zip">version 0.1.4</a>（2009.08.11）</dt>
<dd>WordPress MU 2.8.3でテスト</dd>
<dd>prefixをデフォルト以外にした時、投稿者名が表示されないバグを修正</dd>
<dd>ブログのタイトルや本文に（SQL文で使用される）特殊な文字があった場合に、投稿が表示されないバグを修正</dd>
<dd>複数回ループできないバグを修正</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.3.zip">version 0.1.3</a>（2009.07.09）</dt>
<dd>記事の削除ができないバグを修正</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.2.zip">version 0.1.2</a>（2009.06.24）</dt>
<dd>投稿者名が表示されるように改良</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.1.zip">version 0.1.1</a></dt>
<dd>β版:Warningの警告が出るのを修正</dd>
<dd>WordPress MU 2.7.0でテスト済み（運用中）</dd>
<dd>ディレクトリでブログを増やす場合でテスト済み、サブドメインの場合は未検証</dd>
<dt><a href="/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/jopGlobalBlogArchive0.1.0.zip">version 0.1.0</a>（2009.04.22）</dt>
<dd>β版</dd>
<dd>WordPress MU 2.7.0でテスト済み（運用中）</dd>
<dd>ディレクトリでブログを増やす場合でテスト済み、サブドメインの場合は未検証</dd>
</dl>
<h3>■仕様</h3>
<ul>
<li>PHP5以上</li>
<li>サブドメインでブログを管理する設定には未対応</li>
</ul>
<h3>■インストール方法</h3>
<ol>
<li>「/wp-content/mu-plugins/」に解凍したファイル、「jopGlobalBlogArchive.php」を設置する</li>
</ol>
<h3>■使い方</h3>
<h4>テンプレート</h4>
<p>例えば以下のような記述をテンプレート内にすると、サイト内の新規ブログを新しい順に5個（デフォルト）表示します。x個表示したい場合は、have_posts()の引数をhave_posts(x)と記述すれば、任意の回数だけ表示します。</p>
<p>通常のWordPressタグと同じようなコントロールができます。但し、query_posts関数は使用できません。</p>
<pre class="brush: php;">
&lt;div class=&quot;section&quot;&gt;
&lt;?php while(JopGlobalBlogIndex::have_posts()): ?&gt;
&lt;?php JopGlobalBlogIndex::the_post(); ?&gt;
&lt;div class=&quot;item&quot;&gt;
&lt;h3&gt;&lt;a href=&quot;&lt;?php print(JopGlobalBlogIndex::the_permalink()); ?&gt;&quot; title=&quot;&lt;?php print(JopGlobalBlogIndex::the_title()); ?&gt;&quot;&gt;&lt;?php print(JopGlobalBlogIndex::the_title()); ?&gt;&lt;/a&gt;(&lt;?php print(JopGlobalBlogIndex::the_author()); ?&gt;)&lt;?php print(JopGlobalBlogIndex::the_time('Y/m/d H:i:s')); ?&gt;&lt;/h3&gt;
&lt;p class=&quot;item_category&quot;&gt;Category: &lt;?php print(JopGlobalBlogIndex::the_category()); ?&gt;&lt;/p&gt;
&lt;?php print(JopGlobalBlogIndex::the_content()); ?&gt;
&lt;p class=&quot;readmore&quot;&gt;&lt;a href=&quot;&lt;?php print(JopGlobalBlogIndex::the_permalink()); ?&gt;&quot; title=&quot;&lt;?php print(JopGlobalBlogIndex::the_title()); ?&gt;&quot;&gt;Read More&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;?php endwhile; ?&gt;
&lt;/div&gt;
</pre>
<div class="kakomi">
<h4>解説</h4>
<pre class="brush: php;">
&lt;?php while(JopGlobalBlogIndex::have_posts([int $limit = 5[, array $option = array('allowedId' =&gt; array(), 'restrictedId' =&gt; array())]])): ?&gt;
&lt;?php JopGlobalBlogIndex::the_post(); ?&gt;
</pre>
<p>から</p>
<pre class="brush: php;">
&lt;?php endwhile; ?&gt;
</pre>
<p>の部分が記事の個数だけループされる部分です。$option['allowedId']には表示したいブログのIDを配列で指定でき、$option['restrictedId']には表示したくないブログのIDを指定できます。但し、$option['allowedId']か$option['restrictedId']の一方しか使用できず、両方指定してある場合は前者が有効となります。</p>
<h5>ループの中で使えるタグ一覧</h5>
<dl>
<dt>&lt;?php print(JopGlobalBlogIndex::the_permalink()); ?&gt;</dt>
<dd>記事のリンクを表示</dd>
<dt>&lt;?php print(JopGlobalBlogIndex::the_title()); ?&gt;</dt>
<dd>記事のタイトルを表示</dd>
<dt>&lt;?php print(JopGlobalBlogIndex::the_author()); ?&gt;</dt>
<dd>記事の投稿者名を表示</dd>
<dt>&lt;?php print(JopGlobalBlogIndex::the_time(&#8216;Y/m/d H:i:s&#8217;)); ?&gt;</dt>
<dd>記事の公開日時を表示</dd>
<dt>&lt;?php print(JopGlobalBlogIndex::the_category()); ?&gt;</dt>
<dd>記事のカテゴリーを表示</dd>
<dt>&lt;?php print(JopGlobalBlogIndex::the_summary([int $limit = 50])); ?&gt;</dt>
<dd>記事の本文を表示。引数にtrueを設定すると、&lt;!&#8211;more&#8211;&gt;以降は表示されなくなる。デフォルトはfalse</dd>
<dt>&lt;?php print(JopGlobalBlogIndex::the_content([bool $omission = false])); ?&gt;</dt>
<dd>記事の本文を表示。引数にtrueを設定すると、&lt;!&#8211;more&#8211;&gt;以降は表示されなくなる。デフォルトはfalse</dd>
</dl>
</div>
<h3>■既知のバグ</h3>
<dl>
<dt>パーマリンクについて</dt>
<dd>リンクを書き換えるプラグインを使用し、親ブログと子ブログのうちどちらか一方で使用していた場合、リンクの書き換えに失敗し、正しいリンク先が表示できない。</li>
</dd>
</dl>
<h3>■version 0.1.8 ソースコード</h3>
<h4>jopGlobalBlogArchive.php</h4>
<p>「/wp-content/mu-plugins/jopGlobalBlogArchive.php」</p>
<pre class="brush: php;">
&lt;?php
/*
Plugin Name: jopGlobalBlogArchive
Plugin URI: http://blog.justoneplanet.info/wp-content/uploads/wordpressmu/jopGlobalBlogArchive/
Description: Prepare the list of some newer posts and categories from WPMU.
Author: Mitsuaki Ishimoto
Version: 0.1.8
Author URI: http://blog.justoneplanet.info/
*/
/*  Copyright 2009  Mitsuaki Ishimoto  (email : justoneplanet.info)

    This program is free software; fundamentally, you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    But the Author(:Mitsuaki Ishimoto) can deny for someone evil or immoral to use this plugin.
    it means someone evil or immoral is the people and organizations to hold a candle to the devil,
    to harm someone, not to observe various laws, not to contribute society and so on.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
//=======================================================
//actions
add_action('publish_post', 'jopSavePostForArchive');
add_action('publish_page', 'jopSavePostForArchive');
add_action('delete_post', 'jopDeletePostForArchive');

add_action('delete_category', 'jopDeleteCategoryForArchive');
//=======================================================
//class
class JopGlobalBlogIndex {
	/*
	 * $global_prefix
	 * (string) : prefix of database not including blog id
	 */
	private static $global_prefix;
	/*
	 * $post
	 * (object) : data of a post at current loop
	 */
	private static $post;
	/*
	 * $posts
	 * (array) : data of posts from the global post's table of database
	 */
	private static $posts;
	/*
	 * $counter
	 * (int) : counter for counting of loop
	 */
	private static $counter = 0;
	/**
	 * __construct
	 * An instantiation is prohibited.
	 */
	private function __construct(){
		throw new Exception('An instantiation is prohibited.');
	}
	/**
	 * getOptionsByBlogId
	 * get user's option defined by blog id and key
	 * @return (string) maybe_unserialize($_wp_alloptions[$blog_id][$key]) : option's value
	 * @param (string) $key : the key you need
	 * @param (string) maybe_unserialize($_wp_alloptions[$blog_id][$key]) : option's value
	 */
	private static function getOptionsByBlogId($key, $id){
		global $wpdb;
		$suppress = $wpdb-&gt;suppress_errors();
		$alloptions_db = $wpdb-&gt;get_results(
			&quot;SELECT option_name, option_value FROM &quot; . self::$global_prefix . $id . &quot;_options FORCE INDEX(PRIMARY) ORDER BY option_id ASC&quot;
		);
		$wpdb-&gt;suppress_errors($suppress);
		foreach((array)$alloptions_db as $o){
			$_wp_alloptions[$blog_id][$o-&gt;option_name] = $o-&gt;option_value;
		}
		wp_cache_set('alloptions', $_wp_alloptions[$blog_id], 'options');
		return maybe_unserialize($_wp_alloptions[$blog_id][$key]);
	}
	/**
	 * get_page_uri
	 * @return
	 */
	private static function get_page_uri(){
		global $wpdb;
		$uri = self::$post-&gt;post_name;
		if(self::$post-&gt;post_parent == self::$post-&gt;ID){
			return $uri;
		}
		$id = self::$post-&gt;post_parent;
		while($id != 0){
			$sql = &quot;SELECT
						`ID`,`post_name`,`post_parent`
					FROM &quot; . self::$global_prefix . self::$post-&gt;blog_id . &quot;_posts
					WHERE `ID` = '{$id}'&quot;;
			$result = $wpdb-&gt;get_results($sql, OBJECT);
			$result = $result[0];
			$id = $result-&gt;post_parent;
			$uri = $result-&gt;post_name . &quot;/&quot; . $uri;
		}
		return $uri;
	}
	/**
	 * _get_page_link
	 * @return (string)
	 * @param boolean $id[optional]
	 * @param boolean $leavename[optional]
	 */
	private static function _get_page_link($id = false, $leavename = false){
		global $wp_rewrite;
		$pagestruct = $wp_rewrite-&gt;get_page_permastruct();
		if($pagestruct != ''){
			$link = self::get_page_uri($id);
			$link = ($leavename)? $pagestruct : str_replace('%pagename%', $link, $pagestruct);
			$link = trailingslashit(self::getOptionsByBlogId('home', self::$post-&gt;blog_id)) . &quot;$link&quot;;
			$link = user_trailingslashit($link, 'page');
		}
		else{
			$link = trailingslashit(self::getOptionsByBlogId('home', self::$post-&gt;blog_id)) . &quot;?page_id={$post-&gt;post_id}&quot;;
		}
		return apply_filters('_get_page_link', $link, $id);
	}
	/**
	 * get_page_link
	 * @return (string) page_link
	 */
	private static function get_page_link($id = false, $leavename = false){
		if('page' == self::getOptionsByBlogId('show_on_front', self::$post-&gt;blog_id) &amp;&amp; self::$post-&gt;post_id == self::getOptionsByBlogId('page_on_front', self::$post-&gt;blog_id)){
			$link = self::getOptionsByBlogId('home', self::$post-&gt;blog_id);
		}
		else{
			$link = self::_get_page_link($id, $leavename);
		}
		return apply_filters('page_link', $link, $id);
	}
	/**
	 * get_permalink
	 * get the permalink from current post
	 * @return the permalink
	 * @param (int) $id[optional]
	 * @param (bool?) $leavename[optional]
	 */
	private static function get_permalink($id = 0, $leavename = false) {
		if(empty(self::$post-&gt;ID)){
			return false;
		}
		if(self::$post-&gt;post_type == 'page'){
			return self::get_page_link(self::$post-&gt;ID, $leavename);
		}
		elseif(self::$post-&gt;post_type == 'attachment'){
			return get_attachment_link(self::$post-&gt;ID);
		}
		$permalink = get_option('permalink_structure');
		if('' != $permalink &amp;&amp; !in_array(self::$post-&gt;post_status, array('draft', 'pending'))){
			$unixtime = strtotime(self::$post-&gt;post_date);
			$category = '';
			if(strpos($permalink, '%category%') !== false){
				$cats = get_the_category(self::$post-&gt;ID);
				if($cats){
					usort($cats, '_usort_terms_by_ID'); // order by ID
					$category = $cats[0]-&gt;slug;
					if($parent = $cats[0]-&gt;parent){
						$category = get_category_parents($parent, false, '/', true) . $category;
					}
				}
				// show default category in permalinks, without
				// having to assign it explicitly
				if(empty($category)) {
					$default_category = get_category(get_option('default_category'));
					$category = is_wp_error($default_category) ? '' : $default_category-&gt;slug;
				}
			}
			$author = '';
			if(strpos($permalink, '%author%') !== false){
				$authordata = get_userdata(self::$post-&gt;post_author);
				$author = $authordata-&gt;user_nicename;
			}
			$date = explode(&quot; &quot;, date('Y m d H i s', $unixtime));
			$blog_path = explode('/', self::$post-&gt;path);
			$blog_path = $blog_path[count($blog_path) - 2];
			$rewritecode = array(
				'blog',
				'%year%',
				'%monthnum%',
				'%day%',
				'%hour%',
				'%minute%',
				'%second%',
				$leavename? '' : '%postname%',
				'%post_id%',
				'%category%',
				'%author%',
				$leavename? '' : '%pagename%',
			);
			$rewritereplace = array(
				(self::$post-&gt;blog_id == 1)? 'blog' : $blog_path,
				$date[0],
				$date[1],
				$date[2],
				$date[3],
				$date[4],
				$date[5],
				self::$post-&gt;post_name,
				self::$post-&gt;ID,
				$category,
				$author,
				self::$post-&gt;post_name,
			);
			$permalink = get_option('home') . str_replace($rewritecode, $rewritereplace, $permalink);
			$permalink = user_trailingslashit($permalink, 'single');
			return apply_filters('post_link', $permalink, self::$post, $leavename);
		}
		else{ // if they're not using the fancy permalink option
			$permalink = get_option('home') . '/?p=' . self::$post-&gt;ID;
			return apply_filters('post_link', $permalink, self::$post, $leavename);
		}
	}
	/**
	 * savePost
	 * save post into the table '(prefix_)jop_global_posts' on installing and updating
	 * @return (null)
	 * @param (object) $result
	 * @param (int) $blogid
	 */
	public static function savePost($result, $blogid){
		global $wpdb;
		$id = $result['ID'];
		$sql = &quot;INSERT INTO &quot; . self::getGlobalPrefix() . &quot;jop_global_posts(
			`blog_id`,
			`post_id`,
			`identifier`,
			`post_author`,
			`post_date`,
			`post_date_gmt`,
			`post_content`,
			`post_title`,
			`post_category`,
			`post_excerpt`,
			`post_status`,
			`comment_status`,
			`ping_status`,
			`post_password`,
			`post_name`,
			`to_ping`,
			`pinged`,
			`post_modified`,
			`post_modified_gmt`,
			`post_content_filtered`,
			`post_parent`,
			`guid`,
			`menu_order`,
			`post_type`,
			`post_mime_type`,
			`comment_count`
		) VALUES('&quot;
			. $blogid . &quot;', '&quot;
			. $result['ID'] . &quot;', '&quot;
			. $blogid . &quot;/&quot; . $result['ID'] . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_author']) . &quot;', '&quot;
			. $result['post_date'] . &quot;', '&quot;
			. $result['post_date_gmt'] . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_content']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_title']) . &quot;', '&quot;
			. $result['post_category'] . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_excerpt']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_status']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['comment_status']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['ping_status']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_password']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_name']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['to_ping']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['pinged']) . &quot;', '&quot;
			. $result['post_modified'] . &quot;', '&quot;
			. $result['post_modified_gmt'] . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_content_filtered']) . &quot;', '&quot;
			. $result['post_parent'] . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['guid']) . &quot;', '&quot;
			. $result['menu_order'] . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_type']) . &quot;', '&quot;
			. $wpdb-&gt;_real_escape($result['post_mime_type']) . &quot;', '&quot;
			. $result['comment_count'] . &quot;'
		) ON DUPLICATE KEY UPDATE &quot;
			. &quot;`post_author` = '&quot;           . $wpdb-&gt;_real_escape($result['post_author']) . &quot;',&quot;
			. &quot;`post_date` = '&quot;             . $result['post_date'] . &quot;',&quot;
			. &quot;`post_date_gmt` = '&quot;         . $result['post_date_gmt'] . &quot;',&quot;
			. &quot;`post_content` = '&quot;          . $wpdb-&gt;_real_escape($result['post_content']) . &quot;',&quot;
			. &quot;`post_title` = '&quot;            . $wpdb-&gt;_real_escape($result['post_title']) . &quot;',&quot;
			. &quot;`post_category` = '&quot;         . $result['post_category'] . &quot;',&quot;
			. &quot;`post_excerpt` = '&quot;          . $wpdb-&gt;_real_escape($result['post_excerpt']) . &quot;',&quot;
			. &quot;`post_status` = '&quot;           . $wpdb-&gt;_real_escape($result['post_status']) . &quot;',&quot;
			. &quot;`comment_status` = '&quot;        . $wpdb-&gt;_real_escape($result['comment_status']) . &quot;',&quot;
			. &quot;`ping_status` = '&quot;           . $wpdb-&gt;_real_escape($result['ping_status']) . &quot;',&quot;
			. &quot;`post_password` = '&quot;         . $wpdb-&gt;_real_escape($result['post_password']) . &quot;',&quot;
			. &quot;`post_name` = '&quot;             . $wpdb-&gt;_real_escape($result['post_name']) . &quot;',&quot;
			. &quot;`to_ping` = '&quot;               . $wpdb-&gt;_real_escape($result['to_ping']) . &quot;',&quot;
			. &quot;`pinged` = '&quot;                . $wpdb-&gt;_real_escape($result['pinged']) . &quot;',&quot;
			. &quot;`post_modified` = '&quot;         . $result['post_modified'] . &quot;',&quot;
			. &quot;`post_modified_gmt` = '&quot;     . $result['post_modified_gmt'] . &quot;',&quot;
			. &quot;`post_content_filtered` = '&quot; . $wpdb-&gt;_real_escape($result['post_content_filtered']) . &quot;',&quot;
			. &quot;`post_parent` = '&quot;           . $result['post_parent'] . &quot;',&quot;
			. &quot;`guid` = '&quot;                  . $wpdb-&gt;_real_escape($result['guid']) . &quot;',&quot;
			. &quot;`menu_order` = '&quot;            . $result['menu_order'] . &quot;',&quot;
			. &quot;`post_type` = '&quot;             . $wpdb-&gt;_real_escape($result['post_type']) . &quot;',&quot;
			. &quot;`post_mime_type` = '&quot;        . $wpdb-&gt;_real_escape($result['post_mime_type']) . &quot;',&quot;
			. &quot;`comment_count` = '&quot;         . $result['comment_count'] . &quot;'&quot;;
		$wpdb-&gt;query($sql);

		/*
		 * pick up the term id for save
		 */
		$sql = &quot;SELECT &quot;
					. self::getGlobalPrefix() . $blogid . &quot;_term_relationships.object_id, &quot;
					. self::getGlobalPrefix() . $blogid . &quot;_term_taxonomy.term_id
				FROM &quot;
					. self::getGlobalPrefix() . $blogid . &quot;_term_relationships
				LEFT JOIN &quot;
					. self::getGlobalPrefix() . $blogid . &quot;_term_taxonomy
				ON &quot;
					. self::getGlobalPrefix() . $blogid . &quot;_term_relationships.term_taxonomy_id = &quot; . self::getGlobalPrefix() . $blogid . &quot;_term_taxonomy.term_taxonomy_id
				WHERE &quot;
					. self::getGlobalPrefix() . $blogid . &quot;_term_relationships.`object_id` = '{$result['ID']}'&quot;;
		$result = $wpdb-&gt;get_results($sql, ARRAY_A);
		/*
		 * Once deleting for update
		 */
		$sql = &quot;DELETE FROM &quot;
					. self::getGlobalPrefix() . &quot;jop_global_term_relationships
				WHERE `object_id` = '{$id}'
				AND `blog_id` = '{$blogid}'&quot;;
		$wpdb-&gt;query($sql);

		/*
		 * insert
		 */
		$values = array();
		foreach($result as $key =&gt; $value){
			$values[] = &quot;'{$value['object_id']}', '{$blogid}', '{$value['term_id']}', '{$blogid}/{$value['object_id']}/{$value['term_id']}'&quot;;
		}
		$values = '(' . implode('),(', $values) . ')';
		$sql = &quot;INSERT INTO &quot; . self::getGlobalPrefix() . &quot;jop_global_term_relationships(
			`object_id`,
			`blog_id`,
			`cat_ID`,
			`identifier`
		) VALUES $values&quot;;
		$wpdb-&gt;query($sql);
	}
	/**
	 * install
	 * 1st query makes the table that keep the posts written by all users.
	 * 2nd query makes the table that keep the terms written by all users.
	 * @return (null)
	 */
	private static function install(){
		global $wpdb;
		$table_name = self::$global_prefix . &quot;jop_global_term_relationships&quot;;
		if($wpdb-&gt;get_var(&quot;SHOW TABLES LIKE '$table_name'&quot;) != $table_name){
			$sql = &quot;CREATE TABLE IF NOT EXISTS `$table_name` (
						`object_id` bigint(20) NOT NULL DEFAULT '0',
						`blog_id` int(11) NOT NULL DEFAULT '0',
						`cat_ID` bigint(20) NOT NULL DEFAULT '0',
						`identifier` varchar(255) NOT NULL DEFAULT '0/0',
						UNIQUE KEY `identifier` (`identifier`),
						KEY `cat_ID` (`cat_ID`),
						KEY `blog_id` (`blog_id`)
					) ENGINE=MyISAM DEFAULT CHARSET=utf8&quot;;
			$wpdb-&gt;get_results($sql);
		}
		$table_name = self::$global_prefix . &quot;jop_global_posts&quot;;
		if($wpdb-&gt;get_var(&quot;SHOW TABLES LIKE '$table_name'&quot;) != $table_name){
			$sql = &quot;CREATE TABLE IF NOT EXISTS `$table_name` (
						`ID` bigint(20) NOT NULL AUTO_INCREMENT,
						`blog_id` int(11) NOT NULL DEFAULT '0',
						`post_id` int(11) NOT NULL DEFAULT '0',
						`identifier` varchar(255) NOT NULL,
						`post_author` bigint(20) NOT NULL DEFAULT '0',
						`post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
						`post_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
						`post_content` longtext NOT NULL,
						`post_title` text NOT NULL,
						`post_category` int(4) NOT NULL DEFAULT '0',
						`post_excerpt` text NOT NULL,
						`post_status` varchar(20) NOT NULL DEFAULT 'publish',
						`comment_status` varchar(20) NOT NULL DEFAULT 'open',
						`ping_status` varchar(20) NOT NULL DEFAULT 'open',
						`post_password` varchar(20) NOT NULL,
						`post_name` varchar(200) NOT NULL,
						`to_ping` text NOT NULL,
						`pinged` text NOT NULL,
						`post_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
						`post_modified_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
						`post_content_filtered` text NOT NULL,
						`post_parent` bigint(20) NOT NULL DEFAULT '0',
						`guid` varchar(255) NOT NULL,
						`menu_order` int(11) NOT NULL DEFAULT '0',
						`post_type` varchar(20) NOT NULL DEFAULT 'post',
						`post_mime_type` varchar(100) NOT NULL,
						`comment_count` bigint(20) NOT NULL DEFAULT '0',
						PRIMARY KEY (`ID`),
						UNIQUE KEY `identifier` (`identifier`),
						KEY `blog_id` (`blog_id`),
						KEY `post_id` (`post_id`)
					) ENGINE=MyISAM  DEFAULT CHARSET=utf8&quot;;
			$wpdb-&gt;get_results($sql);
			/*
			 * save the posts have been published.
			 */
			$tables = $wpdb-&gt;get_results(&quot;SHOW TABLES LIKE '&quot; . self::$global_prefix . &quot;_\_posts'&quot;, ARRAY_N);
			foreach($tables as $table){
				$results = $wpdb-&gt;get_results(&quot;SELECT * FROM {$table[0]} WHERE `post_status` = 'publish'&quot;, ARRAY_A);
				$blogid = str_replace(array(self::$global_prefix, '_posts'), '', $table[0]);
				foreach($results as $result){
					self::savePost($result, $blogid);
				}
			}
		}
	}
	/**
	 * init
	 * @return null
	 */
	public static function init(){
		global $wpdb;
		self::$global_prefix = preg_replace(&quot;/[0-9]+_/&quot;, '', $wpdb-&gt;prefix);
		self::install();
	}
	/**
	 * getGlobalPrefix
	 * method for access to prefix
	 * @return (string) self::$global_prefix : table prefix
	 */
	public static function getGlobalPrefix(){
		return self::$global_prefix;
	}
	/**
	 * have_posts
	 * set the list of newer posts written by all users if self::$posts is not set
	 * judge if the self::$posts of current index exist or not
	 * @return (bool)
	 * @param (int) $limit : define the number of rows.
	 * @param (array) $option : define the option.
	 */
	public static function have_posts($limit = 5, $option = array()){
		global $wpdb;
		if(!isset(self::$posts)){
			$col = array(
				'ID',
				'blog_id',
				'post_id',
				'post_date',
				'post_content',
				'post_name',
				'post_author',
				'post_title',
				'post_category',
				'post_status',
				'post_type',
				'post_parent',
				'guid'
			);
			foreach($col as $key =&gt; $value){
				$col[$key] = self::$global_prefix . &quot;jop_global_posts.&quot; . $value;
			}
			$col = implode(',', $col);
			$sqlForAllowedBlog = '';
			if(is_array($option['allowedId'])){
				for($i = 0; $i &lt; count($option['allowedId']); $i++){
					if(is_int($option['allowedId'][$i]) &amp;&amp; $option['allowedId'][$i] &gt; 0){
						$sqlForAllowedBlog .= &quot; OR &quot; . self::$global_prefix . &quot;jop_global_posts.`blog_id` = '{$option['allowedId'][$i]}'&quot;;
					}
				}
				$sqlForAllowedBlog = substr($sqlForAllowedBlog, 4);
			}
			elseif(is_array($option['restrictedId'])){
				for($i = 0; $i &lt; count($option['restrictedId']); $i++){
					if(is_int($option['restrictedId'][$i]) &amp;&amp; $option['restrictedId'][$i] &gt; 0){
						$sqlForAllowedBlog .= &quot; AND &quot; . self::$global_prefix . &quot;jop_global_posts.`blog_id` != '{$option['restrictedId'][$i]}'&quot;;
					}
				}
				$sqlForAllowedBlog = substr($sqlForAllowedBlog, 5);
			}
			if($sqlForAllowedBlog !== ''){
				$sqlForAllowedBlog = &quot; AND ($sqlForAllowedBlog) &quot;;
			}
			$sql = &quot;SELECT
						{$col},&quot; . self::$global_prefix . &quot;blogs.path
					FROM &quot;
						. self::$global_prefix . &quot;jop_global_posts
					LEFT JOIN &quot;
						. self::$global_prefix . &quot;blogs
					ON &quot;
						. self::$global_prefix . &quot;jop_global_posts.blog_id = &quot; . self::$global_prefix . &quot;blogs.blog_id
					WHERE &quot;
						. self::$global_prefix . &quot;jop_global_posts.`post_status` = 'publish'
					AND &quot;
						. self::$global_prefix . &quot;jop_global_posts.`post_password` = ''
					$sqlForAllowedBlog
					ORDER BY `post_date` DESC
					LIMIT 0,$limit&quot;;
			$result = $wpdb-&gt;get_results($sql, OBJECT);
			self::$posts = $result;
		}
		if(isset(self::$posts[self::$counter])){
			return true;
		}
		else{
			self::$counter = 0;
			self::$posts = null;//for multiple loop(in the case of different situation)
			return false;
		}
	}
	/**
	 * the_post
	 * get the post in a loop and set the counter for the next loop.
	 * @return (array) self::$post
	 */
	public static function the_post(){
		self::$post = self::$posts[self::$counter];
		self::$counter++;
		return self::$post;
	}
	/**
	 * the_title
	 * get the title from the current loop.
	 * @return (string) self::$post-&gt;post_title
	 */
	public static function the_title(){
		return apply_filters('the_title', self::$post-&gt;post_title);
	}
	/**
	 * the_ID
	 * get the title from the current loop.
	 * @return (string) self::$post-&gt;ID
	 */
	public static function the_ID(){
		return self::$post-&gt;ID;
	}
	/**
	 * the_permalink
	 * get the title from the current loop.
	 * @return (string) self::$post-&gt;guid
	 */
	public static function the_permalink(){
		return apply_filters('the_permalink', self::get_permalink());
	}
	/**
	 * the_time
	 * get the title from the current loop.
	 * @return (string) self::$post-&gt;post_date
	 */
	public static function the_time($d = ''){
		return apply_filters('the_time', self::get_the_time( $d ), $d);
	}
	/**
	 * get_the_time
	 * @return (String) date
	 */
	private function get_the_time($d = ''){
		if('' == $d){
			$the_time = get_post_time(get_option('time_format'), false, self::$post, true);
		}
		else{
			$the_time = get_post_time($d, false, self::$post, true);
		}
		return apply_filters('get_the_time', $the_time, $d, self::$post);
	}
	/**
	 * the_author
	 * get the title from the current loop.
	 * @return (string) self::$post-&gt;post_author
	 */
	public static function the_author(){
		global $wpdb;
		$id = self::$post-&gt;post_author;
		$sql = &quot;SELECT `user_nicename` FROM `&quot; . self::$global_prefix . &quot;users` WHERE `ID` = '$id'&quot;;
		$result = $wpdb-&gt;get_results($sql, ARRAY_N);
		return $result[0][0];
	}
	/**
	 * the_content
	 * get the body from the current loop.
	 * @return (string) self::$post-&gt;post_content
	 */
	public static function the_content($stripteaser = false){
		$content = self::$post-&gt;post_content;
		if($stripteaser){
			list($content) = preg_split('/&lt;!--more(.*?)?--&gt;/', $content);
		}
		$content = apply_filters('the_content', $content);
		$content = str_replace(']]&gt;', ']]&amp;gt;', $content);
		return $content;
	}
	/**
	 * the_summary
	 * get the summary form the current loop.
	 * @return (string) self::$post-&gt;post_content
	 * @param (int) $limit
	 */
	public static function the_summary($limit = 50){
		if(!is_int($limit)){
			$limit = 50;
		}
		$content = self::$post-&gt;post_content;
		$funcs = get_defined_functions();
		if(in_array('mb_substr', $funcs['internal'])){
			$content = mb_substr(strip_tags($content), 0, $limit);
		}
		else{
			$content = substr(strip_tags($content), 0, $limit);
		}
		$content = str_replace(']]&gt;', ']]&amp;gt;', $content);
		return $content;
	}
	/**
	 * the_category
	 * get the title from the current loop.
	 * @return (string) self::$post-&gt;post_category
	 */
	public static function the_category(){
		global $wpdb;
		$blog_id = self::$post-&gt;blog_id;
		$post_id = self::$post-&gt;post_id;
		$sql = &quot;SELECT `&quot;
					. self::$global_prefix . &quot;sitecategories`.`cat_name`
				FROM `&quot;
					. self::$global_prefix . &quot;jop_global_term_relationships`
				LEFT JOIN `&quot;
					. self::$global_prefix . &quot;sitecategories`
				ON `&quot;
					. self::$global_prefix . &quot;jop_global_term_relationships`.`cat_ID` = `&quot; . self::$global_prefix . &quot;sitecategories`.`cat_ID`
				WHERE `&quot;
					. self::$global_prefix . &quot;jop_global_term_relationships`.`object_id` = '$post_id'
				AND `&quot;
					. self::$global_prefix . &quot;jop_global_term_relationships`.`blog_id` = '$blog_id'&quot;;
		$tmpAry = array();
		$result = $wpdb-&gt;get_results($sql, ARRAY_A);
		foreach($result as $key =&gt; $value){
			$tmpAry[] = $value['cat_name'];
		}
		sort($tmpAry);
		return implode(', ', $tmpAry);
	}
	/*prepare*/
	public static function the_tags(){
		return self::$post-&gt;post_title;
	}
	public static function the_title_attribute(){
		return self::$post-&gt;post_title;
	}
	/*categories*/
	/**
	 * wp_list_categories
	 * get the title from the current loop.
	 * @return (string) self::$post-&gt;post_category
	 */
	public static function wp_list_categories($args = ''){
		$defaults = array(
			'show_option_all'    =&gt; '',
			'orderby'            =&gt; 'name',
			'order'              =&gt; 'ASC',
			'show_last_update'   =&gt; 0,
			'style'              =&gt; 'list',
			'show_count'         =&gt; 0,
			'hide_empty'         =&gt; 1,
			'use_desc_for_title' =&gt; 1,
			'child_of'           =&gt; 0,
			'feed'               =&gt; '',
			'feed_type'          =&gt; '',
			'feed_image'         =&gt; '',
			'exclude'            =&gt; '',
			'current_category'   =&gt; 0,
			'hierarchical'       =&gt; true,
			'title_li'           =&gt; __('Categories'),
			'echo'               =&gt; 1,
			'depth'              =&gt; 0
		);
		$r = wp_parse_args($args, $defaults);
		if(!isset($r['pad_counts']) &amp;&amp; $r['show_count'] &amp;&amp; $r['hierarchical']){
			$r['pad_counts'] = true;
		}
		if(isset($r['show_date'])){
			$r['include_last_update_time'] = $r['show_date'];
		}
		extract($r);
		$categories = get_categories($r);
		$output = '';
		if($title_li &amp;&amp; 'list' == $style){
			$output = '&lt;li class=&quot;categories&quot;&gt;' . $r['title_li'] . '&lt;ul&gt;';
		}
		if(empty($categories)){
			if('list' == $style){
				$output .= '&lt;li&gt;' . __(&quot;No categories&quot;) . '&lt;/li&gt;';
			}
			else{
				$output .= __(&quot;No categories&quot;);
			}
		}
		else{
			global $wp_query;
			if(!empty($show_option_all)){
				if('list' == $style){
					$output .= '&lt;li&gt;&lt;a href=&quot;' .  get_bloginfo('url')  . '&quot;&gt;' . $show_option_all . '&lt;/a&gt;&lt;/li&gt;';
				}
				else{
					$output .= '&lt;a href=&quot;' .  get_bloginfo('url')  . '&quot;&gt;' . $show_option_all . '&lt;/a&gt;';
				}
			}
			if(empty($r['current_category']) &amp;&amp; is_category()){
				$r['current_category'] = $wp_query-&gt;get_queried_object_id();
			}
			if($hierarchical){
				$depth = $r['depth'];
			}
			else{
				$depth = -1; // Flat.
			}
			$output .= walk_category_tree($categories, $depth, $r);
		}
		if($title_li &amp;&amp; 'list' == $style){
			$output .= '&lt;/ul&gt;&lt;/li&gt;';
		}
		$output = apply_filters('wp_list_categories', $output);
		if($echo){
			echo $output;
		}
		else{
			return $output;
		}
	}
}
JopGlobalBlogIndex::init();
//=======================================================
//functions
/**
 * jopDeleteCategoryForArchive
 * @return (null)
 * @param (int) $id
 */
function jopDeleteCategoryForArchive($id){
	global $wpdb;
	$sql = &quot;DELETE FROM &quot;
				. JopGlobalBlogIndex::getGlobalPrefix() . &quot;jop_global_term_relationships
			WHERE `blog_id` = '{$wpdb-&gt;blogid}' AND `cat_ID` = '{$id}'&quot;;
	$wpdb-&gt;query($sql);
}
/**
 * jopSavePostForArchive
 * @return (null)
 * @param (int) $id
 */
function jopSavePostForArchive($id){
	global $wpdb;
	$sql = &quot;SELECT * FROM &quot;
				. JopGlobalBlogIndex::getGlobalPrefix() . $wpdb-&gt;blogid . &quot;_posts
			WHERE `ID` = '$id'&quot;;
	$result = $wpdb-&gt;get_results($sql, ARRAY_A);
	$result = $result[0];
	JopGlobalBlogIndex::savePost($result, $wpdb-&gt;blogid);
}
/**
 * jopDeletePostForArchive
 * @return (null)
 * @param (int) $id
 */
function jopDeletePostForArchive($id){
	global $wpdb;
	$sql = &quot;DELETE FROM &quot;
				. JopGlobalBlogIndex::getGlobalPrefix() . &quot;jop_global_posts
			WHERE `identifier` = '&quot; . $wpdb-&gt;blogid . '/' . $id . &quot;'&quot;;
	$wpdb-&gt;query($sql);
	//var_dump($sql);
	//throw new Exception();
}
?&gt;
</pre>
<h3>■ライセンスについて</h3>
<p>GNU General Public Licenseです。但し、法律に従わない組織や個人などの邪悪な（者の）使用は認めません。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justoneplanet.info/2009/04/22/jopglobalblogarchivewordpress-mu-plugin/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>WP_MultilingualでWordPressを多言語化</title>
		<link>http://blog.justoneplanet.info/2009/01/28/wp_multilingual%e3%81%a7wordpress%e3%82%92%e5%a4%9a%e8%a8%80%e8%aa%9e%e5%8c%96/</link>
		<comments>http://blog.justoneplanet.info/2009/01/28/wp_multilingual%e3%81%a7wordpress%e3%82%92%e5%a4%9a%e8%a8%80%e8%aa%9e%e5%8c%96/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 03:25:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.justoneplanet.info/?p=242</guid>
		<description><![CDATA[・・・できるんですが、パーマリンクの設定を行うとバグが発生するようです。具体的には・・・ ■Wordpress通常版 デフォルト以外のラジオボタンを選択すると リダイレクトがループして表示できなくなる。 対処方法としては [...]]]></description>
			<content:encoded><![CDATA[<p>・・・できるんですが、パーマリンクの設定を行うとバグが発生するようです。具体的には・・・</p>
<h4>■Wordpress通常版</h4>
<p>デフォルト以外のラジオボタンを選択すると</p>
<ul>
<li>リダイレクトがループして表示できなくなる。</li>
</ul>
<p>対処方法としてはパーマリンク設定を変更しない!?「数字ベース」を選択するとブログの表示は出来るようだが、設定画面でエラーがでる。</p>
<h4>■Wordpress MU</h4>
<p>設定＞パーマリンクの設定をクリックすると</p>
<ul>
<li>リダイレクトがループして表示できなくなる。</li>
<li>「管理」が表示されなくなる。</li>
</ul>
<p>言語のアクティベートを解除して、もう一度アクティベートをすると不具合が解消される。ただしパーマリンク設定の変更は現状出来ない。</p>
<h4>■ダウンロード</h4>
<p><a href="http://wordpress.org/extend/plugins/wp-multilingual/">こちら</a>から行えます</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justoneplanet.info/2009/01/28/wp_multilingual%e3%81%a7wordpress%e3%82%92%e5%a4%9a%e8%a8%80%e8%aa%9e%e5%8c%96/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressの各権限で出来る事</title>
		<link>http://blog.justoneplanet.info/2007/10/31/wordpress%e3%81%ae%e5%90%84%e6%a8%a9%e9%99%90%e3%81%a7%e5%87%ba%e6%9d%a5%e3%82%8b%e4%ba%8b/</link>
		<comments>http://blog.justoneplanet.info/2007/10/31/wordpress%e3%81%ae%e5%90%84%e6%a8%a9%e9%99%90%e3%81%a7%e5%87%ba%e6%9d%a5%e3%82%8b%e4%ba%8b/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 08:16:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://justoneplanet.sakura.ne.jp/wordpress/2007/10/31/wordpress%e3%81%ae%e5%90%84%e6%a8%a9%e9%99%90%e3%81%a7%e5%87%ba%e6%9d%a5%e3%82%8b%e4%ba%8b/</guid>
		<description><![CDATA[■Administrator いわゆる管理者。無制限状態。なんでも出来る ■Editor 編集者。ダッシュボード、投稿、管理（アップロード使用可）、ブログロール、プロフィールが操作可能 ■Author 投稿者。ダッシュボ [...]]]></description>
			<content:encoded><![CDATA[<h4>■Administrator</h4>
<p>いわゆる管理者。無制限状態。なんでも出来る</p>
<h4>■Editor</h4>
<p>編集者。ダッシュボード、投稿、管理（アップロード使用可）、ブログロール、プロフィールが操作可能</p>
<h4>■Author</h4>
<p>投稿者。ダッシュボード、投稿、管理（アップロード使用可）、プロフィールが操作可能</p>
<h4>■Contributor</h4>
<p>寄稿者。ダッシュボード、投稿、管理（アップロード使用不可）、プロフィールが操作可能</p>
<h4>■Subscriber</h4>
<p>購読者。ダッシュボードとプロフィールが操作可能</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justoneplanet.info/2007/10/31/wordpress%e3%81%ae%e5%90%84%e6%a8%a9%e9%99%90%e3%81%a7%e5%87%ba%e6%9d%a5%e3%82%8b%e4%ba%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>超初心者のWordPress改造</title>
		<link>http://blog.justoneplanet.info/2007/07/23/%e8%b6%85%e5%88%9d%e5%bf%83%e8%80%85%e3%81%ae%e7%82%ba%e3%81%aewordpress%e6%94%b9%e9%80%a0%e8%ac%9b%e5%ba%a7%ef%bc%881%ef%bc%89/</link>
		<comments>http://blog.justoneplanet.info/2007/07/23/%e8%b6%85%e5%88%9d%e5%bf%83%e8%80%85%e3%81%ae%e7%82%ba%e3%81%aewordpress%e6%94%b9%e9%80%a0%e8%ac%9b%e5%ba%a7%ef%bc%881%ef%bc%89/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 05:57:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://justoneplanet.sakura.ne.jp/wordpress/2007/07/23/%e8%b6%85%e5%88%9d%e5%bf%83%e8%80%85%e3%81%ae%e7%82%ba%e3%81%aewordpress%e6%94%b9%e9%80%a0%e8%ac%9b%e5%ba%a7%ef%bc%881%ef%bc%89/</guid>
		<description><![CDATA[■前置き 自己責任において行ってください ■本日の目的 サイドバーに手を加えよう！ ■必要なスキル HTMLを書いた事がある PHPという単語の意味を知っている。 「がんばり」 ■編集ファイル（sidebar.php）  [...]]]></description>
			<content:encoded><![CDATA[<h3>■前置き</h3>
<p>自己責任において行ってください</p>
<h3>■本日の目的</h3>
<ul>
<li>サイドバーに手を加えよう！</li>
</ul>
<h3>■必要なスキル</h3>
<ul>
<li>HTMLを書いた事がある</li>
<li>PHPという単語の意味を知っている。</li>
<li>「がんばり」</li>
</ul>
<h3>■編集ファイル（sidebar.php）</h3>
<p>下記、対象ファイルのソースコード<br />
デフォルトの場合はwp-content/themes/EasyAll/のファイルに手を加えます。</p>
<pre class="brush: php;">
&lt;ul&gt;
&lt;?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?&gt;
&lt;li id=&quot;calendar&quot;&gt;&lt;h2&gt;&lt;?php _e('Calendar'); ?&gt;&lt;/h2&gt;
&lt;?php get_calendar(); ?&gt;
&lt;/li&gt;
&lt;li id=&quot;search&quot;&gt;
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;
&lt;div&gt;
&lt;input type=&quot;text&quot; name=&quot;s&quot; id=&quot;s&quot; size=&quot;15&quot; /&gt; &lt;input type=&quot;submit&quot; value=&quot;&lt;?php _e('Search'); ?&gt;&quot; /&gt;
&lt;/div&gt;
&lt;/form&gt;
&lt;/li&gt;
&lt;?php get_links_list(); ?&gt;
&lt;li&gt;&lt;h2&gt;&lt;?php _e('Archives'); ?&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;?php wp_get_archives('type=monthly&amp;show_post_count=true'); ?&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;h2&gt;&lt;?php _e('Categories'); ?&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;?php list_cats(0, '', 'name', 'asc', '', 1, 0, 1, 1, 1, 1, 0,'','','','','') ?&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li id=&quot;meta&quot;&gt;&lt;h2&gt;&lt;?php _e('Meta'); ?&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;?php wp_register(); ?&gt;
&lt;li&gt;&lt;?php wp_loginout(); ?&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('rss2_url'); ?&gt;&quot; title=&quot;&lt;?php _e('Syndicate this site using RSS'); ?&gt;&quot;&gt;&lt;?php _e('&lt;abbr title=&quot;Really Simple Syndication&quot;&gt;RSS&lt;/abbr&gt;'); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&lt;?php bloginfo('comments_rss2_url'); ?&gt;&quot; title=&quot;&lt;?php _e('The latest comments to all posts in RSS'); ?&gt;&quot;&gt;&lt;?php _e('Comments &lt;abbr title=&quot;Really Simple Syndication&quot;&gt;RSS&lt;/abbr&gt;'); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://validator.w3.org/check/referer&quot; title=&quot;&lt;?php _e('This page validates as XHTML 1.0 Transitional'); ?&gt;&quot;&gt;&lt;?php _e('Valid &lt;abbr title=&quot;eXtensible HyperText Markup Language&quot;&gt;XHTML&lt;/abbr&gt;'); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gmpg.org/xfn/&quot;&gt;&lt;abbr title=&quot;XHTML Friends Network&quot;&gt;XFN&lt;/abbr&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;?php echo sprintf(__('&lt;a href=&quot;http://wordpress.org/&quot; title=&quot;%s&quot;&gt;WordPress&lt;/a&gt;'), __(&quot;Powered by WordPress, state-of-the-art semantic personal publishing platform.&quot;)); ?&gt;&lt;/li&gt;
&lt;?php wp_meta(); ?&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;?php endif; ?&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;!-- end sidebar --&gt;
</pre>
<h3>■チャレンジ！</h3>
<h4>カレンダーが要らないという方！</h4>
<pre class="brush: php;">
&lt;li id=&quot;calendar&quot;&gt;&lt;h2&gt;&lt;?php _e('Calendar'); ?&gt;&lt;/h2&gt;
&lt;?php get_calendar(); ?&gt;
&lt;/li&gt;
</pre>
<p>を削除しましょう。</p>
<h4>同様に検索窓が要らないという方</h4>
<pre class="brush: xml;">
&lt;li&gt;
</pre>
<p>から</p>
<pre class="brush: xml;">
&lt;/li&gt;
</pre>
<p>を削除すればイイ。ここは&lt;li&gt;タグで各パーツが区切られているわけですな。例えば、</p>
<pre class="brush: php;">
&lt;div id=&quot;techno&quot; class=&quot;mb1em&quot;&gt;
&lt;a href=&quot;http://www.technorati.jp/faves?sub=addfavbtn&amp;add=http://blog.justoneplanet.info/&quot;&gt;&lt;img src=&quot;http://static.technorati.jp/pix/fave/btn-fave2.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
</pre>
<p>を&lt;ul&gt;タグの前に挿入すればテクノラティのお気に入りボタンが挿入できるわけです。</p>
<h3>■応用すると</h3>
<p>左のようにGoogle Adsenceを挿入したりできるわけです。</p>
<h3>■注意点</h3>
<p>&lt;php?から?&gt;まではPHPスクリプトが書いてある部分なので多少HTMLとは話が違ってきます。慎重な方、心臓が弱い方は手を加えない方が宜しいですな。</p>
<h3>■その他</h3>
<p>まぁ気長に頑張りましょう。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justoneplanet.info/2007/07/23/%e8%b6%85%e5%88%9d%e5%bf%83%e8%80%85%e3%81%ae%e7%82%ba%e3%81%aewordpress%e6%94%b9%e9%80%a0%e8%ac%9b%e5%ba%a7%ef%bc%881%ef%bc%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress（ME2.2.1）をsakuraインターネットに…</title>
		<link>http://blog.justoneplanet.info/2007/07/11/wordpress%ef%bc%88me221%ef%bc%89%e3%82%92sakura%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%8d%e3%83%83%e3%83%88%e3%81%ab/</link>
		<comments>http://blog.justoneplanet.info/2007/07/11/wordpress%ef%bc%88me221%ef%bc%89%e3%82%92sakura%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%8d%e3%83%83%e3%83%88%e3%81%ab/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 14:49:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://justoneplanet.sakura.ne.jp/wordpress/2007/07/11/wordpress%ef%bc%88me221%ef%bc%89%e3%82%92sakura%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%8d%e3%83%83%e3%83%88%e3%81%ab/</guid>
		<description><![CDATA[まずはダウンロード http://sourceforge.jp/projects/wordpress/files/ ダウンロードしたら圧縮してあるので解凍しましょう。 ファイル名は「wordpress-me221.zip [...]]]></description>
			<content:encoded><![CDATA[<p><strong>まずはダウンロード</strong></p>
<p><a href="http://sourceforge.jp/projects/wordpress/files/">http://sourceforge.jp/projects/wordpress/files/</a><br />
ダウンロードしたら圧縮してあるので解凍しましょう。</p>
<p>ファイル名は「wordpress-me221.zip」<br />
解凍後、 FTPクライアントでアップロードします。</p>
<ul>
<li>FTPって何？という方・・・<a href="http://www.google.co.jp/search?source=ig&amp;hl=ja&amp;q=vector+ffftp+%E3%83%80%E3%82%A6%E3%83%B3%E3%83%AD%E3%83%BC%E3%83%89&amp;btnG=Google+%E6%A4%9C%E7%B4%A2&amp;lr=">Googleで「ffftp ダウンロード vector」</a>とか入力してダウンロードして使ってみてください。</li>
<li>但し wordpress-me221の中に wordpressというフォルダが入っているのでwordpressのフォルダをアップしましょう。（間違えてもインストールは出来る）</li>
</ul>
<p>さて僕の場合はwordpressフォルダをアップしたので、FFFTPで言うとFFFTPで言うと右側の<strong>wordpressフォルダで右クリック</strong>。属性変更を選択し<strong>707</strong>もしくは<strong>777</strong>を入力します。</p>
<p class="fs80 ml1em">そしたらhttp://www.example.com/wordpress/ をブラウザで入力します。WordPressをインストールしたディレクトリですね。<br />
普通の人はこれでサクサクインストールできるらしい<br />
その場合は<strong>ディレクトリのパーミッションを705もしくは755に戻し</strong>、直にファイルを編集します。wp-admin/install.php、wp-admin/upgrade.php を削除します</p>
<p>.htaccessなど設置して   http://www.example.com/wordpress/を直接たたけない方。というか僕。 wp-config.phpを直接テキストエディタで開き編集しましょう。</p>
<pre class="brush: php;">
define('DB_NAME', '●●●●●●●●●');    // The name of the database
define('DB_USER', '●●●●●●●●●');     // Your MySQL username
define('DB_PASSWORD', '*******'); // ...and password
define('DB_HOST', 'mysql??.db.sakura.ne.jp');    // 99% chance you won't need
</pre>
<p>とデーターベースの設定をしましょう。<br />
他に文字コードなども設定できますが特に僕は必要なかったので。</p>
<p>そしたらブラウザで・・・/wp-admin/install.phpと入力→データーベースにテーブルが作成されます。<br />
画面にadminとパスワードが表示されます。<br />
<strong>絶対にパスワードは忘れないで</strong>下さいね。</p>
<p>別のphpファイル用の<strong>php.ini</strong>がまずかったらしく</p>
<p>WordPress用のディレクトリには被らないようにして<br />
何とか正しく表示されるようになりました♪</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.justoneplanet.info/2007/07/11/wordpress%ef%bc%88me221%ef%bc%89%e3%82%92sakura%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%8d%e3%83%83%e3%83%88%e3%81%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

