Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/21/2016 07:44:45 AM (9 years ago)
Author:
imath
Message:

Introduce screen notifications for activity comments and activity comment replies

Users will be notified about comments made on their activities and about replies made on their activity comments.

If there is only one notification of the above types, the WP Admin Bar bubble will link to the single activity. Clicking on this link will mark the notification as read.
If there are more than one, we use the notifications screen and an extra parameter to filter the notifications according to the type so that only these notifications are displayed. Clicking on the listed links will mark the notification as read.

Props dcavins, boonebgorges, DJPaul

Fixes #6057

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-notifications/bp-notifications-template.php

    r10652 r10715  
    168168    } else {
    169169        $user_id = bp_loggedin_user_id();
     170    }
     171
     172    // Set the component action (by default false to get all actions)
     173    $component_action = false;
     174
     175    if ( isset( $_REQUEST['type'] ) ) {
     176        $component_action = sanitize_key( $_REQUEST['type'] );
     177    }
     178
     179    // Set the search terms (by default an empty string to get all notifications)
     180    $search_terms = '';
     181
     182    if ( isset( $_REQUEST['s'] ) ) {
     183        $search_terms = stripslashes( $_REQUEST['s'] );
    170184    }
    171185
     
    176190        'secondary_item_id' => false,
    177191        'component_name'    => bp_notifications_get_registered_components(),
    178         'component_action'  => false,
     192        'component_action'  => $component_action,
    179193        'is_new'            => $is_new,
    180         'search_terms'      => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '',
     194        'search_terms'      => $search_terms,
    181195        'order_by'          => 'date_notified',
    182196        'sort_order'        => 'DESC',
Note: See TracChangeset for help on using the changeset viewer.