function fb_canvas_iframe_excursion in Drupal for Facebook 6.2
This is intended to help sites which have some FBML and some iframe pages. Makes the current FBML canvas page an iframe. And attempts to preserve session while visiting multiple iframe pages.
Set $conf['fb_session_cookieless_iframe'] = TRUE for best results (but perhaps less session security).
File
- ./
fb_canvas.module, line 503 - This module provides support for Canvas page applications. Use Drupal to power traditional Facebook Apps.
Code
function fb_canvas_iframe_excursion() {
if (fb_canvas_is_fbml()) {
$query = $_GET;
unset($query['q']);
$path = $_GET['q'];
//$query['XDEBUG_SESSION_START']=1;
if (function_exists('fb_settings')) {
fb_settings(FB_SETTINGS_CB, $GLOBALS['_fb_app']->label);
fb_settings(FB_SETTINGS_CB_SESSION, fb_settings(FB_SETTINGS_SESSION_KEY));
}
// Make the FBML page a canvas page.
print '<fb:iframe resizable=true name=resizeme frameborder=0 scrolling="auto" src="' . url($path, array(
'absolute' => TRUE,
'query' => $query,
)) . '"></fb:iframe>';
unset($_SESSION['fb_canvas_fb_sig']);
unset($_SESSION['fb_canvas_fb_params']);
exit;
}
else {
if (fb_canvas_is_iframe()) {
// Add to session paramaters that iframes will need.
if (!isset($_SESSION['fb_canvas_fb_sig'])) {
$_SESSION['fb_canvas_fb_params'] = $GLOBALS['_fb']
->get_valid_fb_params($_REQUEST);
$_SESSION['fb_canvas_fb_sig'] = $_REQUEST['fb_sig'];
}
if (module_exists('fb_connect')) {
// Resize the iframe.
fb_connect_require_feature('CanvasUtil');
fb_connect_init_js("FB.CanvasClient.startTimerToSizeToContent();");
}
}
}
}