Index: branches/Ver3.0/xpressme_integration_kit/admin/help/wp_install_help.php
===================================================================
--- branches/Ver3.0/xpressme_integration_kit/admin/help/wp_install_help.php	(revision 744)
+++ branches/Ver3.0/xpressme_integration_kit/admin/help/wp_install_help.php	(revision 757)
@@ -1,40 +1,112 @@
 <?php
+	function text_indent($text,$num = 1,$css_option='')
+	{
+		$ret = '';
+		$px = 24 * $num;
+		$ret = '<div style="padding-left:' .$px .'px;'.$css_option.'">';
+		$ret .= $text . '</div>';
+		return $ret;
+	}
+
+	function get_download_info($locale='')
+	{
+		global $modInfo;
+		$local_package = '';
+		$mysql_version = preg_replace('/[^0-9.].*/', '', $modInfo->get_mysql_version());
+		$php_version = $modInfo->get_php_version();
+
+		if (empty($locale)) $locale = $modInfo->get_wpLang();
+
+/* test		
+		$mysql_version='4.0.27';
+		$php_version = '4.1.1';
+*/
+		// wprdpress original option
+		// ?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package";
+		$option = "?php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package";
+		$url = "http://api.wordpress.org/core/version-check/1.5/" .$option;
+		$handle = @fopen($url,'r');
+		if ($handle) {
+			$ans = array();
+			$num = 0;
+			$pos = 0;
+	    	while (($buffer = fgets($handle, 4096)) !== false) {
+	    		$buffer = trim($buffer);
+	    		if (strlen($buffer) == 0) {
+	    			$num++;
+	    			$pos=0;
+	    		} else {
+	    			$ans[$num][$pos] = $buffer;
+	    			$pos++;
+	    		}
+	    	}
+	    	if (!feof($handle)) {
+	        	echo "Error: unexpected fgets() fail\n";
+	    	}
+	    	fclose($handle);
+		}
+		$ressponce = $ans[0][0];
+		$site_url = $ans[0][1];
+		$download_url = $ans[0][2];
+		$wp_version = $ans[0][3];
+		$download_lang = $ans[0][4];
+//		print_r($ans);
+		if (isset($ans[1])){
+			$en_download_url = $ans[1][2];
+		}
+		$ret = text_indent('(Check URL: '.$url.')',3);
+		if ($locale == $download_lang){
+			$ret .= text_indent(sprintf(_AM_XP2_WP_INFO_1,$locale),2);
+			$ret .= text_indent('<a href="'.$download_url.'">' . $download_url .'</a>' ,3);
+			if (!empty($en_download_url)){
+				$ret .= text_indent(_AM_XP2_WP_INFO_4,2);
+				$ret .= text_indent('<a href="'.$en_download_url .'">' . $en_download_url .'</a>' ,3);
+			}
+		} else {
+			$ret .= text_indent(sprintf(_AM_XP2_WP_INFO_2,$locale));
+			$ret .= text_indent(_AM_XP2_WP_INFO_3,2);
+			$ret .= text_indent('<a href="http://codex.wordpress.org/WordPress_in_Your_Language" target="	_blank">WordPress_in_Your_Language</a>' ,3);
+			$ret .= text_indent(_AM_XP2_WP_INFO_4,2);
+			$ret .= text_indent('<a href="'.$download_url.'">' . $download_url .'</a>' ,3);
+		}
+		echo $ret;
+	}
+}
+	
 	function wp_install_guide(){
+		global $modInfo;
 		$mydirpath = dirname( dirname( dirname( __FILE__ ) ) ) ;
 		$mydirname = basename(dirname( dirname( dirname( __FILE__ ) ) )) ;
-		include_once $mydirpath . '/class/wpInfo_class.php';
 		$xoops_lang = @$GLOBALS["xoopsConfig"]['language'];
-		$wp_info = new wpInfo;
-		$wp_lang = $wp_info->get_wpLang($xoops_lang);
-		if (!$wp_info->is_wp_file_found()){
+		if (!$modInfo->is_wp_file_found()){
 			//Download
-			echo $wp_info->get_mod_image_link('check_bad_s.png');
+			echo $modInfo->get_mod_image_link('check_bad_s.png');
 			echo '<font size="4" >'._AM_XP2_WP_CHK_0 .'</font><br />';
 			echo '<br />';
-			echo $wp_info->text_indent(_AM_XP2_WP_CHK_1 . _AM_XP2_WP_CHK_2);
+			echo text_indent(_AM_XP2_WP_CHK_1 . _AM_XP2_WP_CHK_2);
 			echo '<br />';
-			echo $wp_info->text_indent(_AM_XP2_WP_STEP_1,1,'font-weight:bold;');
-			echo $wp_info->get_download_info('ja');
+			echo text_indent(_AM_XP2_WP_STEP_1,1,'font-weight:bold;');
+			echo get_download_info('ja');
 			echo '<br />';
 			// Uncompress
-			echo $wp_info->text_indent(_AM_XP2_WP_STEP_2,1,'font-weight:bold;');
-			echo $wp_info->text_indent(_AM_XP2_WP_INFO_5,2);			
+			echo text_indent(_AM_XP2_WP_STEP_2,1,'font-weight:bold;');
+			echo text_indent(_AM_XP2_WP_INFO_5,2);			
 			echo '<br />';
-			echo '<div style="padding-left:60px;">'.$wp_info->get_mod_image_link('wp_uncompless.png') . '</div>';
+			echo '<div style="padding-left:60px;">'.$modInfo->get_mod_image_link('wp_uncompless.png') . '</div>';
 			echo '<br />';
 			// Upload Wordpress
-			echo $wp_info->text_indent(_AM_XP2_WP_STEP_3,1,'font-weight:bold;');
-			printf($wp_info->text_indent(_AM_XP2_WP_INFO_6,2),$mydirname);			
-			printf($wp_info->text_indent(_AM_XP2_WP_INFO_7,3),$mydirpath);			
-			echo $wp_info->text_indent(_AM_XP2_WP_INFO_8,2);
+			echo text_indent(_AM_XP2_WP_STEP_3,1,'font-weight:bold;');
+			printf(text_indent(_AM_XP2_WP_INFO_6,2),$mydirname);			
+			printf(text_indent(_AM_XP2_WP_INFO_7,3),$mydirpath);			
+			echo text_indent(_AM_XP2_WP_INFO_8,2);
 			echo '<br />';
-			echo '<div style="padding-left:60px;">'.$wp_info->get_mod_image_link('wp_upload.png') . '</div>';
+			echo '<div style="padding-left:60px;">'.$modInfo->get_mod_image_link('wp_upload.png') . '</div>';
 			echo '<br />';
 			//Install
-			echo $wp_info->text_indent(_AM_XP2_WP_STEP_4,1,'font-weight:bold;');
-			echo $wp_info->text_indent(_AM_XP2_WP_INFO_9,2);			
+			echo text_indent(_AM_XP2_WP_STEP_4,1,'font-weight:bold;');
+			echo text_indent(_AM_XP2_WP_INFO_9,2);			
 
 		} else {
-			echo $wp_info->get_mod_image_link('check_good_s.png');
+			echo $modInfo->get_mod_image_link('check_good_s.png');
 			echo '<font size="4" >'._AM_XP2_WP_CHK_0 .'</font><br />';
 			echo '<br />';
