Skip to:
Content

bbPress.org

Changeset 3302


Ignore:
Timestamp:
06/05/2011 05:04:17 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Rename "no" template parts to "feedback" and add new "Already Logged In" feedback part.

Add login, register, and lost password shortcodes.

Rename single tag shortcode to prevent conflict with all-tags shortcode.

Location:
branches/plugin
Files:
1 added
11 edited
3 moved

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-shortcodes.php

    r3301 r3302  
    8686
    8787            // All topic tags in a cloud
    88             'bbp-topic-tags' => array( $this, 'display_topic_tags'    ),
     88            'bbp-topic-tags'       => array( $this, 'display_topic_tags'    ),
    8989
    9090            // Topics of tag Tag
    91             'bbp-topic-tag' => array( $this, 'display_topics_of_tag' ),
     91            'bbp-single-topic-tag' => array( $this, 'display_topics_of_tag' ),
    9292
    9393            /** Replies *******************************************************/
    9494
    9595            // Reply form
    96             'bbp-reply-form' => array( $this, 'display_reply_form'    ),
     96            'bbp-reply-form'  => array( $this, 'display_reply_form'   ),
    9797
    9898            /** Views *********************************************************/
    9999
    100100            // Single view
    101             'bbp-single-view' => array( $this, 'display_view'         )
     101            'bbp-single-view' => array( $this, 'display_view'         ),
     102
     103            /** Account *******************************************************/
     104
     105            // Login
     106            'bbp-login'       => array( $this, 'display_login'        ),
     107
     108            // Register
     109            'bbp-register'    => array( $this, 'display_register'     ),
     110
     111            // LOst Password
     112            'bbp-lost-pass'   => array( $this, 'display_lost_pass'    ),
    102113
    103114        ) );
     
    214225        // Load the forums index
    215226        if ( bbp_has_forums() )
    216             bbp_get_template_part( 'bbpress/loop', 'forums' );
     227            bbp_get_template_part( 'bbpress/loop',     'forums'    );
    217228
    218229        // No forums
    219230        else
    220             bbp_get_template_part( 'bbpress/no', 'forums' );
     231            bbp_get_template_part( 'bbpress/feedback', 'no-forums' );
    221232
    222233        // Return contents of output buffer
     
    308319                    // Load the topic index
    309320                    if ( bbp_has_topics( $topics_query ) ) {
    310                         bbp_get_template_part( 'bbpress/pagination', 'topics' );
    311                         bbp_get_template_part( 'bbpress/loop',       'topics' );
    312                         bbp_get_template_part( 'bbpress/pagination', 'topics' );
    313                         bbp_get_template_part( 'bbpress/form',       'topic'  );
     321                        bbp_get_template_part( 'bbpress/pagination', 'topics'    );
     322                        bbp_get_template_part( 'bbpress/loop',       'topics'    );
     323                        bbp_get_template_part( 'bbpress/pagination', 'topics'    );
     324                        bbp_get_template_part( 'bbpress/form',       'topic'     );
    314325
    315326                    // No topics
    316327                    } else {
    317                         bbp_get_template_part( 'bbpress/no',   'topics' );
    318                         bbp_get_template_part( 'bbpress/form', 'topic'  );
     328                        bbp_get_template_part( 'bbpress/feedback',   'no-topics' );
     329                        bbp_get_template_part( 'bbpress/form',       'topic'     );
    319330                    }
    320331                }
     
    322333            // Forum is private and user does not have caps
    323334            } elseif ( bbp_is_forum_private( $forum_id, false ) ) {
    324                 bbp_get_template_part( 'bbpress/no', 'access' );
     335                bbp_get_template_part( 'bbpress/feedback', 'no-access' );
    325336            }
    326337        }
     
    366377        // Load the topic index
    367378        if ( bbp_has_topics( $topics_query ) ) {
    368             bbp_get_template_part( 'bbpress/pagination', 'topics' );
    369             bbp_get_template_part( 'bbpress/loop',       'topics' );
    370             bbp_get_template_part( 'bbpress/pagination', 'topics' );
     379            bbp_get_template_part( 'bbpress/pagination', 'topics'    );
     380            bbp_get_template_part( 'bbpress/loop',       'topics'    );
     381            bbp_get_template_part( 'bbpress/pagination', 'topics'    );
    371382
    372383        // No topics
    373384        } else {
    374             bbp_get_template_part( 'bbpress/no', 'topics' );
     385            bbp_get_template_part( 'bbpress/feedback',   'no-topics' );
    375386        }
    376387
     
    474485            // Forum is private and user does not have caps
    475486            } elseif ( bbp_is_forum_private( $forum_id, false ) ) {
    476                 bbp_get_template_part( 'bbpress/no', 'access' );
     487                bbp_get_template_part( 'bbpress/feedback', 'no-access' );
    477488            }
    478489        }
     
    632643        // No topics
    633644        } else {
    634             bbp_get_template_part( 'bbpress/no', 'topics' );
     645            bbp_get_template_part( 'bbpress/feedback',   'no-topics' );
    635646        }
    636647
     
    687698            // Load the topic index
    688699            if ( bbp_view_query( $view_id ) ) {
    689                 bbp_get_template_part( 'bbpress/pagination', 'topics' );
    690                 bbp_get_template_part( 'bbpress/loop',       'topics' );
    691                 bbp_get_template_part( 'bbpress/pagination', 'topics' );
     700                bbp_get_template_part( 'bbpress/pagination', 'topics'    );
     701                bbp_get_template_part( 'bbpress/loop',       'topics'    );
     702                bbp_get_template_part( 'bbpress/pagination', 'topics'    );
    692703
    693704            // No topics
    694705            } else {
    695                 bbp_get_template_part( 'bbpress/no',   'topics' );
     706                bbp_get_template_part( 'bbpress/feedback',   'no-topics' );
    696707            }
    697708        }
     709
     710        // Return contents of output buffer
     711        return $this->_ob_end();
     712    }
     713
     714    /** Account ***************************************************************/
     715
     716    /**
     717     * Display a login form
     718     *
     719     * @since bbPress (r3302)
     720     *
     721     * @global bbPress $bbp
     722     *
     723     * @return string
     724     */
     725    function display_login() {
     726        global $bbp;
     727
     728        // Unset globals
     729        $this->_unset_globals();
     730
     731        // Start output buffer
     732        $this->_ob_start();
     733
     734        // Output templates
     735        if ( !is_user_logged_in() )
     736            bbp_get_template_part( 'bbpress/form',     'user-login' );
     737        else
     738            bbp_get_template_part( 'bbpress/feedback', 'logged-in'  );
     739
     740        // Return contents of output buffer
     741        return $this->_ob_end();
     742    }
     743
     744    /**
     745     * Display a register form
     746     *
     747     * @since bbPress (r3302)
     748     *
     749     * @global bbPress $bbp
     750     *
     751     * @return string
     752     */
     753    function display_register() {
     754        global $bbp;
     755
     756        // Unset globals
     757        $this->_unset_globals();
     758
     759        // Start output buffer
     760        $this->_ob_start();
     761
     762        // Output templates
     763        if ( !is_user_logged_in() )
     764            bbp_get_template_part( 'bbpress/form',     'user-register' );
     765        else
     766            bbp_get_template_part( 'bbpress/feedback', 'logged-in'     );
     767
     768        // Return contents of output buffer
     769        return $this->_ob_end();
     770    }
     771
     772    /**
     773     * Display a lost password form
     774     *
     775     * @since bbPress (r3302)
     776     *
     777     * @global bbPress $bbp
     778     *
     779     * @return string
     780     */
     781    function display_lost_pass() {
     782        global $bbp;
     783
     784        // Unset globals
     785        $this->_unset_globals();
     786
     787        // Start output buffer
     788        $this->_ob_start();
     789
     790        // Output templates
     791        if ( !is_user_logged_in() )
     792            bbp_get_template_part( 'bbpress/form',     'user-lost-pass' );
     793        else
     794            bbp_get_template_part( 'bbpress/feedback', 'logged-in'      );
     795   
     796        // Return contents of output buffer
     797        return $this->_ob_end();
     798    }
     799
     800    /** Other *****************************************************************/
     801
     802    /**
     803     * Display a breadcrumb
     804     *
     805     * @since bbPress (r3302)
     806     *
     807     * @global bbPress $bbp
     808     *
     809     * @return string
     810     */
     811    function display_breadcrumb() {
     812
     813        // Unset globals
     814        $this->_unset_globals();
     815
     816        // Start output buffer
     817        $this->_ob_start();
     818
     819        // Output breadcrumb
     820        bbp_breadcrumb();
    698821
    699822        // Return contents of output buffer
  • branches/plugin/bbp-themes/bbp-twentyten/archive-forum.php

    r3250 r3302  
    2727                        <?php if ( bbp_has_forums() ) : ?>
    2828
    29                             <?php bbp_get_template_part( 'bbpress/loop', 'forums' ); ?>
     29                            <?php bbp_get_template_part( 'bbpress/loop',     'forums'    ); ?>
    3030
    3131                        <?php else : ?>
    3232
    33                             <?php bbp_get_template_part( 'bbpress/no',   'forums' ); ?>
     33                            <?php bbp_get_template_part( 'bbpress/feedback', 'no-forums' ); ?>
    3434
    3535                        <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/archive-topic.php

    r3250 r3302  
    2727                        <?php if ( bbp_has_topics() ) : ?>
    2828
    29                             <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     29                            <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3030
    31                             <?php bbp_get_template_part( 'bbpress/loop',       'topics' ); ?>
     31                            <?php bbp_get_template_part( 'bbpress/loop',       'topics'    ); ?>
    3232
    33                             <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     33                            <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3434
    3535                        <?php else : ?>
    3636
    37                             <?php bbp_get_template_part( 'bbpress/no', 'topics' ); ?>
     37                            <?php bbp_get_template_part( 'bbpress/feedback',   'no-topics' ); ?>
    3838
    3939                        <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/single-forum.php

    r3241 r3302  
    2828    <?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
    2929
    30         <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     30        <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3131
    32         <?php bbp_get_template_part( 'bbpress/loop',       'topics' ); ?>
     32        <?php bbp_get_template_part( 'bbpress/loop',       'topics'    ); ?>
    3333
    34         <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     34        <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3535
    36         <?php bbp_get_template_part( 'bbpress/form',       'topic'  ); ?>
     36        <?php bbp_get_template_part( 'bbpress/form',       'topic'     ); ?>
    3737
    3838    <?php endif; ?>
     
    4040<?php elseif ( bbp_is_forum_private( bbp_get_forum_id(), false ) ) : ?>
    4141
    42     <?php bbp_get_template_part( 'bbpress/no', 'access'); ?>
     42    <?php bbp_get_template_part( 'bbpress/feedback',       'no-access' ); ?>
    4343
    4444<?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/bbpress/view.php

    r3248 r3302  
    2727                        <?php if ( bbp_view_query() ) : ?>
    2828
    29                             <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     29                            <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3030
    31                             <?php bbp_get_template_part( 'bbpress/loop',       'topics' ); ?>
     31                            <?php bbp_get_template_part( 'bbpress/loop',       'topics'    ); ?>
    3232
    33                             <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     33                            <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3434
    3535                        <?php else : ?>
    3636
    37                             <?php bbp_get_template_part( 'bbpress/no',         'topics' ); ?>
     37                            <?php bbp_get_template_part( 'bbpress/feedback',   'no-topics' ); ?>
    3838
    3939                        <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-front-forums.php

    r3130 r3302  
    2929                            <?php if ( bbp_has_forums() ) : ?>
    3030
    31                                 <?php bbp_get_template_part( 'bbpress/loop', 'forums' ); ?>
     31                                <?php bbp_get_template_part( 'bbpress/loop',     'forums'    ); ?>
    3232
    3333                            <?php else : ?>
    3434
    35                                 <?php bbp_get_template_part( 'bbpress/no',   'forums' ); ?>
     35                                <?php bbp_get_template_part( 'bbpress/feedback', 'no-forums' ); ?>
    3636
    3737                            <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-front-topics.php

    r3241 r3302  
    3131                            <?php if ( bbp_has_topics() ) : ?>
    3232
    33                                 <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     33                                <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3434
    35                                 <?php bbp_get_template_part( 'bbpress/loop',       'topics' ); ?>
     35                                <?php bbp_get_template_part( 'bbpress/loop',       'topics'    ); ?>
    3636
    37                                 <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     37                                <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3838
    3939                            <?php else : ?>
    4040
    41                                 <?php bbp_get_template_part( 'bbpress/no', 'topics' ); ?>
     41                                <?php bbp_get_template_part( 'bbpress/feedback',   'no-topics' ); ?>
    4242
    4343                            <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/page-topics-no-replies.php

    r3241 r3302  
    3131                            <?php if ( bbp_has_topics( array( 'meta_key' => '_bbp_reply_count', 'meta_value' => '1', 'meta_compare' => '<', 'orderby' => 'date', 'show_stickies' => false ) ) ) : ?>
    3232
    33                                 <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     33                                <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3434
    35                                 <?php bbp_get_template_part( 'bbpress/loop',       'topics' ); ?>
     35                                <?php bbp_get_template_part( 'bbpress/loop',       'topics'    ); ?>
    3636
    37                                 <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     37                                <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    3838
    3939                            <?php else : ?>
    4040
    41                                 <?php bbp_get_template_part( 'bbpress/no',         'topics' ); ?>
     41                                <?php bbp_get_template_part( 'bbpress/feedback',   'no-topics' ); ?>
    4242
    4343                            <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/single-forum.php

    r3241 r3302  
    4343                                    <?php if ( !bbp_is_forum_category() && bbp_has_topics() ) : ?>
    4444
    45                                         <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     45                                        <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    4646
    47                                         <?php bbp_get_template_part( 'bbpress/loop',       'topics' ); ?>
     47                                        <?php bbp_get_template_part( 'bbpress/loop',       'topics'    ); ?>
    4848
    49                                         <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
     49                                        <?php bbp_get_template_part( 'bbpress/pagination', 'topics'    ); ?>
    5050
    51                                         <?php bbp_get_template_part( 'bbpress/form',       'topic'  ); ?>
     51                                        <?php bbp_get_template_part( 'bbpress/form',       'topic'     ); ?>
    5252
    5353                                    <?php elseif( !bbp_is_forum_category() ) : ?>
    5454
    55                                         <?php bbp_get_template_part( 'bbpress/no',         'topics' ); ?>
     55                                        <?php bbp_get_template_part( 'bbpress/feedback',   'no-topics' ); ?>
    5656
    57                                         <?php bbp_get_template_part( 'bbpress/form',       'topic'  ); ?>
     57                                        <?php bbp_get_template_part( 'bbpress/form',       'topic'     ); ?>
    5858
    5959                                    <?php endif; ?>
     
    6666                    <?php else : // Forum exists, user no access ?>
    6767
    68                         <?php bbp_get_template_part( 'bbpress/no', 'access' ); ?>
     68                        <?php bbp_get_template_part( 'bbpress/feedback', 'no-access' ); ?>
    6969
    7070                    <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/single-topic.php

    r3241 r3302  
    6262                <?php elseif ( bbp_is_forum_private( bbp_get_topic_forum_id(), false ) ) : ?>
    6363
    64                     <?php bbp_get_template_part( 'bbpress/no', 'access' ); ?>
     64                    <?php bbp_get_template_part( 'bbpress/feedback', 'no-access' ); ?>
    6565
    6666                <?php endif; ?>
  • branches/plugin/bbp-themes/bbp-twentyten/taxonomy-topic-tag.php

    r3241 r3302  
    4040                        <?php else : ?>
    4141
    42                             <?php bbp_get_template_part( 'bbpress/no', 'topics' ); ?>
     42                            <?php bbp_get_template_part( 'bbpress/feedback',   'no-topics' ); ?>
    4343
    4444                        <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.