Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/18/2011 12:53:31 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Code normalization and whitespace clean-up. Introduce bp-core-deprecated.php. Introduce root_slug globals into components with directories, to help with WP page slugs. Fixes #2600. Optimus Props boonebgorges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-templatetags.php

    r3685 r3728  
    176176
    177177    // The default scope should recognize custom slugs
    178     if ( array_key_exists( $bp->current_action, (array)$bp->active_components ) ) {
     178    if ( array_key_exists( $bp->current_action, (array)$bp->active_components ) )
    179179        $scope = $bp->active_components[$bp->current_action];
    180     } else {
     180    else
    181181        $scope = $bp->current_action;
    182     }
    183 
    184     /* Support for permalinks on single item pages: /groups/my-group/activity/124/ */
     182
     183    // Support for permalinks on single item pages: /groups/my-group/activity/124/
    185184    if ( $bp->current_action == $bp->activity->slug )
    186185        $include = $bp->action_variables[0];
    187186
    188     /* Note: any params used for filtering can be a single value, or multiple values comma separated. */
     187    // Note: any params used for filtering can be a single value, or multiple values comma separated.
    189188    $defaults = array(
    190         'display_comments' => 'threaded', // false for none, stream/threaded - show comments in the stream or threaded under items
    191         'include' => $include, // pass an activity_id or string of IDs comma-separated
    192         'exclude' => $exclude, // pass an activity_id or string of IDs comma-separated
    193         'in' => $in, // comma-separated list or array of activity IDs among which to search
    194         'sort' => 'DESC', // sort DESC or ASC
    195         'page' => 1, // which page to load
    196         'per_page' => 20, // number of items per page
    197         'max' => false, // max number to return
    198         'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide?
    199 
    200         /* Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) */
    201         'scope' => $bp->current_action,
    202 
    203         /* Filtering */
    204         'user_id' => $user_id, // user_id to filter on
    205         'object' => $object, // object to filter on e.g. groups, profile, status, friends
    206         'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated
    207         'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
    208         'secondary_id' => false, // secondary object ID to filter on e.g. a post_id
    209 
    210         /* Searching */
    211         'search_terms' => false // specify terms to search on
     189        'display_comments' => 'threaded',   // false for none, stream/threaded - show comments in the stream or threaded under items
     190        'include'          => $include,    // pass an activity_id or string of IDs comma-separated
     191        'exclude'          => $exclude,    // pass an activity_id or string of IDs comma-separated
     192        'in'               => $in,          // comma-separated list or array of activity IDs among which to search
     193        'sort'             => 'DESC',      // sort DESC or ASC
     194        'page'             => 1,            // which page to load
     195        'per_page'         => 20,          // number of items per page
     196        'max'              => false,        // max number to return
     197        'show_hidden'      => $show_hidden, // Show activity items that are hidden site-wide?
     198
     199        // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
     200        'scope'            => $scope,
     201
     202        // Filtering
     203        'user_id'          => $user_id,    // user_id to filter on
     204        'object'           => $object,      // object to filter on e.g. groups, profile, status, friends
     205        'action'           => false,        // action to filter on e.g. activity_update, new_forum_post, profile_updated
     206        'primary_id'       => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
     207        'secondary_id'     => false,        // secondary object ID to filter on e.g. a post_id
     208
     209        // Searching
     210        'search_terms'     => false        // specify terms to search on
    212211    );
    213212
     
    215214    extract( $r );
    216215
    217     /* If you have passed a "scope" then this will override any filters you have passed. */
     216    // If you have passed a "scope" then this will override any filters you have passed.
    218217    if ( 'just-me' == $scope || 'friends' == $scope || 'groups' == $scope || 'favorites' == $scope || 'mentions' == $scope ) {
    219218        if ( 'just-me' == $scope )
     
    272271    }
    273272
    274     /* Support for basic filters in earlier BP versions. */
    275     $filter = false;
     273    // Support for basic filters in earlier BP versions.
    276274    if ( isset( $_GET['afilter'] ) )
    277275        $filter = array( 'object' => $_GET['afilter'] );
    278276    else if ( !empty( $user_id ) || !empty( $object ) || !empty( $action ) || !empty( $primary_id ) || !empty( $secondary_id ) )
    279277        $filter = array( 'user_id' => $user_id, 'object' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $secondary_id );
     278    else
     279        $filter = false;
    280280
    281281    $activities_template = new BP_Activity_Template( $page, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden, $exclude, $in );
Note: See TracChangeset for help on using the changeset viewer.