You are here

function fbconnect_render_friends_invite_form in Facebook Connect 5

Same name and namespace in other branches
  1. 6 fbconnect.pages.inc \fbconnect_render_friends_invite_form()

Render the facebook friends invite form.

1 string reference to 'fbconnect_render_friends_invite_form'
fbconnect_menu in ./fbconnect.module
Implementation of hook_menu().

File

./fbconnect.module, line 1017
This module allows site visitors to connect and register with facebook account

Code

function fbconnect_render_friends_invite_form() {
  if (!($fbuid = fbconnect_get_fbuid())) {
    drupal_set_message(t('Your Facebook session has expired, try to reconnect'));
    drupal_goto();
  }
  global $base_url;
  $url = check_url($base_url);
  $sitename = check_plain(variable_get('site_name', t('this website')));
  $actiontxt = t('Please select the Facebook friends you want to tell about @sitename.', array(
    '@sitename' => $sitename,
  ));
  $action = check_plain(variable_get('fbconnect_invitef_redirect', $url));
  $type = check_plain(variable_get('fbconnect_invitef_type', $sitename));
  $text = check_plain(variable_get('fbconnect_invitef_content', t('Enjoy the new drupal facebook connect module')));
  $content = $text . '  <fb:req-choice url=\'' . $url . '\' label=\'Become a Member!\' />';
  $output = '<fb:serverfbml style="width: 100%;">
                <script type="text/fbml">
                  <fb:fbml>
                    <fb:request-form
                      action="' . $action . '"
                      method="POST"
                      invite="true"
                      type="' . $type . '"
                      content="' . $content . '">	
                      <fb:multi-friend-selector
                      showborder="false"
                      actiontext="' . $actiontxt . '">
                    </fb:request-form>
                  </fb:fbml>
                </script>
              </fb:serverfbml>';
  return $output;
}