Facebook 설정 · 3 min read · Sep 21, 2025

블로그를 위한 Facebook RSS 피드 리더 애플리케이션 설정 방법 - 페이지 7

9 초대 페이지 만들기

이 장에서는 우리 앱의 사용자들이 한 번에 최대 10명의 친구를 초대하여 앱을 설치하도록 하는 초대 기능을 만들 것입니다. 절차는 여기에서 설명되어 있습니다: http://wiki.developers.facebook.com/index.php/Invite_Page, 하지만 우리 애플리케이션에 맞게 코드를 조정하겠습니다:

vi /var/www/fb/htf_feed_reader/friendselect.php

| api_client->fql_query($fql); ?>

'; $count = 0; for ($i=0; $i < count($friends); $i++) { // Print out all friends who have not added the application. Check the first 10 friends (checked="checked" until $count reaches 10). $record = $friends[$i]; if ($record['has_added_app'] != 0) continue; if ($count%5 == 0) echo ''; if ($count < 10) { $checked = ' checked="checked"'; $disabled = ''; } else { $checked = ''; $disabled = ' disabled="true"'; } if ($record['pic_small'] == '') $pic_url = 'http://static.ak.facebook.com/pics/t_default.jpg'; else $pic_url = $record['pic_small']; echo ''; echo '

'; echo ' '; echo $record['name']; echo ''; if (($count+1)%5 == 0) echo ''; $count ++; } if ($count%5 != 0) echo ''; echo ''; ?>
|

vi /var/www/fb/htf_feed_reader/invite.php

| require_frame(); $user = $facebook->require_login(); if ($_POST['act'] == 'invite') { // Invite the friends that were selected. $friends = array(); foreach ($_POST as $key => $value) { if (strpos($key,'uid') == 0 && $value == 'on' && count($friends) < 10) { $friends[count($friends)] = substr($key,3,strlen($key)-3); } } $tail = '&next=invite.php?total='.count($friends); $url = $facebook->api_client->notifications_sendRequest($friends, 'HowtoForge RSS Feed Reader', ' wants you to check out this HowtoForge feed about the newest Linux tutorials!', 'http://fb.howtoforge.com/fb/htf_feed_reader/htf_fb_app_logo_75x75.gif', true); $facebook->redirect($url.$tail); exit; } if ($_GET['sent'] == 1) { // Display a message letting the user know invitations have been successfully sent. ?> 초대장이 발송되었습니다 당신은 명의 친구를 HowtoForge RSS Feed Reader에 초대했습니다.

친구를 HowtoForge RSS Feed Reader에 초대하세요!

여기에서 친구를 초대하세요 (하루 최대 10명).

|

이제 index.php를 수정하여 초대 탭을 Facebook 내 애플리케이션 페이지에 포함시켜 invite.php에 링크를 추가해야 합니다:

vi /var/www/fb/htf_feed_reader/index.php

|

'; include('rss.php'); $facebook->api_client->profile_setFBML('', $user); $facebook->api_client->fbml_refreshRefUrl($rss_url); ?> |

을 사용하여 애플리케이션의 캔버스 페이지에 탭을 정의할 수 있습니다. http://apps.facebook.com/htf_feed_reader/invite.php에 링크를 걸고 있지만, invite.php는 http://fb.howtoforge.com/fb/htf_feed_reader/invite.php에 위치해 있습니다. http://apps.facebook.com/htf_feed_reader/invite.php로 이동하면, 내용이 자동으로 http://fb.howtoforge.com/fb/htf_feed_reader/invite.php에서 가져옵니다.

이제 Facebook의 애플리케이션 캔버스 페이지로 이동하세요. 그곳에서 초대 탭을 볼 수 있어야 합니다:

클릭하면 앱을 설치하지 않은 최대 10명의 친구를 선택할 수 있는 페이지가 열립니다. 이후 친구 초대 클릭:

다음 페이지에서는 친구에게 전송될 메시지를 확인할 수 있습니다. 전송 클릭:

문제가 없다면, 선택한 친구에게 애플리케이션 초대장이 발송되었다는 확인 메시지를 볼 수 있습니다:

친구들이 Facebook 계정으로 가면, RSS 리더에 대한 초대장이 대기 중임을 볼 수 있습니다 (오른쪽 상단에 1 howtoforge rss feed 초대장이 표시됨):

링크를 클릭하면 초대장을 볼 수 있습니다. 수락하고 설치하려면, 단순히 Go for it 클릭:

정상적인 Facebook 애플리케이션 설치 페이지로 리디렉션되어 최종적으로 애플리케이션을 설치할 수 있습니다:

Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.