Skip to:
Content

BuddyPress.org

Ticket #3774: child-theme-support.patch

File child-theme-support.patch, 3.3 KB (added by lancehudson, 13 years ago)

adds child theme support

  • bpt-admin.php

     
    7272/**
    7373 * Output the BPT admin page
    7474 */
    75 function bp_tpack_theme_menu() {
    76         $theme_dir = WP_CONTENT_DIR . '/themes/' . get_option('stylesheet') . '/';
    77 
     75function bp_tpack_theme_menu() {       
    7876        if ( !empty( $_GET['finish'] ) )
    7977                update_option( 'bp_tpack_configured', 1 );
    8078
    8179        if ( !empty( $_GET['reset'] ) )
    8280                delete_option( 'bp_tpack_configured' );
    8381
    84         if ( !file_exists( $theme_dir . 'activity' ) && !file_exists( $theme_dir . 'blogs' ) && !file_exists( $theme_dir . 'forums' ) && !file_exists( $theme_dir . 'groups' ) && !file_exists( $theme_dir . 'members' ) && !file_exists( $theme_dir . 'registration' ) ) {
     82        if (   !file_exists( get_query_template('activity', array('activity/index.php') ) )
     83                && !file_exists( get_query_template('blogs', array('blogs/index.php') ) )
     84                && !file_exists( get_query_template('forums', array('forums/index.php') ) )
     85                && !file_exists( get_query_template('groups', array('groups/index.php') ) )
     86                && !file_exists( get_query_template('members', array('members/index.php') ) )
     87                && !file_exists( get_query_template('registration', array('registration/register.php') ) ) ) {
    8588                $step = 1;
    8689
    8790                if ( !empty( $_GET['move'] ) ) {
     
    145148
    146149                                        <p><?php _e( 'In this directory you will find six folders (/activity/, /blogs/, /forums/, /groups/, /members/, /registration/). If you want to use all of the features of BuddyPress then you must move these six directories to the following folder:', 'bp-tpack' ); ?></p>
    147150
    148                                         <p><code><?php echo $theme_dir ?></code></p>
     151                                        <p><code><?php echo get_stylesheet_directory() . '/' ?></code></p>
    149152
    150153                                        <p><?php _e( "If you decide that you don't want to use a feature of BuddyPress, then you can actually ignore the template folders for these features. For example, if you don't want to use the groups and forums features, you can simply avoid copying the /groups/ and /forums/ template folders to your active theme. (If you're not sure what to do, just copy all six folders over to your theme directory.)", 'bp-tpack' ); ?></p>
    151154
     
    194197
    195198                        <p><?php _e( "If BuddyPress pages are not aligned correctly, then you may need to modify some of the templates to match your theme's HTML structure. The best way to do this is to access your theme's files, via FTP, at:", 'bp-tpack' ); ?></p>
    196199
    197                         <p><code><?php echo $theme_dir ?></code></p>
     200                        <p><code><?php echo get_stylesheet_directory() . '/' ?></code></p>
    198201
    199202                        <p><?php _e( 'Open up the <code>page.php</code> file (if this does not exist, use <code>index.php</code>). Make note of the HTML template structure of the file, specifically the <code>&lt;div&gt;</code> tags that surround the content and sidebar.', 'bp-tpack' ); ?></p>
    200203
     
    205208
    206209                                <ol>
    207210                                        <li>
    208                                                 <?php _e( "The first method is to locate tho following templates (leave out any folders that you didn't copy over in Step Two):", 'bp-tpack' ) ?>
     211                                                <?php _e( "The first method is to locate the following templates (leave out any folders that you didn't copy over in Step Two):", 'bp-tpack' ) ?>
    209212
    210213                        <?php else : ?>
    211214                                <p><?php _e( 'The files that you need to edit are as follows (leave out any folders you have not copied over in step two):', 'bp-tpack' ); ?></p>