Changeset 757 for branches/Ver3.0/xpressme_integration_kit/admin
- Timestamp:
- May 23, 2011, 3:03:57 PM (14 years ago)
- Location:
- branches/Ver3.0/xpressme_integration_kit/admin
- Files:
-
- 2 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 />'; -
branches/Ver3.0/xpressme_integration_kit/admin/index.php
r749 r757 319 319 320 320 321 function xpress_config_report_view()322 {323 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;324 $xoops_config = new ConfigFromXoops;325 echo 'XOOPS_ROOT_PATH: ' ;326 if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)327 echo 'ERROR ';328 else329 echo 'OK ';330 echo "<br />\n";331 332 echo 'XOOPS_TRUST_PATH: ' ;333 if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)334 echo 'ERROR ';335 else336 echo 'OK ';337 echo "<br />\n";338 339 echo 'XOOPS_URL: ' ;340 if(XOOPS_URL !== $xoops_config->xoops_url)341 echo 'ERROR ';342 else343 echo 'OK ';344 echo "<br />\n";345 346 if (defined('XOOPS_SALT')){347 echo 'XOOPS_SALT: ' ;348 if(XOOPS_SALT !== $xoops_config->xoops_salt)349 echo 'ERROR ';350 else351 echo 'OK ';352 echo "<br />\n";353 }354 355 if (defined('XOOPS_DB_SALT')){356 echo 'XOOPS_DB_SALT: ' ;357 if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)358 echo 'ERROR ';359 else360 echo 'OK ';361 echo "<br />\n";362 }363 364 echo 'XOOPS_DB_HOST: ' ;365 if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)366 echo 'ERROR ';367 else368 echo 'OK ';369 echo "<br />\n";370 371 echo 'XOOPS_DB_USER: ' ;372 if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)373 echo 'ERROR ';374 else375 echo 'OK ';376 echo "<br />\n";377 378 echo 'XOOPS_DB_PASS: ' ;379 if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)380 echo 'ERROR ';381 else382 echo 'OK ';383 echo "<br />\n";384 385 echo 'XOOPS_DB_NAME: ' ;386 if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)387 echo 'ERROR ';388 else389 echo 'OK ';390 echo "<br />\n";391 392 echo 'XOOPS_DB_PREFIX: ' ;393 if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)394 echo 'ERROR ';395 else396 echo 'OK ';397 echo "<br />\n";398 }399 400 function xpress_config_nomal_view()401 {402 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;403 $xoops_config = new ConfigFromXoops;404 405 echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';406 echo '<tbody>';407 echo '<tr>';408 echo '<td>Define item</td>';409 echo '<td>XOOPS setting value</td>';410 echo '<td>xoops_config get value</td>';411 echo '</tr>';412 echo '<tr>';413 if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)414 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_ROOT_PATH</span></strong></td>';415 else416 echo '<td>XOOPS_ROOT_PATH</td>';417 echo '<td>' . XOOPS_ROOT_PATH . '</td>';418 echo '<td>' . $xoops_config->xoops_root_path . '</td>';419 echo '</tr>';420 421 echo '<tr>';422 if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)423 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_TRUST_PATH</span></strong></td>';424 else425 echo '<td>XOOPS_TRUST_PATH</td>';426 echo '<td>' . XOOPS_TRUST_PATH . '</td>';427 echo '<td>' . $xoops_config->xoops_trust_path . '</td>';428 echo '</tr>';429 430 echo '<tr>';431 if(XOOPS_URL !== $xoops_config->xoops_url)432 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_URL</span></strong></td>';433 else434 echo '<td>XOOPS_URL</td>';435 echo '<td>' . XOOPS_URL . '</td>';436 echo '<td>' . $xoops_config->xoops_url . '</td>';437 echo '</tr>';438 439 if (defined('XOOPS_SALT')){440 echo '<tr>';441 if(XOOPS_SALT !== $xoops_config->xoops_salt)442 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_SALT</span></strong></td>';443 else444 echo '<td>XOOPS_SALT</td>';445 echo '<td>' . XOOPS_SALT . '</td>';446 echo '<td>' . $xoops_config->xoops_salt . '</td>';447 echo '</tr>';448 }449 450 if (defined('XOOPS_DB_SALT')){451 echo '<tr>';452 if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)453 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_SALT</span></strong></td>';454 else455 echo '<td>XOOPS_DB_SALT</td>';456 echo '<td>' . XOOPS_DB_SALT . '</td>';457 echo '<td>' . $xoops_config->xoops_db_salt . '</td>';458 echo '</tr>';459 }460 461 echo '<tr>';462 if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)463 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_HOST</span></strong></td>';464 else465 echo '<td>XOOPS_DB_HOST</td>';466 echo '<td>' . XOOPS_DB_HOST . '</td>';467 echo '<td>' . $xoops_config->xoops_db_host . '</td>';468 echo '</tr>';469 470 echo '<tr>';471 if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)472 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_USER</span></strong></td>';473 else474 echo '<td>XOOPS_DB_USER</td>';475 echo '<td>' . XOOPS_DB_USER . '</td>';476 echo '<td>' . $xoops_config->xoops_db_user . '</td>';477 echo '</tr>';478 479 echo '<tr>';480 if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)481 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PASS</span></strong></td>';482 else483 echo '<td>XOOPS_DB_PASS</td>';484 echo '<td>' . XOOPS_DB_PASS . '</td>';485 echo '<td>' . $xoops_config->xoops_db_pass . '</td>';486 echo '</tr>';487 488 echo '<tr>';489 if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)490 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_NAME</span></strong></td>';491 else492 echo '<td>XOOPS_DB_NAME</td>';493 echo '<td>' . XOOPS_DB_NAME . '</td>';494 echo '<td>' . $xoops_config->xoops_db_name . '</td>';495 echo '</tr>';496 497 echo '<tr>';498 if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)499 echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PREFIX</span></strong></td>';500 else501 echo '<td>XOOPS_DB_PREFIX</td>';502 echo '<td>' . XOOPS_DB_PREFIX . '</td>';503 echo '<td>' . $xoops_config->xoops_db_prefix . '</td>';504 echo '</tr>';505 echo '</tbody>';506 echo '</table>';507 }508 function xpress_config_from_xoops_view($is_report = false)509 {510 global $xoopsUserIsAdmin,$xoopsUser;511 512 $user_groups = $xoopsUser->getGroups();513 $is_admin_group = in_array('1',$user_groups);514 515 require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;516 $xoops_config = new ConfigFromXoops;517 if ($is_report) {518 echo "******** " . _AM_XP2_XOOPS_CONFIG_INFO . "********" . "<br />\n";519 xpress_config_report_view();520 echo "<br />\n";521 } else {522 echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_XOOPS_CONFIG_INFO . "</legend>";523 echo "<div style='padding: 8px;'>";524 if ($xoopsUserIsAdmin && $is_admin_group){525 xpress_config_nomal_view();526 } else {527 xpress_config_report_view();528 }529 echo "</div>";530 echo '</legend>';531 echo "</fieldset><br />";532 }533 }534 321 535 322 function xpress_state($is_report = false) … … 818 605 if (!empty($_POST['submit_report'])) $report = true; else $report = false; 819 606 xpress_sys_info($report); 820 xpress_config_from_xoops_view($report);821 607 xpress_active_plugin_list($report); 822 608 xpress_block_state($report);
Note: See TracChangeset
for help on using the changeset viewer.