You are here

function fb_views_handler_filter_profile_tab::query in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb_views/fb_views_handler_filter_profile_tab.inc \fb_views_handler_filter_profile_tab::query()
  2. 6.2 fb_views/fb_views_handler_filter_profile_tab.inc \fb_views_handler_filter_profile_tab::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter_boolean_operator::query

File

fb_views/fb_views_handler_filter_profile_tab.inc, line 15
Filter handler for profile tab user.

Class

fb_views_handler_filter_profile_tab
@file Filter handler for profile tab user.

Code

function query() {
  $fb_app = $GLOBALS['_fb_app'];

  // Set on Canvas and Connect pages.
  $profile_fbu = $_REQUEST['fb_sig_profile_id'];

  // Set by facebook.
  if ($fb_app && $profile_fbu) {

    // @TODO - this code untested since the conversion from authmap to fb_user table.  Does it work?
    $uid = fb_user_get_local_user($profile_fbu, $fb_app);
    if ($uid) {
      $this
        ->ensure_my_table();
      $this->query
        ->add_where(0, $this->table_alias . ".fbu=%d", $profile_fbu);
    }
  }
}