Skip to:
Content

BuddyPress.org

Changeset 7906


Ignore:
Timestamp:
02/17/2014 01:07:32 AM (11 years ago)
Author:
boonebgorges
Message:

Whitespace and codestyling in bp-activity

Location:
trunk/bp-activity
Files:
3 edited

Legend:

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

    r7905 r7906  
    282282
    283283        $defaults = array(
    284             'page'             => 1,          // The current page
    285             'per_page'         => 25,         // Activity items per page
    286             'max'              => false,      // Max number of items to return
    287             'sort'             => 'DESC',     // ASC or DESC
    288             'exclude'          => false,      // Array of ids to exclude
    289             'in'               => false,      // Array of ids to limit query by (IN)
    290             'meta_query'       => false,      // Filter by activitymeta
    291             'filter'           => false,      // See self::get_filter_sql()
    292             'search_terms'     => false,      // Terms to search by
    293             'display_comments' => false,      // Whether to include activity comments
    294             'show_hidden'      => false,      // Show items marked hide_sitewide
    295             'spam'             => 'ham_only', // Spam status
     284            'page'              => 1,          // The current page
     285            'per_page'          => 25,         // Activity items per page
     286            'max'               => false,      // Max number of items to return
     287            'sort'              => 'DESC',     // ASC or DESC
     288            'exclude'           => false,      // Array of ids to exclude
     289            'in'                => false,      // Array of ids to limit query by (IN)
     290            'meta_query'        => false,      // Filter by activitymeta
     291            'filter'            => false,      // See self::get_filter_sql()
     292            'search_terms'      => false,      // Terms to search by
     293            'display_comments'  => false,      // Whether to include activity comments
     294            'show_hidden'       => false,      // Show items marked hide_sitewide
     295            'spam'              => 'ham_only', // Spam status
     296            'update_meta_cache' => true,
    296297        );
    297298        $r = wp_parse_args( $args, $defaults );
  • trunk/bp-activity/bp-activity-functions.php

    r7905 r7906  
    899899function bp_activity_get( $args = '' ) {
    900900    $defaults = array(
    901         'max'              => false,        // Maximum number of results to return
    902         'page'             => 1,            // page 1 without a per_page will result in no pagination.
    903         'per_page'         => false,        // results per page
    904         'sort'             => 'DESC',       // sort ASC or DESC
    905         'display_comments' => false,        // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
    906 
    907         'search_terms'     => false,        // Pass search terms as a string
    908         'meta_query'       => false,        // Filter by activity meta. See WP_Meta_Query for format
    909         'show_hidden'      => false,        // Show activity items that are hidden site-wide?
    910         'exclude'          => false,        // Comma-separated list of activity IDs to exclude
    911         'in'               => false,        // Comma-separated list or array of activity IDs to which you want to limit the query
    912         'spam'             => 'ham_only',   // 'ham_only' (default), 'spam_only' or 'all'.
     901        'max'               => false,        // Maximum number of results to return
     902        'page'              => 1,            // page 1 without a per_page will result in no pagination.
     903        'per_page'          => false,        // results per page
     904        'sort'              => 'DESC',       // sort ASC or DESC
     905        'display_comments'  => false,        // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
     906
     907        'search_terms'      => false,        // Pass search terms as a string
     908        'meta_query'        => false,        // Filter by activity meta. See WP_Meta_Query for format
     909        'show_hidden'       => false,        // Show activity items that are hidden site-wide?
     910        'exclude'           => false,        // Comma-separated list of activity IDs to exclude
     911        'in'                => false,        // Comma-separated list or array of activity IDs to which you want to limit the query
     912        'spam'              => 'ham_only',   // 'ham_only' (default), 'spam_only' or 'all'.
    913913        'update_meta_cache' => true,
    914914
     
    932932        if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
    933933            $args = array(
    934                 'page'             => $page,
    935                 'per_page'         => $per_page,
    936                 'max'              => $max,
    937                 'sort'             => $sort,
    938                 'search_terms'     => $search_terms,
    939                 'meta_query'       => $meta_query,
    940                 'filter'           => $filter,
    941                 'display_comments' => $display_comments,
    942                 'show_hidden'      => $show_hidden,
    943                 'spam'             => $spam,
     934                'page'              => $page,
     935                'per_page'          => $per_page,
     936                'max'               => $max,
     937                'sort'              => $sort,
     938                'search_terms'      => $search_terms,
     939                'meta_query'        => $meta_query,
     940                'filter'            => $filter,
     941                'display_comments'  => $display_comments,
     942                'show_hidden'       => $show_hidden,
     943                'spam'              => $spam,
    944944                'update_meta_cache' => $update_meta_cache,
    945945            );
     
    989989function bp_activity_get_specific( $args = '' ) {
    990990    $defaults = array(
    991         'activity_ids'     => false,       // A single activity_id or array of IDs.
    992         'display_comments' => false,       // true or false to display threaded comments for these specific activity items
    993         'max'              => false,       // Maximum number of results to return
    994         'page'             => 1,           // page 1 without a per_page will result in no pagination.
    995         'per_page'         => false,       // results per page
    996         'show_hidden'      => true,        // When fetching specific items, show all
    997         'sort'             => 'DESC',      // sort ASC or DESC
    998         'spam'             => 'ham_only',  // Retrieve items marked as spam
     991        'activity_ids'      => false,       // A single activity_id or array of IDs.
     992        'display_comments'  => false,       // true or false to display threaded comments for these specific activity items
     993        'max'               => false,       // Maximum number of results to return
     994        'page'              => 1,           // page 1 without a per_page will result in no pagination.
     995        'per_page'          => false,       // results per page
     996        'show_hidden'       => true,        // When fetching specific items, show all
     997        'sort'              => 'DESC',      // sort ASC or DESC
     998        'spam'              => 'ham_only',  // Retrieve items marked as spam
    999999        'update_meta_cache' => true,
    10001000    );
     
    10031003
    10041004    $get_args = array(
    1005         'page'             => $page,
    1006         'per_page'         => $per_page,
    1007         'max'              => $max,
    1008         'sort'             => $sort,
    1009         'display_comments' => $display_comments,
    1010         'show_hidden'      => $show_hidden,
    1011         'in'               => $activity_ids,
    1012         'spam'             => $spam,
     1005        'page'              => $page,
     1006        'per_page'          => $per_page,
     1007        'max'               => $max,
     1008        'sort'              => $sort,
     1009        'display_comments'  => $display_comments,
     1010        'show_hidden'       => $show_hidden,
     1011        'in'                => $activity_ids,
     1012        'spam'              => $spam,
    10131013        'update_meta_cache' => $update_meta_cache,
    10141014    );
  • trunk/bp-activity/bp-activity-template.php

    r7905 r7906  
    160160
    161161        $defaults = array(
    162             'page'             => 1,
    163             'per_page'         => 20,
    164             'page_arg'         => 'acpage',
    165             'max'              => false,
    166             'sort'             => false,
    167             'include'          => false,
    168             'exclude'          => false,
    169             'in'               => false,
    170             'filter'           => false,
    171             'search_terms'     => false,
    172             'meta_query'       => false,
    173             'display_comments' => 'threaded',
    174             'show_hidden'      => false,
    175             'spam'             => 'ham_only',
     162            'page'              => 1,
     163            'per_page'          => 20,
     164            'page_arg'          => 'acpage',
     165            'max'               => false,
     166            'sort'              => false,
     167            'include'           => false,
     168            'exclude'           => false,
     169            'in'                => false,
     170            'filter'            => false,
     171            'search_terms'      => false,
     172            'meta_query'        => false,
     173            'display_comments'  => 'threaded',
     174            'show_hidden'       => false,
     175            'spam'              => 'ham_only',
    176176            'update_meta_cache' => true,
    177177        );
     
    189189
    190190        // Fetch specific activity items based on ID's
    191         if ( !empty( $include ) )
    192             $this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $this->pag_page, 'per_page' => $this->pag_num, 'sort' => $sort, 'display_comments' => $display_comments, 'show_hidden' => $show_hidden, 'spam' => $spam, 'update_meta_cache' => $update_meta_cache, ) );
     191        if ( !empty( $include ) ) {
     192            $this->activities = bp_activity_get_specific( array(
     193                'activity_ids'      => explode( ',', $include ),
     194                'max'               => $max,
     195                'page'              => $this->pag_page,
     196                'per_page'          => $this->pag_num,
     197                'sort'              => $sort,
     198                'display_comments'  => $display_comments,
     199                'show_hidden'       => $show_hidden,
     200                'spam'              => $spam,
     201                'update_meta_cache' => $update_meta_cache,
     202            ) );
    193203
    194204        // Fetch all activity items
    195         else
    196             $this->activities = bp_activity_get( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'meta_query' => $meta_query, 'filter' => $filter, 'show_hidden' => $show_hidden, 'exclude' => $exclude, 'in' => $in, 'spam' => $spam, 'update_meta_cache' => $update_meta_cache, ) );
     205        } else {
     206            $this->activities = bp_activity_get( array(
     207                'display_comments'  => $display_comments,
     208                'max'               => $max,
     209                'per_page'          => $this->pag_num,
     210                'page'              => $this->pag_page,
     211                'sort'              => $sort,
     212                'search_terms'      => $search_terms,
     213                'meta_query'        => $meta_query,
     214                'filter'            => $filter,
     215                'show_hidden'       => $show_hidden,
     216                'exclude'           => $exclude,
     217                'in'                => $in,
     218                'spam'              => $spam,
     219                'update_meta_cache' => $update_meta_cache,
     220            ) );
     221        }
    197222
    198223        if ( !$max || $max >= (int) $this->activities['total'] )
     
    497522    // Note: any params used for filtering can be a single value, or multiple values comma separated.
    498523    $defaults = array(
    499         'display_comments' => 'threaded',   // false for none, stream/threaded - show comments in the stream or threaded under items
    500         'include'          => $include,     // pass an activity_id or string of IDs comma-separated
    501         'exclude'          => $exclude,     // pass an activity_id or string of IDs comma-separated
    502         'in'               => $in,          // comma-separated list or array of activity IDs among which to search
    503         'sort'             => 'DESC',       // sort DESC or ASC
    504         'page'             => 1,            // which page to load
    505         'per_page'         => 20,           // number of items per page
    506         'max'              => false,        // max number to return
    507         'show_hidden'      => $show_hidden, // Show activity items that are hidden site-wide?
    508         'spam'             => 'ham_only',   // Hide spammed items
    509 
    510         'page_arg'         => 'acpage',     // See https://buddypress.trac.wordpress.org/ticket/3679
     524        'display_comments'  => 'threaded',   // false for none, stream/threaded - show comments in the stream or threaded under items
     525        'include'           => $include,     // pass an activity_id or string of IDs comma-separated
     526        'exclude'           => $exclude,     // pass an activity_id or string of IDs comma-separated
     527        'in'                => $in,          // comma-separated list or array of activity IDs among which to search
     528        'sort'              => 'DESC',       // sort DESC or ASC
     529        'page'              => 1,            // which page to load
     530        'per_page'          => 20,           // number of items per page
     531        'max'               => false,        // max number to return
     532        'show_hidden'       => $show_hidden, // Show activity items that are hidden site-wide?
     533        'spam'              => 'ham_only',   // Hide spammed items
     534
     535        'page_arg'          => 'acpage',     // See https://buddypress.trac.wordpress.org/ticket/3679
    511536
    512537        // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
    513         'scope'            => $scope,
     538        'scope'             => $scope,
    514539
    515540        // Filtering
    516         'user_id'          => $user_id,     // user_id to filter on
    517         'object'           => $object,      // object to filter on e.g. groups, profile, status, friends
    518         'action'           => false,        // action to filter on e.g. activity_update, new_forum_post, profile_updated
    519         'primary_id'       => $primary_id,  // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
    520         'secondary_id'     => false,        // secondary object ID to filter on e.g. a post_id
    521 
    522         'meta_query'       => false,        // filter on activity meta. See WP_Meta_Query for format
     541        'user_id'           => $user_id,     // user_id to filter on
     542        'object'            => $object,      // object to filter on e.g. groups, profile, status, friends
     543        'action'            => false,        // action to filter on e.g. activity_update, new_forum_post, profile_updated
     544        'primary_id'        => $primary_id,  // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
     545        'secondary_id'      => false,        // secondary object ID to filter on e.g. a post_id
     546
     547        'meta_query'        => false,        // filter on activity meta. See WP_Meta_Query for format
    523548
    524549        // Searching
    525         'search_terms'     => false,        // specify terms to search on
     550        'search_terms'      => false,        // specify terms to search on
    526551        'update_meta_cache' => true,
    527552    );
     
    618643
    619644    $template_args = array(
    620         'page'             => $page,
    621         'per_page'         => $per_page,
    622         'page_arg'         => $page_arg,
    623         'max'              => $max,
    624         'sort'             => $sort,
    625         'include'          => $include,
    626         'exclude'          => $exclude,
    627         'in'               => $in,
    628         'filter'           => $filter,
    629         'search_terms'     => $search_terms,
    630         'meta_query'       => $meta_query,
    631         'display_comments' => $display_comments,
    632         'show_hidden'      => $show_hidden,
    633         'spam'             => $spam,
     645        'page'              => $page,
     646        'per_page'          => $per_page,
     647        'page_arg'          => $page_arg,
     648        'max'               => $max,
     649        'sort'              => $sort,
     650        'include'           => $include,
     651        'exclude'           => $exclude,
     652        'in'                => $in,
     653        'filter'            => $filter,
     654        'search_terms'      => $search_terms,
     655        'meta_query'        => $meta_query,
     656        'display_comments'  => $display_comments,
     657        'show_hidden'       => $show_hidden,
     658        'spam'              => $spam,
    634659        'update_meta_cache' => $update_meta_cache,
    635660    );
Note: See TracChangeset for help on using the changeset viewer.