canvas; } $patterns = array(); $replacements = array(); $base_path = base_path(); if ($_fb) { if (function_exists('fb_url_outbound_alter')) { $base_before_rewrite = ''; $rewrite_options = array(FB_SETTINGS_CB_SESSION => FALSE, FB_SETTINGS_CB_TYPE => FALSE); $base = $base_path . fb_url_outbound_alter($base_before_rewrite, $rewrite_options, ''); // short URL with rewrite applied. } else { // If no url_alter, use normal base_path. $base = $base_path; } if (isset($options['to_canvas']) && ($canvas = $options['to_canvas'])) { // Make relative links point to canvas pages. $patterns[] = "|]*)href=\"{$base}|"; $replacements[] = "', array( 'absolute' => TRUE, 'fb_url_alter' => FALSE, )); $patterns[] = "|]*)href=\"{$base}|"; $replacements[] = "', array('absolute' => TRUE)); $patterns[] = "|]*)href=\"{$absolute_base}|"; $replacements[] = "canvas}/"; } } if (count($patterns)) { $count = 0; $return = preg_replace($patterns, $replacements, $output, -1, $count); //print ("fb_process replaced $count.\n\n"); // debug return $return; } else return $output; }