× Joomla Facebook Connect support forum

Topic-icon JBCinvite

Active Subscriptions:

None
13 years 3 months ago #6682 by fb_905870441
Replied by fb_905870441 on topic JBCinvite
I tried to get JFBConnect to accept the referrer id, but still does not work.

I changed the file modules/mod_jfbclogin/mod_jfbclogin.php:
[...]
$registerType = $params->get('register_type');
if ($registerType == "jomsocial")
{
       [...]
}
else if ($registerType == "communitybuilder")
{
       //CHANGES BEGIN
        $aup_referrer_id = JRequest::getVar('referrer'); //get referrer_id from url (something like 'AUPRR-4D0794F39B3C3')

        if($aup_referrer_id)
                {
                $registerLink = JRoute::_("index.php?option=com_comprofiler&task=registers&referrer=$aup_referrer_id", false); //create CB registration link that includes the referrer_id
                $forgotLink = JRoute::_("index.php?option=com_comprofiler&task=lostPassword");
                }
        else
                {
                $registerLink = JRoute::_("index.php?option=com_comprofiler&task=registers", false);  //no referrer_id? no problem: use regular registration link.
                $forgotLink = JRoute::_("index.php?option=com_comprofiler&task=lostPassword");
                }
        //CHANGES END
}
else
{
       [...]
}
// common for J! and JomSocial
[...]

I'm still having trouble: JFBConnect does not register the new user. Are the changes correct? Do I need to do something else?

Bernardo.
The topic has been locked.
Active Subscriptions:

None
12 years 11 months ago #9661 by fb_1660790489
Replied by fb_1660790489 on topic JBCinvite
Hi !
The topic has been locked.
Active Subscriptions:

None
12 years 11 months ago #9662 by fb_1660790489
Replied by fb_1660790489 on topic JBCinvite

fb_1660790489 wrote: Hi !
Long Time no see !
I resolve that problem is best to write invite module for him self !
After 12 hours of writhing I build facebook multi friend selctor for him self in aup invitation tmpl .Just put were you want in aup with facebook/php-sdk.

The topic has been locked.
Support Specialist
12 years 11 months ago #9673 by alzander
Replied by alzander on topic JBCinvite
I removed your code above, and copied it below. You shouldn't include your API/Secret keys in code postings, for security sake. Thanks for your input. We're looking into re-doing the entire JFBCInvite module, and this is a great post for ideas of different ways to do it!

Original code from Danijel:
<?php
// Get these from http://developers.facebook.com
$api_key = 'YYYYYYYYY';
$secret  = 'XXXXXXXXXX';

require 'src/facebook.php';

$facebook = new Facebook($api_key, $secret);
?>
<center>
<fb:serverFbml width="680px">
	<script type="text/fbml">
		<fb:fbml>
<fb:request-form method="GET" type="Page" invite="true"
action="http://apps.facebook.com/casinosahre/<?php echo $this->referreid; ?>"
content="Become a fan of Objective-C!<fb:req-choice url='http://apps.facebook.com/casinosahre/<?php echo $this->referreid; ?>' ' label='GO' /> ">
<fb:multi-friend-selector actiontext="Tell your friends about Objective-C" rows="4" cols="3" max="35"/>
</fb:request-form>
</fb:fbml>
    </script>
</fb:serverFbml></center>
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10960 by fb_1660790489
Replied by fb_1660790489 on topic JBCinvite
<?PHP

// Get these from developers.facebook.com
$api_key = 'xxxxxxxxxxxx';
$secret = 'xxxxxxxxxxxxx';

// Names and links
$app_name = "Casino Share";
$app_url = "apps.facebook.com/casinosahre/"; // Assumes application is at apps.facebook.com/app-url/
$invite_href = "apps.facebook.com/casinosahre/referreid; ?>"; // Rename this as needed

require_once 'src/facebook.php';

$fb = new Facebook($api_key, $secret);

if(isset($_POST["ids"])) {
echo "<center>Thank you for inviting ".sizeof($_POST["ids"])." of your friends on <b><a href=\"apps.facebook.com/".$app_url."/\">".$app_name.".

\n";
echo "<h2><a href=\"apps.facebook.com/".$app_url."/\">Click here to return to ".$app_name.".";
} else {

// Retrieve array of friends who've already authorized the app.
$fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.') AND is_app_user = 1';
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
// $_friends = $facebook->api($param);

// Extract the user ID's returned in the FQL request into a new array.
$friends = array();
if (is_array($_friends) && count($_friends)) {
foreach ($_friends as $friend) {
$friends[] = $friend;
}
}

// Convert the array of friends into a comma-delimeted string.
$friends = implode(',', $friends);
?>

<center>

<fb:serverFbml width="680px">
<center><script type="text/fbml">

<fb:fbml>

<fb:share-button class="meta">
<meta name="medium" content="mult"/>
<meta name="title" content="name of fan page"/>
<meta name="description" content="Join to our Share Casino and play games for free and earn credits for paly with your facebook friendship to win nice sweepstakes like rapidsahre ,mp4 players and many more nice sweepstakes to choose in our sahre shop ! "/>
<link rel="image_src" href="url to image location" />
<link rel="target_url" href="apps.facebook.com/casinosahre/referreid; ?>"/>
</fb:share-button>

<fb:name uid="$user" firstnameonly="true" shownetwork="false"/>
<fb:request-form
action="<? echo $invite_href; ?>"
method="post"
type="<? echo $app_name; ?>"
content="Join to our Share Casino and play games for free and earn credits for paly with your facebook friendship to win nice sweepstakes like rapidsahre ,mp4 players and many more nice sweepstakes to choose in our sahre shop ! ">

<fb:multi-friend-selector
exclude_ids="<?php echo $friends;?>"
showborder="false"
rows="3"
cols="4"
actiontext="Here are your friends who don't have <? echo $app_name; ?> yet. Invite whoever you want -it's free!" />

</fb:request-form>


</fb:fbml>
</script></center>
<?php } ?>
</fb:serverFbml>

</center>
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10961 by fb_1660790489
Replied by fb_1660790489 on topic JBCinvite
One error to resolve and invite works perfect.
Is problem in user id $user to user of apps do not get invitation second time.
I s to error and i ca n resolve that .
$facebook = new Facebook($api_key, $secret);
This two bucks get error
1.$facebook->require_frame();
2.$user = $facebook->require_login();
And in
// Retrieve array of friends who've already authorized the app.
$fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.') AND is_app_user = 1';
This line get error
-> $_friends = $facebook->api_client->fql_query($fql);
Can any body tell me what do i do to get this 3 line to get work ?



Thx Danijel
The topic has been locked.