--- fb_connect.module +++ fb_connect.module @@ -28,16 +28,26 @@ * simple file. */ function fb_connect_receiver() { - $output = ' + global $facebook_config; + + $src_suffix = $facebook_config['debug'] + ? '.debug' + : '' ; + + $src = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') + ? "https://ssl.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver$src_suffix.js" + : "http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver$src_suffix.js" ; + + $output = <<
- + -'; +HTML; print $output; die(); // prevent Drupal from writing anything else. } @@ -287,6 +297,13 @@ return; global $base_path; + global $facebook_config; + + $fb_feature_suffix = $facebook_config['debug'] ? '.debug' : '' ; + $fb_feature_src = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') + ? "https://ssl.connect.facebook.com/js/api_lib/v0.4/FeatureLoader$fb_feature_suffix.js.php" + : "http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader$fb_feature_suffix.js.php" ; + $feature_data = fb_connect_require_feature(); $option_data = fb_connect_init_option(); @@ -304,7 +321,7 @@ $options = str_replace('}"', '', $options); // drupal_add_js cannot add external javascript, so we use hook_footer instead. - $output = ''; + $output = ''; $output .= "\n"; $feature_list = '["' . implode('","', $features) . '"]'; // Put together the URL for the receiver. The prefix must be identical to the apps connect URL.