Changeset 10183 for trunk/src/bp-forums/deprecated/1.7.php
- Timestamp:
- 10/04/2015 07:29:24 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-forums/deprecated/1.7.php
r9819 r10183 1 1 <?php 2 3 2 /** 4 * BuddyPress Forums Deprecated Functions 3 * BuddyPress Forums Deprecated Functions. 5 4 * 6 5 * This file contains all the deprecated functions for BuddyPress forums since … … 12 11 */ 13 12 14 // Exit if accessed directly 13 // Exit if accessed directly. 15 14 defined( 'ABSPATH' ) || exit; 16 15 … … 22 21 $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; 23 22 24 // Add the administration tab under the "Site Admin" tab for site administrators 23 // Add the administration tab under the "Site Admin" tab for site administrators. 25 24 $hook = add_submenu_page( $page, __( 'Forums', 'buddypress' ), __( 'Forums', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" ); 26 25 27 // Fudge the highlighted subnav item when on the BuddyPress Forums admin page 26 // Fudge the highlighted subnav item when on the BuddyPress Forums admin page. 28 27 add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); 29 28 } … … 35 34 check_admin_referer( 'bp_forums_existing_install_init' ); 36 35 37 // Sanitize $_REQUEST['bbconfigloc'] 36 // Sanitize $_REQUEST['bbconfigloc']. 38 37 $_REQUEST['bbconfigloc'] = apply_filters( 'bp_forums_bbconfig_location', $_REQUEST['bbconfigloc'] ); 39 38 … … 65 64 $bp = buddypress(); 66 65 67 // Create the bb-config.php file 66 // Create the bb-config.php file. 68 67 $initial_write = bp_forums_bbpress_write( 69 68 $bp->plugin_dir . '/bp-forums/bbpress/bb-config-sample.php', … … 85 84 ); 86 85 87 // Add the custom user and usermeta entries to the config file 86 // Add the custom user and usermeta entries to the config file. 88 87 if ( $initial_write == 1 ) { 89 88 $file = file_get_contents( $location ); … … 147 146 } 148 147 149 // Get the existing lines in the file 148 // Get the existing lines in the file. 150 149 $lines = file( $file_source ); 151 150 152 // Initialise an array to store the modified lines 151 // Initialise an array to store the modified lines. 153 152 $modified_lines = array(); 154 153 155 // Loop through the lines and modify them 154 // Loop through the lines and modify them. 156 155 foreach ( (array) $lines as $line ) { 157 156 if ( isset( $alterations[substr( $line, 0, 20 )] ) ) { … … 184 183 } 185 184 186 // Open the file for writing - rewrites the whole file 185 // Open the file for writing - rewrites the whole file. 187 186 $file_handle = fopen( $file_target, 'w' ); 188 187 189 // Write lines one by one to avoid OS specific newline hassles 188 // Write lines one by one to avoid OS specific newline hassles. 190 189 foreach ( (array) $modified_lines as $modified_line ) { 191 190 if ( strlen( $modified_line ) - 2 === strrpos( $modified_line, '?>' ) ) { … … 199 198 } 200 199 201 // Close the config file 200 // Close the config file. 202 201 fclose( $file_handle ); 203 202
Note: See TracChangeset
for help on using the changeset viewer.