Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/20/2013 07:50:55 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Forum Subscriptions - Allow users to subscribe to new topics in specific forums.

  • Code largely lifted from existing Topics Subscriptions, and is based largely on forum-subscriptions.2.diff from mordauk, with edits for code consistency across bbPress components.
  • Refactor existing ambiguous function names into base functions for both forum and topic subscriptions.
  • Include new functions for getting and outputting subscriptions.
  • Modify user-subscriptions.php to show subscribed forums. This includes a modification to content-single-forum.php to include the "Unsubscribe" link if looking at a user profile page.
  • Modify templates/default/bbpress-functions.php to enqueue new JS file to handle forum subscription ajax.
  • Rename HTML element classes from bbp-topic-action to bbp-row-actions to better accommodate forum subscriptions (and any future actions.)
  • BuddyPress tested, JJJ approved.
  • See #2299. Props mordauk, netweb for the considerable effort.
  • More to do here, largely from forum-subscriptions.3.diff
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/default/bbpress/user-subscriptions.php

    r4733 r5156  
    1717
    1818            <div id="bbp-user-subscriptions" class="bbp-user-subscriptions">
    19                 <h2 class="entry-title"><?php _e( 'Subscribed Forum Topics', 'bbpress' ); ?></h2>
     19                <h2 class="entry-title"><?php _e( 'Subscribed Forums', 'bbpress' ); ?></h2>
    2020                <div class="bbp-user-section">
    2121
    22                     <?php if ( bbp_get_user_subscriptions() ) : ?>
     22                    <?php if ( bbp_get_user_forum_subscriptions() ) : ?>
     23
     24                        <?php bbp_get_template_part( 'loop', 'forums' ); ?>
     25
     26                    <?php else : ?>
     27
     28                        <p><?php bbp_is_user_home() ? _e( 'You are not currently subscribed to any forums.', 'bbpress' ) : _e( 'This user is not currently subscribed to any topics.', 'bbpress' ); ?></p>
     29
     30                    <?php endif; ?>
     31
     32                </div>
     33
     34                <h2 class="entry-title"><?php _e( 'Subscribed Topics', 'bbpress' ); ?></h2>
     35                <div class="bbp-user-section">
     36
     37                    <?php if ( bbp_get_user_topic_subscriptions() ) : ?>
    2338
    2439                        <?php bbp_get_template_part( 'pagination', 'topics' ); ?>
Note: See TracChangeset for help on using the changeset viewer.