Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Do I need to use the Simple Facebook Connect plugin? or can I just use some facebook api code? Any help appreciated.

The example i'm trying to replicate is the interface at lookbook.nu. Once you login with facebook, there is a nice page to invite your FB friends.

share|improve this question
    
+1 good Question. –  kaiser Feb 15 '12 at 20:21
add comment

1 Answer

up vote 1 down vote accepted

An easy way would be to include the Facebook Javascript code:

 wp_deregister_script('facebook');
    wp_enqueue_script(
        'facebook',
        'https://connect.facebook.net/en_US/all.js'
    );

Then use the default Facebook invite page.

<script>
        function facebookInvite(){
            var request = {
                message: 'my message',
                method: 'apprequests'
            };
            FB.ui(request, function (data) {
                if (data.request_ids.length > 0) {
                    alert("Facebook invite successful.");
                }
            });
        }
    </script>

EDIT: Here are steps you can take to invite your facebook friends to your website.

  1. Create an application for your website in Facebook. http://developers.facebook.com/docs/guides/canvas/ . You will need to read up on forwarding a user to your main website instead of a facebook application page aka canvas page.
  2. While logged in to Facebook ( as the same user that created the Facebook app ) go to your website and hit the "invite facebook link". See http://developers.facebook.com/docs/guides/web/ for details. This will send out the invites. Your friends will see a Facebook notification inviting them to your application. In our case, the application and the website is pretty much the same thing.
  3. When your friend accepts the application an icon will appear in their profile page. When they click that icon it will take them to your website. If you configure your application correctly, it will take them to your website and not the Facebook canvas page.
  4. When they land on your page you need some logic which handles a user coming in from Facebook.

HTH

share|improve this answer
    
Question: How would you then create users that can login to the specific wordpress site? As far as I can say from your code above (never dealt with the FB API), it invites friends to facebook and not the WP site. –  kaiser Feb 15 '12 at 20:21
1  
I would want to invite people to the website, and not the facebook page. I'm assuming I'll need a facebook app just for the website. –  Deryk Wenaus Feb 15 '12 at 20:34
    
@kaiser He would need to register his site as an "application" in facebook. This code will invite people to that application. –  rexposadas Feb 15 '12 at 20:45
    
@DerykWenaus Yes, you'll need a facebook app for the website. –  rexposadas Feb 15 '12 at 21:00
1  
@DerykWenaus I would give Simple Facebook Connect first to see if it fits your needs. I didn't use it because my client at the time needed custom functionality with facebook connect so I had to roll with a wrapper. –  rexposadas Feb 16 '12 at 11:28
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.