Skip to:
Content

BuddyPress.org

Changeset 2168 for trunk/bp-messages.php


Ignore:
Timestamp:
12/14/2009 03:24:05 PM (16 years ago)
Author:
apeatling
Message:

Committing core code support for new default theme.

Removed all deprecated code since it will be released as a separate plugin for backwards compatibility if people need it.

Removed the wire and status updates components since there is no support in the theme for these. If people still want this functionality then I'm sure there is someone in the community that could spend a bit of time and release them as plugins. I'm happy to guide.

Removed a lot of template loop duplication. There are no longer site loops and user loops (e.g. bp_has_site_groups() / bp_has_groups() ). There are now bp_has_members(), bp_has_groups(), bp_has_blogs() and you can pass a "user_id" parameter into these loops to limit results to only that user or users.

Merged activity stream functions. There are no longer functions for bp_activity_get_sitewide() / bp_activity_get_for_user() / bp_activity_get_friends_activity() instead there is simply one function: bp_activity_get() and you can pass in parameters to filter on just friends, for a single user, or anything your heart desires. Actually, filtering is extremely fine grained, so I encourage devs to check out the filter functions.

Lots of other code cleanup.

The new default theme will be committed straight after this. The original default folder will be renamed to bp-classic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages.php

    r2114 r2168  
    1111require ( BP_PLUGIN_DIR . '/bp-messages/bp-messages-templatetags.php' );
    1212require ( BP_PLUGIN_DIR . '/bp-messages/bp-messages-filters.php' );
    13 
    14 /* Include deprecated functions if settings allow */
    15 if ( !defined( 'BP_IGNORE_DEPRECATED' ) )
    16     require ( BP_PLUGIN_DIR . '/bp-messages/deprecated/bp-messages-deprecated.php' );
    1713
    1814function messages_install() {
     
    153149function messages_screen_inbox() {
    154150    do_action( 'messages_screen_inbox' );
    155     bp_core_load_template( apply_filters( 'messages_template_inbox', 'messages/index' ) );
     151    bp_core_load_template( apply_filters( 'messages_template_inbox', 'members/single/messages' ) );
    156152}
    157153
    158154function messages_screen_sentbox() {
    159155    do_action( 'messages_screen_sentbox' );
    160     bp_core_load_template( apply_filters( 'messages_template_sentbox', 'messages/sentbox' ) );
     156    bp_core_load_template( apply_filters( 'messages_template_sentbox', 'members/single/messages' ) );
    161157}
    162158
     
    200196    do_action( 'messages_screen_compose' );
    201197
    202     bp_core_load_template( apply_filters( 'messages_template_compose', 'messages/compose' ) );
     198    bp_core_load_template( apply_filters( 'messages_template_compose', 'members/single/messages' ) );
    203199}
    204200
     
    238234    do_action( 'messages_screen_notices' );
    239235
    240     bp_core_load_template( apply_filters( 'messages_template_notices', 'messages/notices' ) );
     236    bp_core_load_template( apply_filters( 'messages_template_notices', 'members/single/messages' ) );
    241237}
    242238
     
    310306
    311307    bp_core_new_subnav_item( array( 'name' => sprintf( __( 'From: %s', 'buddypress'), BP_Messages_Thread::get_last_sender($thread_id) ), 'slug' => 'view', 'parent_url' => $bp->loggedin_user->domain . $bp->messages->slug . '/', 'parent_slug' => $bp->messages->slug, 'screen_function' => true, 'position' => 40, 'user_has_access' => bp_is_home() ) );
    312     bp_core_load_template( apply_filters( 'messages_template_view_message', 'messages/view' ) );
     308    bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/messages' ) );
    313309}
    314310add_action( 'wp', 'messages_action_view_message', 3 );
     
    564560}
    565561
     562/**
     563 * messages_filter_template_paths()
     564 *
     565 * Add fallback for the bp-sn-parent theme template locations used in BuddyPress versions
     566 * older than 1.2.
     567 *
     568 * @package BuddyPress Core
     569 */
     570function messages_filter_template_paths() {
     571    if ( 'bp-sn-parent' != basename( TEMPLATEPATH ) && !defined( 'BP_CLASSIC_TEMPLATE_STRUCTURE' ) )
     572        return false;
     573
     574    add_filter( 'messages_template_compose', create_function( '', 'return "messages/compose";' ) );
     575    add_filter( 'messages_template_sentbox', create_function( '', 'return "messages/sentbox";' ) );
     576    add_filter( 'messages_template_inbox', create_function( '', 'return "messages/index";' ) );
     577    add_filter( 'messages_template_notices', create_function( '', 'return "messages/notices";' ) );
     578    add_filter( 'messages_template_view_message', create_function( '', 'return "messages/view";' ) );
     579}
     580add_action( 'init', 'messages_filter_template_paths' );
     581
     582
    566583// List actions to clear super cached pages on, if super cache is installed
    567584add_action( 'messages_delete_thread', 'bp_core_clear_cache' );
Note: See TracChangeset for help on using the changeset viewer.