';
$ret .= $text . '';
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('' . $download_url .'' ,3);
if (!empty($en_download_url)){
$ret .= text_indent(_AM_XP2_WP_INFO_4,2);
$ret .= text_indent('' . $en_download_url .'' ,3);
}
} else {
$ret .= text_indent(sprintf(_AM_XP2_WP_INFO_2,$locale));
$ret .= text_indent(_AM_XP2_WP_INFO_3,2);
$ret .= text_indent('WordPress_in_Your_Language' ,3);
$ret .= text_indent(_AM_XP2_WP_INFO_4,2);
$ret .= text_indent('' . $download_url .'' ,3);
}
echo $ret;
}
}
function wp_install_guide(){
global $modInfo;
$mydirpath = dirname( dirname( dirname( __FILE__ ) ) ) ;
$mydirname = basename(dirname( dirname( dirname( __FILE__ ) ) )) ;
$xoops_lang = @$GLOBALS["xoopsConfig"]['language'];
if (!$modInfo->is_wp_file_found()){
//Download
echo $modInfo->get_mod_image_link('check_bad_s.png');
echo ''._AM_XP2_WP_CHK_0 .'
';
echo '
';
echo text_indent(_AM_XP2_WP_CHK_1 . _AM_XP2_WP_CHK_2);
echo '
';
echo text_indent(_AM_XP2_WP_STEP_1,1,'font-weight:bold;');
echo get_download_info('ja');
echo '
';
// Uncompress
echo text_indent(_AM_XP2_WP_STEP_2,1,'font-weight:bold;');
echo text_indent(_AM_XP2_WP_INFO_5,2);
echo '
';
echo '