Index: trunk/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 154)
+++ trunk/wp-content/plugins/xpressme/include/custom_functions.php	(revision 155)
@@ -1,3 +1,17 @@
 <?php
+function xpress_selected_author($show=true ) {
+	$output = '';
+  	$author_cookie = get_xpress_dir_name() . "_select_author" ;
+  	if (!empty($_COOKIE[$author_cookie])){
+  		$uid = intval($_COOKIE[$author_cookie]);
+  		$user_info = get_userdata($uid);
+  		$output = $user_info->display_name;
+  	}
+	if (empty($show))
+		return $output;
+	else
+		echo $output;
+		
+}
 	
 function xpress_list_pings($trackback, $args, $depth) {
@@ -199,4 +213,10 @@
 }
 
+function xpress_is_multi_user(){
+	global $xpress_config;
+	return $xpress_config->is_multi_user;
+}
+
+
 function xpress_substr($str, $start, $length, $trimmarker = '...')
 {
@@ -352,4 +372,6 @@
 function xpress_conditional_title($display = true)
 {
+	$selected_author = xpress_selected_author(false);
+	
 	$output = __('Main', 'xpressme');
 	if (is_category())
@@ -363,8 +385,13 @@
 	if (is_year())
 		$output = sprintf(__('Archive for %s|Yearly archive page', 'xpressme'), get_the_time(__('Y', 'xpressme')));
-	if (is_author())
-		$output = sprintf(__('Archive for the &#8216;%s&#8217; Author', 'xpressme'), get_author_name( get_query_var('author')));
+	if (is_author()){
+		if (empty($selected_author))
+			$output = sprintf(__('Archive for the &#8216;%s&#8217; Author', 'xpressme'), get_author_name( get_query_var('author')));
+	}
 	if (is_search())
 		$output = sprintf(__('Search Results of word &#8216;%s&#8217;', 'xpressme'), get_search_query());
+	
+	if (!empty($selected_author))
+	$output = sprintf(__('Article of %s', 'xpressme'), $selected_author) . ' - ' . $output;
 		
 	if ($display) 
Index: trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php
===================================================================
--- trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 154)
+++ trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php	(revision 155)
@@ -235,3 +235,58 @@
 }
 
+function xpress_set_author_cookie()
+{
+	$author_cookie = get_xpress_dir_name() . "_select_author" ;
+	if(xpress_is_multi_user()){
+		if (empty($_GET)){
+	//		$GLOBALS["wp_xoops_author"] = null;
+			setcookie($author_cookie, 0);
+			$_COOKIE[$author_cookie] = 0;
+			
+		} else {
+			$auth = intval( @$_GET["author"] );
+			if ($auth > 0){
+				setcookie($author_cookie, $auth);
+				$_COOKIE[$author_cookie] = $auth;
+			}
+		}
+	}else{
+	//	$GLOBALS["wp_xoops_author"] = null;
+		setcookie($author_cookie, 0);
+		$_COOKIE[$author_cookie] = 0;
+	}
+}
+
+function xpress_query_filter(&$query)
+{
+	$author_cookie = get_xpress_dir_name() . "_select_author" ;
+	
+	if (strpos($query,'SELECT') !==0)  return $query;
+
+	$select_pattern = "SELECT(.*)post_author(.*)FROM";
+	if (preg_match ( "/".$select_pattern."/i", $query, $select_match ))
+		return $query;
+
+	$query = preg_replace('/\s\s+/', ' ', $query);
+	if (!empty($_COOKIE[$author_cookie])){
+		$pattern = "WHERE(.*)post_type(.*)=(.*)'post'";
+		if ( preg_match ( "/".$pattern."/i", $query, $match ) ){
+			$where_str = "$match[0]";
+			$where_arry = split(' ',$where_str);
+			$post_prefix = '';
+			foreach ($where_arry as $p){
+				if ( preg_match ( "/post_type/", $p, $match3 ) ){
+					$post_prefix = preg_replace("/post_type/", "", $p);
+					break;
+				}
+			}
+			preg_match ( "/post_type(.*)/", $where_str, $p_match );
+			$patern = $p_match[0];
+			$replace = $patern . " AND {$post_prefix}post_author = " . intval($_COOKIE[$author_cookie]) . " ";
+			$query = preg_replace("/$patern/", $replace, $query);
+		}
+	}
+//	xpress_show_sql_quary($query);
+	return $query;
+}
 ?>
Index: trunk/wp-content/plugins/xpressme/language/xpressme-ja.po
===================================================================
--- trunk/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 154)
+++ trunk/wp-content/plugins/xpressme/language/xpressme-ja.po	(revision 155)
@@ -3,5 +3,5 @@
 "Project-Id-Version: XPressME Plugin\n"
 "POT-Creation-Date: \n"
-"PO-Revision-Date: 2009-04-02 14:04+0900\n"
+"PO-Revision-Date: 2009-04-04 18:30+0900\n"
 "Last-Translator: toemon <toychee@toemon.com>\n"
 "Language-Team: \n"
@@ -15,346 +15,357 @@
 "X-Poedit-SearchPath-0: .\n"
 
-#: xpressme_class.php:42
+#: xpressme_class.php:43
 msgid "XPressME Settings"
 msgstr "XPressME設定"
 
-#: xpressme_class.php:59
-#: xpressme_class.php:186
+#: xpressme_class.php:60
+#: xpressme_class.php:206
 msgid "Older Post"
 msgstr "前の投稿へ"
 
-#: xpressme_class.php:60
-#: xpressme_class.php:188
+#: xpressme_class.php:61
+#: xpressme_class.php:208
 msgid "Newer Post"
 msgstr "次の投稿へ"
 
-#: xpressme_class.php:62
-#: xpressme_class.php:191
+#: xpressme_class.php:63
+#: xpressme_class.php:211
 msgid "Older Entries"
 msgstr "前ページへ"
 
-#: xpressme_class.php:63
-#: xpressme_class.php:193
+#: xpressme_class.php:64
+#: xpressme_class.php:213
 msgid "Newer Entries"
 msgstr "次ページへ"
 
-#: xpressme_class.php:77
+#: xpressme_class.php:78
 msgid "more"
 msgstr "続きを読む"
 
-#: xpressme_class.php:244
-#: xpressme_class.php:260
-#: xpressme_class.php:628
-#: xpressme_class.php:633
-#: xpressme_class.php:643
+#: xpressme_class.php:264
+#: xpressme_class.php:280
 #: xpressme_class.php:648
+#: xpressme_class.php:653
+#: xpressme_class.php:659
+#: xpressme_class.php:670
+#: xpressme_class.php:675
 msgid "YES"
 msgstr "はい"
 
-#: xpressme_class.php:245
-#: xpressme_class.php:261
-#: xpressme_class.php:629
-#: xpressme_class.php:634
-#: xpressme_class.php:644
+#: xpressme_class.php:265
+#: xpressme_class.php:281
 #: xpressme_class.php:649
+#: xpressme_class.php:654
+#: xpressme_class.php:660
+#: xpressme_class.php:671
+#: xpressme_class.php:676
 msgid "NO"
 msgstr "いいえ"
 
-#: xpressme_class.php:303
+#: xpressme_class.php:323
 msgid "Single Post Navi Setting"
 msgstr "シングルポストナビの設定"
 
-#: xpressme_class.php:308
-#: xpressme_class.php:353
+#: xpressme_class.php:328
+#: xpressme_class.php:373
 msgid "Adjustment of Navi link display position"
 msgstr "リンクの表示位置設定"
 
-#: xpressme_class.php:311
+#: xpressme_class.php:331
 msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right"
 msgstr "以前の記事へのリンクを左に、より新しい記事へのリンクを右に表示"
 
-#: xpressme_class.php:312
+#: xpressme_class.php:332
 msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right"
 msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示"
 
-#: xpressme_class.php:318
+#: xpressme_class.php:338
 msgid "Select Display name of PostNavi Link"
 msgstr "表示するリンクテキストを選択"
 
-#: xpressme_class.php:321
+#: xpressme_class.php:341
 msgid "Title of post"
 msgstr "投稿記事のタイトルを表示"
 
-#: xpressme_class.php:322
+#: xpressme_class.php:342
 msgid "Title of Navi"
 msgstr "ナビタイトルを表示"
 
-#: xpressme_class.php:328
+#: xpressme_class.php:348
 msgid "Display Navi Title of Old Post Link"
 msgstr "古い記事へのナビタイトルを設定"
 
-#: xpressme_class.php:335
+#: xpressme_class.php:355
 msgid "Display Navi Title of Newer Post Link"
 msgstr "より新しい記事へのナビタイトルを設定"
 
-#: xpressme_class.php:348
+#: xpressme_class.php:368
 msgid "Posts List Page Navi Setting"
 msgstr "ポストリストページナビの設定"
 
-#: xpressme_class.php:356
+#: xpressme_class.php:376
 msgid "'Old Page Link' is displayed in the left, and 'Newer Page Link' is displayed in the right"
 msgstr "古いページへのリンクを左に、より新しいページへのリンクを右に表示"
 
-#: xpressme_class.php:357
+#: xpressme_class.php:377
 msgid "'Newer Page Link' is displayed in the left, and 'Old Page Link' is displayed in the right"
 msgstr "より新しいページへのリンクを左に、古いページへのリンクを右に表示"
 
-#: xpressme_class.php:363
+#: xpressme_class.php:383
 msgid "Display Navi Title of Old Page Link"
 msgstr "古いページへのナビタイトルを設定"
 
-#: xpressme_class.php:370
+#: xpressme_class.php:390
 msgid "Display Navi Title of Newer Page Link"
 msgstr "より新しいページへのナビタイトルを設定"
 
-#: xpressme_class.php:385
+#: xpressme_class.php:405
 msgid "Role Setting at Login"
 msgstr "ログイン時の権限設定"
 
-#: xpressme_class.php:388
+#: xpressme_class.php:408
 msgid "XOOPS Groupe"
 msgstr "XOOPSグループ名"
 
-#: xpressme_class.php:388
+#: xpressme_class.php:408
 msgid "WordPress Role"
 msgstr "WordPressでの権限"
 
-#: xpressme_class.php:388
+#: xpressme_class.php:408
 msgid "Role is set at each login"
 msgstr "ログイン時、常に権限を更新する"
 
-#: xpressme_class.php:414
-#: xpressme_class.php:418
-#: xpressme_class.php:421
+#: xpressme_class.php:434
+#: xpressme_class.php:438
+#: xpressme_class.php:441
 msgid "Default Role of WordPress"
 msgstr "WordPressのデフォルト権限"
 
-#: xpressme_class.php:415
-#: xpressme_class.php:419
-#: xpressme_class.php:422
+#: xpressme_class.php:435
+#: xpressme_class.php:439
+#: xpressme_class.php:442
 msgid "Group User Doesn't Register"
 msgstr "ユーザ登録しない"
 
-#: xpressme_class.php:451
+#: xpressme_class.php:471
 msgid "Do Not Comment Integration."
 msgstr "コメント統合しません。"
 
-#: xpressme_class.php:485
+#: xpressme_class.php:505
 msgid "Comment integration with D3Forum"
 msgstr "D3Forumとのコメント統合"
 
-#: xpressme_class.php:487
+#: xpressme_class.php:507
 msgid "Select the forum of D3Forum that does the comment integration from the following lists."
 msgstr "以下のリストからコメント統合をするD3Forumのフォーラムを選択してください。"
 
-#: xpressme_class.php:491
+#: xpressme_class.php:511
 msgid "Select the Type of display of D3Forum comment."
 msgstr "D3Forumの表示タイプを選択"
 
-#: xpressme_class.php:493
-#: xpressme_class.php:496
+#: xpressme_class.php:513
+#: xpressme_class.php:516
 msgid "Flat"
 msgstr "フラット"
 
-#: xpressme_class.php:494
-#: xpressme_class.php:497
+#: xpressme_class.php:514
+#: xpressme_class.php:517
 msgid "Threaded"
 msgstr "スレッド"
 
-#: xpressme_class.php:500
+#: xpressme_class.php:520
 msgid "Select the order of display of D3Forum comment."
 msgstr "D3Forumコメントの表示順を選択"
 
-#: xpressme_class.php:502
-#: xpressme_class.php:505
+#: xpressme_class.php:522
+#: xpressme_class.php:525
 msgid "DESC"
 msgstr "降順"
 
-#: xpressme_class.php:503
-#: xpressme_class.php:506
+#: xpressme_class.php:523
+#: xpressme_class.php:526
 msgid "ASC"
 msgstr "昇順"
 
-#: xpressme_class.php:509
+#: xpressme_class.php:529
 msgid "Number of displays of D3Forum comments."
 msgstr "D3Forumのコメント表示数"
 
-#: xpressme_class.php:513
+#: xpressme_class.php:533
 msgid "The import and the export between Wordpress Comments and the D3Forum Posts can be done. "
 msgstr "WordPressコメントとD3Forumポスト間の一括転送（エクスポート・インポート）"
 
-#: xpressme_class.php:514
+#: xpressme_class.php:534
 msgid "Export to D3Forum"
 msgstr "D3Forumへ一括エクスポート"
 
-#: xpressme_class.php:515
+#: xpressme_class.php:535
 msgid "Import from D3Forum"
 msgstr "D3Forumから一括インポート"
 
-#: xpressme_class.php:527
+#: xpressme_class.php:547
 msgid "Contents Excerpt Setting"
 msgstr "記事抜粋の設定"
 
-#: xpressme_class.php:532
+#: xpressme_class.php:552
 msgid "Is the excerpt display done with the archive of contents?"
 msgstr "記事のアーカイブで抜粋表示を行いますか？"
 
-#: xpressme_class.php:539
+#: xpressme_class.php:559
 msgid "When ASCII character more than the set ratio is included, it is judged ASCII contents. "
 msgstr "ASCII文字が含まれる比率が設定された値より大きい場合、ASCII文字コンテンツと判断します。"
 
-#: xpressme_class.php:546
+#: xpressme_class.php:566
 msgid "Excerpt length of word for ASCII contents"
 msgstr "ASCIIコンテンツの抜粋単語数"
 
-#: xpressme_class.php:553
+#: xpressme_class.php:573
 msgid "Excerpt length of character for multibyte contents"
 msgstr "マルチバイトコンテンツの抜粋文字数"
 
-#: xpressme_class.php:560
+#: xpressme_class.php:580
 msgid "More Link Text (Is not displayed for the blank.)"
 msgstr "Moreリンクテキスト（ブランクの場合リンクを表示しません。）"
 
-#: xpressme_class.php:572
+#: xpressme_class.php:592
 msgid "Display Mode Setting"
 msgstr "表示モード設定"
 
-#: xpressme_class.php:575
+#: xpressme_class.php:595
 msgid "Select the XPressME Display Mode."
 msgstr "XPressMEの表示モードの選択"
 
-#: xpressme_class.php:580
+#: xpressme_class.php:600
 msgid "Xoops Mode"
 msgstr "XOOPSモード"
 
-#: xpressme_class.php:584
+#: xpressme_class.php:604
 msgid "WordPress Mode"
 msgstr "WordPressモード"
 
-#: xpressme_class.php:588
+#: xpressme_class.php:608
 msgid "User select"
 msgstr "ユーザによる選択"
 
-#: xpressme_class.php:617
+#: xpressme_class.php:637
 msgid "XPressME Configuration Page"
 msgstr "XPressMEの設定ページ"
 
-#: xpressme_class.php:622
+#: xpressme_class.php:642
 msgid "Media Upload Base Path"
 msgstr "メディアアップロードのベースパス設定"
 
-#: xpressme_class.php:623
+#: xpressme_class.php:643
 msgid "Use XOOPS UPLOAD PATH"
 msgstr "XOOPSのアップロードパスを使用する。"
 
-#: xpressme_class.php:624
+#: xpressme_class.php:644
 msgid "USE WordPress BASE_PATH"
 msgstr "WordPressのベースパスを使用する。"
 
-#: xpressme_class.php:627
+#: xpressme_class.php:647
 msgid "Thema Sidebar Display"
 msgstr "テーマ表示時にサイドバー表示する。"
 
-#: xpressme_class.php:632
+#: xpressme_class.php:652
 msgid "The change tracking of the post is preserved"
 msgstr "投稿の変更履歴を有効にする。"
 
-#: xpressme_class.php:642
+#: xpressme_class.php:658
+msgid "Select Multi user mode"
+msgstr "マルチユーザーモードを選択"
+
+#: xpressme_class.php:669
 msgid "Is the posts author views counted?"
 msgstr "投稿者の閲覧をカウントしますか？"
 
-#: xpressme_class.php:647
+#: xpressme_class.php:674
 msgid "Is SQL debugging window displayed?"
 msgstr "SQLデバッグウィンドを表示しますか？"
 
-#: xpressme_class.php:659
+#: xpressme_class.php:686
 msgid "Update Config"
 msgstr "更新"
 
-#: xpressme_class.php:660
+#: xpressme_class.php:687
 msgid "Preset Config"
 msgstr "プリセット"
 
-#: include/custom_functions.php:238
+#: include/custom_functions.php:258
 #, php-format
 msgid "views :%d"
 msgstr "閲覧数 :%d"
 
-#: include/custom_functions.php:354
+#: include/custom_functions.php:376
 msgid "Main"
 msgstr "メイン"
 
-#: include/custom_functions.php:356
+#: include/custom_functions.php:378
 #, php-format
 msgid "Archive for the &#8216;%s&#8217; Category"
 msgstr "カテゴリー &#8216;%s&#8217; のアーカイブ"
 
-#: include/custom_functions.php:358
+#: include/custom_functions.php:380
 #, php-format
 msgid "Posts Tagged &#8216;%s&#8217;"
 msgstr "&#8216;%s&#8217; タグのついている投稿"
 
-#: include/custom_functions.php:360
+#: include/custom_functions.php:382
 #, php-format
 msgid "Archive for %s|Daily archive page"
 msgstr "%sの日別アーカイブ"
 
-#: include/custom_functions.php:360
+#: include/custom_functions.php:382
 msgid "F jS, Y"
 msgstr "Y年n月j日"
 
-#: include/custom_functions.php:362
+#: include/custom_functions.php:384
 #, php-format
 msgid "Archive for %s|Monthly archive page"
 msgstr "%sの月別アーカイブ"
 
-#: include/custom_functions.php:362
+#: include/custom_functions.php:384
 msgid "F, Y"
 msgstr "Y年n月"
 
-#: include/custom_functions.php:364
+#: include/custom_functions.php:386
 #, php-format
 msgid "Archive for %s|Yearly archive page"
 msgstr "%sの年別アーカイブ "
 
-#: include/custom_functions.php:364
+#: include/custom_functions.php:386
 msgid "Y"
 msgstr "Y年"
 
-#: include/custom_functions.php:366
+#: include/custom_functions.php:389
 #, php-format
 msgid "Archive for the &#8216;%s&#8217; Author"
 msgstr "投稿者 &#8216;%s&#8217; のアーカイブ"
 
-#: include/custom_functions.php:368
+#: include/custom_functions.php:392
 #, php-format
 msgid "Search Results of word &#8216;%s&#8217;"
 msgstr "&#8216;%s&#8217; の検索結果"
 
-#: include/custom_functions.php:382
+#: include/custom_functions.php:395
+#, php-format
+msgid "Article of %s"
+msgstr "%sの記事"
+
+#: include/custom_functions.php:410
 #, php-format
 msgid "From %1$s on site %2$s"
 msgstr "サイト %2$s の %1$s より"
 
-#: include/custom_functions.php:398
+#: include/custom_functions.php:433
 #, fuzzy
 msgid "% TrackBack/Pingback"
 msgstr "トラックバック・ピンバック % 件"
 
-#: include/custom_functions.php:400
+#: include/custom_functions.php:435
 msgid "No Trackback/Pingback"
 msgstr "トラックバック・ピンバックはありません"
 
-#: include/custom_functions.php:402
+#: include/custom_functions.php:437
 msgid "One Trackback/Pingback"
 msgstr "トラックバック・ピンバック 1 件"
Index: trunk/wp-content/plugins/xpressme/xpressme.php
===================================================================
--- trunk/wp-content/plugins/xpressme/xpressme.php	(revision 154)
+++ trunk/wp-content/plugins/xpressme/xpressme.php	(revision 155)
@@ -69,6 +69,13 @@
 }
 
+
+
+
 //The trackback and the pingback are excluded from the count of the comment. 
 add_filter('get_comments_number', 'xpress_comment_count', 0);
+
+// Query filter for  MultiUser
+add_filter('query','xpress_query_filter');
+add_action("init", "xpress_set_author_cookie");
 
 // SQL debug windows
Index: trunk/wp-content/plugins/xpressme/xpressme_class.php
===================================================================
--- trunk/wp-content/plugins/xpressme/xpressme_class.php	(revision 154)
+++ trunk/wp-content/plugins/xpressme/xpressme_class.php	(revision 155)
@@ -28,4 +28,5 @@
 	var $more_link_text;
 	var $viewer_type;
+	var $is_multi_user;
 	//constructor
 	function XPressME_Class()
@@ -77,4 +78,5 @@
 		$this->more_link_text = __('more', 'xpressme');
 		$this->viewer_type = 'xoops';
+		$this->is_multi_user = false;
 
 	}
@@ -124,5 +126,6 @@
 			'excerpt_length_character' => $this->excerpt_length_character,
 			'more_link_text' => $this->more_link_text,
-			'viewer_type' => $this->viewer_type
+			'viewer_type' => $this->viewer_type,
+			'is_multi_user' => $this->is_multi_user
 		);
 		if ($mode == 'add_new') {
@@ -235,5 +238,5 @@
 		$this->more_link_text = stripslashes(trim($_POST['ch_more_link_text']));
 		$this->viewer_type = stripslashes(trim($_POST['ch_viewer_type']));
-		
+		$this->is_multi_user = stripslashes(trim($_POST['ch_is_multi_user']));
 		global $xoops_db;
 		$table = get_wp_prefix() . 'group_role';	
@@ -652,4 +655,11 @@
 												);
 		
+		echo				$this->yes_no_radio_option('is_multi_user',
+												__('Select Multi user mode','xpressme'),
+												__('YES','xpressme'),
+												__('NO','xpressme')
+												);
+		
+		
 		echo 				$this->single_post_navi_option();
 		echo 				$this->posts_page_navi_option();
