function fb_canvas_process_fbml in Drupal for Facebook 5
Same name and namespace in other branches
- 5.2 fb_canvas.module \fb_canvas_process_fbml()
 
Similar to fb_canvas_process, this also uses regular expressions to alter link destinations. Use this function when producing FBML for a profile box or news feed, and the pages need to link to canvas pages rather than the default URL.
3 calls to fb_canvas_process_fbml()
3 string references to 'fb_canvas_process_fbml'
File
- ./
fb_canvas.module, line 448  - This module provides some app-specific navigation to facebook apps. This is fairly experimental material. May change a lot in near future.
 
Code
function fb_canvas_process_fbml($output, $fb_app) {
  $patterns = array();
  $replacements = array();
  $base = url();
  // short URL with rewrite applied.
  if ($fb_app->canvas) {
    // Change links to use canvas on Facebook
    $patterns[] = "|href=\"{$base}|";
    $replacements[] = "href=\"http://apps.facebook.com/{$fb_app->canvas}/";
  }
  if (count($patterns)) {
    $return = preg_replace($patterns, $replacements, $output);
    return $return;
  }
  else {
    return $output;
  }
}