- Timestamp:
- May 23, 2011, 3:03:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver3.0/xpressme_integration_kit/admin/help/wp_install_help.php
r744 r757 1 1 <?php 2 function text_indent($text,$num = 1,$css_option='') 3 { 4 $ret = ''; 5 $px = 24 * $num; 6 $ret = '<div style="padding-left:' .$px .'px;'.$css_option.'">'; 7 $ret .= $text . '</div>'; 8 return $ret; 9 } 10 11 function get_download_info($locale='') 12 { 13 global $modInfo; 14 $local_package = ''; 15 $mysql_version = preg_replace('/[^0-9.].*/', '', $modInfo->get_mysql_version()); 16 $php_version = $modInfo->get_php_version(); 17 18 if (empty($locale)) $locale = $modInfo->get_wpLang(); 19 20 /* test 21 $mysql_version='4.0.27'; 22 $php_version = '4.1.1'; 23 */ 24 // wprdpress original option 25 // ?version=$wp_version&php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package"; 26 $option = "?php=$php_version&locale=$locale&mysql=$mysql_version&local_package=$local_package"; 27 $url = "http://api.wordpress.org/core/version-check/1.5/" .$option; 28 $handle = @fopen($url,'r'); 29 if ($handle) { 30 $ans = array(); 31 $num = 0; 32 $pos = 0; 33 while (($buffer = fgets($handle, 4096)) !== false) { 34 $buffer = trim($buffer); 35 if (strlen($buffer) == 0) { 36 $num++; 37 $pos=0; 38 } else { 39 $ans[$num][$pos] = $buffer; 40 $pos++; 41 } 42 } 43 if (!feof($handle)) { 44 echo "Error: unexpected fgets() fail\n"; 45 } 46 fclose($handle); 47 } 48 $ressponce = $ans[0][0]; 49 $site_url = $ans[0][1]; 50 $download_url = $ans[0][2]; 51 $wp_version = $ans[0][3]; 52 $download_lang = $ans[0][4]; 53 // print_r($ans); 54 if (isset($ans[1])){ 55 $en_download_url = $ans[1][2]; 56 } 57 $ret = text_indent('(Check URL: '.$url.')',3); 58 if ($locale == $download_lang){ 59 $ret .= text_indent(sprintf(_AM_XP2_WP_INFO_1,$locale),2); 60 $ret .= text_indent('<a href="'.$download_url.'">' . $download_url .'</a>' ,3); 61 if (!empty($en_download_url)){ 62 $ret .= text_indent(_AM_XP2_WP_INFO_4,2); 63 $ret .= text_indent('<a href="'.$en_download_url .'">' . $en_download_url .'</a>' ,3); 64 } 65 } else { 66 $ret .= text_indent(sprintf(_AM_XP2_WP_INFO_2,$locale)); 67 $ret .= text_indent(_AM_XP2_WP_INFO_3,2); 68 $ret .= text_indent('<a href="http://codex.wordpress.org/WordPress_in_Your_Language" target=" _blank">WordPress_in_Your_Language</a>' ,3); 69 $ret .= text_indent(_AM_XP2_WP_INFO_4,2); 70 $ret .= text_indent('<a href="'.$download_url.'">' . $download_url .'</a>' ,3); 71 } 72 echo $ret; 73 } 74 } 75 2 76 function wp_install_guide(){ 77 global $modInfo; 3 78 $mydirpath = dirname( dirname( dirname( __FILE__ ) ) ) ; 4 79 $mydirname = basename(dirname( dirname( dirname( __FILE__ ) ) )) ; 5 include_once $mydirpath . '/class/wpInfo_class.php';6 80 $xoops_lang = @$GLOBALS["xoopsConfig"]['language']; 7 $wp_info = new wpInfo; 8 $wp_lang = $wp_info->get_wpLang($xoops_lang); 9 if (!$wp_info->is_wp_file_found()){ 81 if (!$modInfo->is_wp_file_found()){ 10 82 //Download 11 echo $ wp_info->get_mod_image_link('check_bad_s.png');83 echo $modInfo->get_mod_image_link('check_bad_s.png'); 12 84 echo '<font size="4" >'._AM_XP2_WP_CHK_0 .'</font><br />'; 13 85 echo '<br />'; 14 echo $wp_info->text_indent(_AM_XP2_WP_CHK_1 . _AM_XP2_WP_CHK_2);86 echo text_indent(_AM_XP2_WP_CHK_1 . _AM_XP2_WP_CHK_2); 15 87 echo '<br />'; 16 echo $wp_info->text_indent(_AM_XP2_WP_STEP_1,1,'font-weight:bold;');17 echo $wp_info->get_download_info('ja');88 echo text_indent(_AM_XP2_WP_STEP_1,1,'font-weight:bold;'); 89 echo get_download_info('ja'); 18 90 echo '<br />'; 19 91 // Uncompress 20 echo $wp_info->text_indent(_AM_XP2_WP_STEP_2,1,'font-weight:bold;');21 echo $wp_info->text_indent(_AM_XP2_WP_INFO_5,2);92 echo text_indent(_AM_XP2_WP_STEP_2,1,'font-weight:bold;'); 93 echo text_indent(_AM_XP2_WP_INFO_5,2); 22 94 echo '<br />'; 23 echo '<div style="padding-left:60px;">'.$ wp_info->get_mod_image_link('wp_uncompless.png') . '</div>';95 echo '<div style="padding-left:60px;">'.$modInfo->get_mod_image_link('wp_uncompless.png') . '</div>'; 24 96 echo '<br />'; 25 97 // Upload Wordpress 26 echo $wp_info->text_indent(_AM_XP2_WP_STEP_3,1,'font-weight:bold;');27 printf( $wp_info->text_indent(_AM_XP2_WP_INFO_6,2),$mydirname);28 printf( $wp_info->text_indent(_AM_XP2_WP_INFO_7,3),$mydirpath);29 echo $wp_info->text_indent(_AM_XP2_WP_INFO_8,2);98 echo text_indent(_AM_XP2_WP_STEP_3,1,'font-weight:bold;'); 99 printf(text_indent(_AM_XP2_WP_INFO_6,2),$mydirname); 100 printf(text_indent(_AM_XP2_WP_INFO_7,3),$mydirpath); 101 echo text_indent(_AM_XP2_WP_INFO_8,2); 30 102 echo '<br />'; 31 echo '<div style="padding-left:60px;">'.$ wp_info->get_mod_image_link('wp_upload.png') . '</div>';103 echo '<div style="padding-left:60px;">'.$modInfo->get_mod_image_link('wp_upload.png') . '</div>'; 32 104 echo '<br />'; 33 105 //Install 34 echo $wp_info->text_indent(_AM_XP2_WP_STEP_4,1,'font-weight:bold;');35 echo $wp_info->text_indent(_AM_XP2_WP_INFO_9,2);106 echo text_indent(_AM_XP2_WP_STEP_4,1,'font-weight:bold;'); 107 echo text_indent(_AM_XP2_WP_INFO_9,2); 36 108 37 109 } else { 38 echo $ wp_info->get_mod_image_link('check_good_s.png');110 echo $modInfo->get_mod_image_link('check_good_s.png'); 39 111 echo '<font size="4" >'._AM_XP2_WP_CHK_0 .'</font><br />'; 40 112 echo '<br />';
Note: See TracChangeset
for help on using the changeset viewer.