Changeset 6447
- Timestamp:
- 06/01/2017 05:49:34 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/settings.php
r6443 r6447 1435 1435 function bbp_converter_setting_callback_platform() { 1436 1436 1437 $platform_options = '';1438 $curdir = opendir( bbpress()->admin->admin_dir . 'converters/' );1439 1440 1437 // Bail if no directory was found (how did this happen?) 1438 $curdir = opendir( bbpress()->admin->admin_dir . 'converters/' ); 1441 1439 if ( empty( $curdir ) ) { 1442 1440 return; 1443 1441 } 1444 1442 1443 // Default values 1444 $platform_options = ''; 1445 $files = array(); 1446 1445 1447 // Loop through files in the converters folder and assemble some options 1446 1448 while ( $file = readdir( $curdir ) ) { 1447 1449 if ( ( stristr( $file, '.php' ) ) && ( stristr( $file, 'index' ) === false ) ) { 1448 $file = preg_replace( '/.php/', '', $file ); 1449 $platform_options .= '<option value="' . esc_attr( $file ) . '">' . esc_html( $file ) . '</option>'; 1450 1451 // Get the file name, without the extension 1452 $name = preg_replace( '/.php/', '', $file ); 1453 1454 // Skip the 'Example' converter is this list 1455 if ( 'Example' !== $name ) { 1456 $files[] = $name; 1457 } 1450 1458 } 1451 1459 } 1452 1460 1453 closedir( $curdir ); ?> 1461 // Close the directory 1462 closedir( $curdir ); 1463 1464 // Resort files alphabetically 1465 ksort( $files ); 1466 1467 // Put options together 1468 foreach ( $files as $file ) { 1469 $platform_options .= '<option value="' . esc_attr( $file ) . '">' . esc_html( $file ) . '</option>'; 1470 } ?> 1454 1471 1455 1472 <select name="_bbp_converter_platform" id="_bbp_converter_platform" /><?php echo $platform_options ?></select> … … 1467 1484 ?> 1468 1485 1469 <input name="_bbp_converter_db_server" id="_bbp_converter_db_server" type="text" value="<?php bbp_form_option( '_bbp_converter_db_server', 'localhost' ); ?>" class="medium-text" />1470 <label for="_bbp_converter_db_server"><?php esc_html_e( ' IP or hostname', 'bbpress' ); ?></label>1486 <input name="_bbp_converter_db_server" id="_bbp_converter_db_server" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_server', 'localhost' ); ?>" class="medium-text" /> 1487 <label for="_bbp_converter_db_server"><?php esc_html_e( 'Use default "localhost" if on the same server, otherwise IP or hostname', 'bbpress' ); ?></label> 1471 1488 1472 1489 <?php … … 1481 1498 ?> 1482 1499 1483 <input name="_bbp_converter_db_port" id="_bbp_converter_db_port" type="text" value="<?php bbp_form_option( '_bbp_converter_db_port', '3306' ); ?>" class="small-text" />1484 <label for="_bbp_converter_db_port"><?php esc_html_e( 'Use default 3306if unsure', 'bbpress' ); ?></label>1500 <input name="_bbp_converter_db_port" id="_bbp_converter_db_port" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_port', '3306' ); ?>" class="small-text" /> 1501 <label for="_bbp_converter_db_port"><?php esc_html_e( 'Use default "3306" if unsure', 'bbpress' ); ?></label> 1485 1502 1486 1503 <?php … … 1495 1512 ?> 1496 1513 1497 <input name="_bbp_converter_db_user" id="_bbp_converter_db_user" type="text" value="<?php bbp_form_option( '_bbp_converter_db_user' ); ?>" class="medium-text" />1498 <label for="_bbp_converter_db_user"><?php esc_html_e( 'User for your database connection', 'bbpress' ); ?></label>1514 <input name="_bbp_converter_db_user" id="_bbp_converter_db_user" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_user' ); ?>" class="medium-text" /> 1515 <label for="_bbp_converter_db_user"><?php esc_html_e( 'User to acces the database', 'bbpress' ); ?></label> 1499 1516 1500 1517 <?php … … 1509 1526 ?> 1510 1527 1511 <input name="_bbp_converter_db_pass" id="_bbp_converter_db_pass" type="password" value="<?php bbp_form_option( '_bbp_converter_db_pass' ); ?>" class="medium-text" autocomplete="off" />1512 <label for="_bbp_converter_db_pass"><?php esc_html_e( 'Password to access the database', 'bbpress' ); ?></label>1528 <input name="_bbp_converter_db_pass" id="_bbp_converter_db_pass" type="password" class="code" value="<?php bbp_form_option( '_bbp_converter_db_pass' ); ?>" class="medium-text" autocomplete="off" /> 1529 <label for="_bbp_converter_db_pass"><?php esc_html_e( 'Password of the above database user', 'bbpress' ); ?></label> 1513 1530 1514 1531 <?php … … 1523 1540 ?> 1524 1541 1525 <input name="_bbp_converter_db_name" id="_bbp_converter_db_name" type="text" value="<?php bbp_form_option( '_bbp_converter_db_name' ); ?>" class="medium-text" />1542 <input name="_bbp_converter_db_name" id="_bbp_converter_db_name" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_name' ); ?>" class="medium-text" /> 1526 1543 <label for="_bbp_converter_db_name"><?php esc_html_e( 'Name of the database with your old forum data', 'bbpress' ); ?></label> 1527 1544 … … 1550 1567 ?> 1551 1568 1552 <input name="_bbp_converter_db_prefix" id="_bbp_converter_db_prefix" type="text" value="<?php bbp_form_option( '_bbp_converter_db_prefix' ); ?>" class="medium-text" />1569 <input name="_bbp_converter_db_prefix" id="_bbp_converter_db_prefix" type="text" class="code" value="<?php bbp_form_option( '_bbp_converter_db_prefix' ); ?>" class="medium-text" /> 1553 1570 <label for="_bbp_converter_db_prefix"><?php esc_html_e( '(If converting from BuddyPress Forums, use "wp_bb_" or your custom prefix)', 'bbpress' ); ?></label> 1554 1571 … … 1564 1581 ?> 1565 1582 1566 <input name="_bbp_converter_rows" id="_bbp_converter_rows" type=" text" value="<?php bbp_form_option( '_bbp_converter_rows', '100' ); ?>" class="small-text" />1583 <input name="_bbp_converter_rows" id="_bbp_converter_rows" type="number" min="1" max="5000" value="<?php bbp_form_option( '_bbp_converter_rows', '100' ); ?>" class="small-text" /> 1567 1584 <label for="_bbp_converter_rows"><?php esc_html_e( 'rows to process at a time', 'bbpress' ); ?></label> 1568 1585 <p class="description"><?php esc_html_e( 'Keep this low if you experience out-of-memory issues.', 'bbpress' ); ?></p> … … 1579 1596 ?> 1580 1597 1581 <input name="_bbp_converter_delay_time" id="_bbp_converter_delay_time" type=" text" value="<?php bbp_form_option( '_bbp_converter_delay_time', '1' ); ?>" class="small-text" />1598 <input name="_bbp_converter_delay_time" id="_bbp_converter_delay_time" type="number" min="1" max="3600" value="<?php bbp_form_option( '_bbp_converter_delay_time', '1' ); ?>" class="small-text" /> 1582 1599 <label for="_bbp_converter_delay_time"><?php esc_html_e( 'second(s) delay between each group of rows', 'bbpress' ); ?></label> 1583 1600 <p class="description"><?php esc_html_e( 'Keep this high to prevent too-many-connection issues.', 'bbpress' ); ?></p>
Note: See TracChangeset
for help on using the changeset viewer.