Skip to:
Content

bbPress.org

Changeset 3130


Ignore:
Timestamp:
05/10/2011 04:31:29 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Add forum root to breadcrumb if root slug is equal to the path of an existing page. Update field CSS styling to play more nicely with theme compatibility. Replace breadcrumb titles with breadcrumb template part.

Location:
branches/plugin
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-general-template.php

    r3118 r3130  
    10861086 *
    10871087 * @param string $sep Separator. Defaults to '←'
     1088 * @param bool $current_page Include the current item
     1089 * @param bool $root Include the root page if one exists
    10881090 * @uses bbp_get_breadcrumb() To get the breadcrumb
    10891091 */
     
    10981100 *
    10991101 * @param string $sep Separator. Defaults to '←'
     1102 * @param bool $current_page Include the current item
     1103 * @param bool $root Include the root page if one exists
    11001104 * @uses bbp_get_breadcrumb() To get the breadcrumb
    11011105 */
    1102 function bbp_breadcrumb( $sep = ' › ', $current_page = true ) {
    1103     echo bbp_get_breadcrumb( $sep );
     1106function bbp_breadcrumb( $sep = ' › ', $current_page = true, $root = true ) {
     1107    echo bbp_get_breadcrumb( $sep, $current_page, $root );
    11041108}
    11051109    /**
     
    11091113     *
    11101114     * @param string $sep Separator. Defaults to '←'
     1115     * @param bool $current_page Include the current item
     1116     * @param bool $root Include the root page if one exists
     1117     *
    11111118     * @uses get_post() To get the post
    11121119     * @uses bbp_get_forum_permalink() To get the forum link
     
    11241131     * @return string Breadcrumbs
    11251132     */
    1126     function bbp_get_breadcrumb( $sep = ' › ', $current_page = true ) {
     1133    function bbp_get_breadcrumb( $sep = ' › ', $current_page = true, $root = true ) {
    11271134        global $post, $bbp;
    11281135
     
    11321139
    11331140        // Get post ancestors
    1134         $ancestors   = array_reverse( get_post_ancestors( $post->ID ) );
     1141        $ancestors = array_reverse( get_post_ancestors( $post->ID ) );
     1142
     1143        // Do we want to include the forum root?
     1144        if ( !empty( $root ) && ( get_option( '_bbp_include_root' ) ) && ( $root_slug = get_option( '_bbp_root_slug' ) ) ) {
     1145
     1146            // Page exists at the root slug location, so add it to the breadcrumb
     1147            if ( $page = get_page_by_path( $root_slug ) ) {
     1148                $breadcrumbs[] = '<a href="' . trailingslashit( home_url( $root_slug ) ) . '">' . get_the_title( $page->ID ) . '</a>';
     1149            }
     1150        }
    11351151
    11361152        // Loop through parents
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/action-edit.php

    r3101 r3130  
    1818
    1919                    <div id="bbp-edit-page" class="bbp-edit-page">
    20                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     20                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2121                        <div class="entry-content">
     22
     23                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2224
    2325                            <?php if ( bbp_is_reply_edit() ) : ?>
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/action-split-merge.php

    r3032 r3130  
    2020
    2121                    <div id="bbp-edit-page" class="bbp-edit-page">
    22                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     22                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2323                        <div class="entry-content">
     24
     25                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2426
    2527                            <?php if ( bbp_is_topic_merge() ) : ?>
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/form-user-edit.php

    r3106 r3130  
    168168    <fieldset class="submit">
    169169        <legend><?php _e( 'Save Changes', 'bbpress' ); ?></legend>
    170         <div class="alignright">
     170        <div>
    171171
    172172            <?php bbp_edit_user_form_fields(); ?>
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/form-user-register.php

    r2970 r3130  
    1212    <form method="post" action="<?php bbp_wp_login_action( array( 'context' => 'login_post' ) ); ?>" class="bbp-login-form">
    1313        <fieldset>
    14             <legend><?php _e( 'Register', 'bbpress' ); ?></legend>
     14            <legend><?php _e( 'Create an Account', 'bbpress' ); ?></legend>
     15
     16            <div class="bbp-template-notice">
     17                <p><?php _e( 'Your username must be unique, and cannot be changed later.', 'bbpress' ) ?></p>
     18                <p><?php _e( 'We use your email address to email you a secure password and verify your account.', 'bbpress' ) ?></p>
     19
     20            </div>
    1521
    1622            <div class="bbp-username">
     
    2632            <?php do_action( 'register_form' ); ?>
    2733
    28             <p id="reg_passmail"><?php _e( 'A password will be e-mailed to you.', 'bbpress' ) ?></p>
    29 
    3034            <div class="bbp-submit-wrapper">
    3135
  • branches/plugin/bbp-themes/bbp-twentyten/css/bbpress.css

    r3123 r3130  
    286286/* =Forms
    287287-------------------------------------------------------------- */
    288 
     288body.page fieldset {
     289    clear: left;
     290}
     291
     292#bbp-login fieldset,
     293#bbp-register fieldset,
     294#bbp-lost-pass fieldset,
    289295body.single-forum fieldset,
    290296body.single-topic fieldset {
     
    293299}
    294300
     301#bbp-login fieldset legend,
     302#bbp-register fieldset legend,
     303#bbp-lost-pass fieldset legend,
    295304body.single-forum fieldset legend,
    296 body.single-topic fieldset legend{
     305body.single-topic fieldset legend {
    297306    padding: 5px;
    298307}
    299308
     309#bbp-login fieldset label,
     310#bbp-register fieldset label,
     311#bbp-lost-pass fieldset label,
     312body.single-forum fieldset label,
     313body.single-topic fieldset label {
     314    width: 200px;
     315    display: inline-block;
     316}
     317
     318#bbp-login fieldset p,
     319#bbp-register fieldset p,
     320#bbp-lost-pass fieldset p,
    300321body.single-forum fieldset p,
    301322body.single-topic fieldset input {
     
    317338}
    318339
     340body.page .bbp-reply-form code,
     341body.page .bbp-topic-form code,
    319342body.single-topic .bbp-reply-form code,
    320343body.single-forum .bbp-topic-form code {
     
    353376-------------------------------------------------------------- */
    354377
    355 div.bbp-edit-user fieldset {
     378#your-profile fieldset {
    356379    margin-top: 20px;
    357380    padding: 20px 20px 0 20px;
    358381}
    359     div.bbp-edit-user fieldset div {
     382    #your-profile fieldset div {
    360383        margin-bottom: 20px;
    361384        float: left;
     
    363386        clear: left;
    364387    }
    365     div.bbp-edit-user fieldset textarea {
    366         line-height: 0;
    367     }
    368     div.bbp-edit-user fieldset select {
     388    #your-profile fieldset select {
    369389        margin-bottom: 0;
    370390    }
    371     div.bbp-edit-user fieldset input,
    372     div.bbp-edit-user fieldset textarea {
     391    #your-profile fieldset input,
     392    #your-profile fieldset textarea {
    373393        margin-bottom: 0;
    374394        width: 400px;
     
    380400        padding: 2px;
    381401    }
    382     div.bbp-edit-user fieldset legend {
     402    #your-profile fieldset legend {
    383403        display: none;
    384404    }
    385     div.bbp-edit-user fieldset label {
     405    #your-profile fieldset label {
    386406        float: left;
    387407        width: 150px;
     
    389409        text-align: right;
    390410    }
    391     div.bbp-edit-user fieldset span.description {
     411    #your-profile fieldset span.description {
    392412        margin: 5px 0 0 170px;
    393413        font-size: 12px;
     
    401421    }
    402422
    403     div.bbp-edit-user fieldset fieldset {
     423    #your-profile fieldset fieldset {
    404424        margin: 0;
    405425        width: 260px;
     
    407427        padding: 0;
    408428    }
    409     div.bbp-edit-user fieldset fieldset span.description {
     429    #your-profile fieldset fieldset span.description {
    410430        margin-left: 0;
    411431        margin-bottom: 20px;
     432    }
     433
     434    #your-profile fieldset.submit button {
     435        float: right;
    412436    }
    413437
  • branches/plugin/bbp-themes/bbp-twentyten/page-create-topic.php

    r3032 r3130  
    2020
    2121                    <div id="bbp-new-topic" class="bbp-new-topic">
    22                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     22                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2323                        <div class="entry-content">
    2424
    2525                            <?php the_content(); ?>
     26
     27                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2628
    2729                            <?php bbp_get_template_part( 'bbpress/form', 'topic' ); ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-forum-statistics.php

    r3032 r3130  
    2424
    2525                    <div id="bbp-statistics" class="bbp-statistics">
    26                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     26                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2727                        <div class="entry-content">
    2828
  • branches/plugin/bbp-themes/bbp-twentyten/page-front-forums.php

    r3115 r3130  
    2020
    2121                    <div id="forum-front" class="bbp-forum-front">
    22                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     22                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2323                        <div class="entry-content">
    2424
  • branches/plugin/bbp-themes/bbp-twentyten/page-front-topics.php

    r3115 r3130  
    2020
    2121                    <div id="topics-front" class="bbp-topics-front">
    22                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     22                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2323                        <div class="entry-content">
    2424
    2525                            <?php the_content(); ?>
     26
     27                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2628
    2729                            <?php do_action( 'bbp_template_before_topics_index' ); ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-topic-tags.php

    r3031 r3130  
    2020
    2121                    <div id="bbp-topic-tags" class="bbp-topic-tags">
    22                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     22                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2323                        <div class="entry-content">
    2424
    2525                            <?php get_the_content() ? the_content() : _e( '<p>This is a collection of tags that are currently popular on our forums.</p>', 'bbpress' ); ?>
     26
     27                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2628
    2729                            <div id="bbp-topic-hot-tags">
  • branches/plugin/bbp-themes/bbp-twentyten/page-topics-no-replies.php

    r3032 r3130  
    2020
    2121                    <div id="topics-front" class="bbp-topics-front">
    22                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     22                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2323                        <div class="entry-content">
    2424
    2525                            <?php the_content(); ?>
     26
     27                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2628
    2729                            <?php bbp_set_query_name( 'bbp_no_replies' ); ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-user-login.php

    r3032 r3130  
    2222
    2323                    <div id="bbp-login" class="bbp-login">
    24                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     24                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2525                        <div class="entry-content">
    2626
    2727                            <?php the_content(); ?>
     28
     29                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2830
    2931                            <?php bbp_get_template_part( 'bbpress/form', 'user-login' ); ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-user-lost-pass.php

    r3032 r3130  
    2222
    2323                    <div id="bbp-lost-pass" class="bbp-lost-pass">
    24                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     24                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2525                        <div class="entry-content">
    2626
    2727                            <?php the_content(); ?>
     28
     29                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2830
    2931                            <?php bbp_get_template_part( 'bbpress/form', 'user-lost-pass' ); ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-user-register.php

    r3032 r3130  
    2222
    2323                    <div id="bbp-register" class="bbp-register">
    24                         <h1 class="entry-title"><?php bbp_title_breadcrumb(); ?></h1>
     24                        <h1 class="entry-title"><?php the_title(); ?></h1>
    2525                        <div class="entry-content">
    2626
    2727                            <?php the_content(); ?>
     28
     29                            <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    2830
    2931                            <?php bbp_get_template_part( 'bbpress/form', 'user-register' ); ?>
  • branches/plugin/bbp-themes/bbp-twentyten/single-forum.php

    r3109 r3130  
    2525                            <div class="entry-content">
    2626
    27                                 <?php if ( bbp_get_forum_parent() ) bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    28 
    29                                 <?php the_content(); ?>
     27                                <?php bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); ?>
    3028
    3129                                <?php bbp_single_forum_description(); ?>
Note: See TracChangeset for help on using the changeset viewer.