diff --git bp-notifications/bp-notifications-classes.php bp-notifications/bp-notifications-classes.php
index 5be2531..6cb4af0 100644
|
|
|
class BP_Notifications_Notification { |
| 321 | 321 | $where_conditions['is_new'] = "is_new = 0"; |
| 322 | 322 | } |
| 323 | 323 | |
| | 324 | // active |
| | 325 | if ( ! empty( $args['active'] ) ) { |
| | 326 | $active_components = array_keys( buddypress()->active_components ); |
| | 327 | |
| | 328 | $ac_clean = array(); |
| | 329 | foreach ( $active_components as $ac ) { |
| | 330 | $ac_clean[] = $wpdb->prepare( '%s', $ac ); |
| | 331 | } |
| | 332 | |
| | 333 | $ac_in = implode( ',', $ac_clean ); |
| | 334 | $where_conditions['active'] = "component_name IN ({$ac_in})"; |
| | 335 | } |
| | 336 | |
| 324 | 337 | // search_terms |
| 325 | 338 | if ( ! empty( $args['search_terms'] ) ) { |
| 326 | 339 | $search_terms = like_escape( esc_sql( $args['search_terms'] ) ); |
| … |
… |
class BP_Notifications_Notification { |
| 556 | 569 | 'component_name' => false, |
| 557 | 570 | 'component_action' => false, |
| 558 | 571 | 'is_new' => true, |
| | 572 | 'active' => true, |
| 559 | 573 | 'search_terms' => '', |
| 560 | 574 | 'order_by' => false, |
| 561 | 575 | 'sort_order' => false, |
| … |
… |
class BP_Notifications_Notification { |
| 578 | 592 | 'component_name' => $r['component_name'], |
| 579 | 593 | 'component_action' => $r['component_action'], |
| 580 | 594 | 'is_new' => $r['is_new'], |
| | 595 | 'active' => $r['active'], |
| 581 | 596 | 'search_terms' => $r['search_terms'], |
| 582 | 597 | ) ); |
| 583 | 598 | |
| … |
… |
class BP_Notifications_Notification { |
| 759 | 774 | $r = wp_parse_args( $args, array( |
| 760 | 775 | 'user_id' => bp_loggedin_user_id(), |
| 761 | 776 | 'is_new' => true, |
| | 777 | 'active' => true, |
| 762 | 778 | 'page' => 1, |
| 763 | 779 | 'per_page' => 25, |
| 764 | 780 | 'search_terms' => '', |
diff --git bp-notifications/bp-notifications-template.php bp-notifications/bp-notifications-template.php
index 2ca2610..22dbe38 100644
|
|
|
class BP_Notifications_Template { |
| 244 | 244 | $r = wp_parse_args( $args, array( |
| 245 | 245 | 'user_id' => 0, |
| 246 | 246 | 'is_new' => true, |
| | 247 | 'active' => true, |
| 247 | 248 | 'page' => 1, |
| 248 | 249 | 'per_page' => 25, |
| 249 | 250 | 'order_by' => 'date_notified', |
| … |
… |
class BP_Notifications_Template { |
| 282 | 283 | $this->pag_num = $pag_num; |
| 283 | 284 | $this->user_id = $r['user_id']; |
| 284 | 285 | $this->is_new = $r['is_new']; |
| | 286 | $this->active = $r['active']; |
| 285 | 287 | $this->search_terms = $r['search_terms']; |
| 286 | 288 | $this->page_arg = $r['page_arg']; |
| 287 | 289 | $this->order_by = $r['order_by']; |
| … |
… |
class BP_Notifications_Template { |
| 291 | 293 | $notifications = BP_Notifications_Notification::get_current_notifications_for_user( array( |
| 292 | 294 | 'user_id' => $this->user_id, |
| 293 | 295 | 'is_new' => $this->is_new, |
| | 296 | 'active' => $this->active, |
| 294 | 297 | 'page' => $this->pag_page, |
| 295 | 298 | 'per_page' => $this->pag_num, |
| 296 | 299 | 'search_terms' => $this->search_terms, |
| … |
… |
function bp_has_notifications( $args = '' ) { |
| 481 | 484 | $r = wp_parse_args( $args, array( |
| 482 | 485 | 'user_id' => $user_id, |
| 483 | 486 | 'is_new' => $is_new, |
| | 487 | 'active' => true, |
| 484 | 488 | 'page' => 1, |
| 485 | 489 | 'per_page' => 25, |
| 486 | 490 | 'max' => false, |