Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 17th, 2018 94 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. /** Implements hook_views_query_alter()
  2.  * Filtering heartbeat tabs' contents on User Profile page
  3.  * @param object $view
  4.  * @param views_plugin_query_default $query
  5.  */
  6. function oak_hacks_views_query_alter(&$view, &$query){
  7.     $view_display_name = "{$view->name}.{$view->current_display}";
  8.     switch ($view_display_name){
  9.         # Filter heartbeat activity!
  10.         case 'profile_user_feed.panel_pane_1':
  11.             # QuickTab provides the argument, we filter
  12.             if (!empty($view->args[1])){
  13.                 $query->add_where(1, 'heartbeat_activity.message_id', explode(',', $view->args[1]), 'IN'); # '' or heartbeat template id
  14.                 }
  15.             # Filter-out short messages. They're used in Notifications, that's why we filter them on display
  16.             #$query->add_where(1, 'heartbeat_activity.message_id', array('heartbeat_add_node_review'), 'NOT IN');
  17.             break;
  18.  
  19.         default:
  20.             if (0) # KILLER FEATURE: Hunt-down views
  21.                 dsm(array('view' => $view, 'query' => $query), "$view_display_name ({$view->human_name})");
  22.         }
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top