Skip to:
Content

BuddyPress.org

Ticket #3774: child-theme-support-2.patch

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

Child theme support, theme outside theme dir support

  • bpt-admin.php

     
    7373 * Output the BPT admin page
    7474 */
    7575function bp_tpack_theme_menu() {
    76         $theme_dir = WP_CONTENT_DIR . '/themes/' . get_option('stylesheet') . '/';
    77 
    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('bp-tpack', array('activity', 'blogs', 'forums', 'groups', 'members', 'registration') ) ) ) {
    8583                $step = 1;
    8684
    8785                if ( !empty( $_GET['move'] ) ) {
     
    145143
    146144                                        <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>
    147145
    148                                         <p><code><?php echo $theme_dir ?></code></p>
     146                                        <p><code><?php echo get_stylesheet_directory() . '/' ?></code></p>
    149147
    150148                                        <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>
    151149
     
    194192
    195193                        <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>
    196194
    197                         <p><code><?php echo $theme_dir ?></code></p>
     195                        <p><code><?php echo get_stylesheet_directory() . '/' ?></code></p>
    198196
    199197                        <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>
    200198
     
    205203
    206204                                <ol>
    207205                                        <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' ) ?>
     206                                                <?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' ) ?>
    209207
    210208                        <?php else : ?>
    211209                                <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>
     
    329327 * @uses bp_tpack_recurse_copy()
    330328 */
    331329function bp_tpack_move_templates() {
    332         $destination_dir = WP_CONTENT_DIR . '/themes/' . get_option('stylesheet') . '/';
     330        $destination_dir = get_stylesheet_directory() . '/';
    333331        $source_dir = BP_PLUGIN_DIR . '/bp-themes/bp-default/';
    334332
    335333        $dirs = array( 'activity', 'blogs', 'forums', 'groups', 'members', 'registration' );