× Joomla Facebook Connect support forum

Topic-icon Reward to the invitor of Facebook Requests

Active Subscriptions:

None
12 years 2 months ago #18750 by codeify
Sounds awesome!

Maybe do the invite as the possibility to have like a ladder:
1. You get a small amount of point for every invite
2. More points for invites that leads to new users/costumers
3. Even more points if new users/costumers leads to an order thru VM (Virtuemart)

Just an opionion =)

Please contact me if you would like an example testers!

Cheers!
The topic has been locked.
Support Specialist
12 years 2 months ago #18847 by alzander
Howdy everyone. Got a quick update and some code to test! We got AUP installed and played around with a bit. Pretty slick extension overall, I must say. Originally, we were thinking we had to create the XML rule files to distribute. After installing AUP though, we realized we could simply create the Rules through the admin area. For now, that's what we're going to recommend during this testing stage.

So.. on with it. To reward an inviter for sending a Request, do the following:
Create a new Rule in AUP
* Go to the AUP admin area, click Rules, click "New"
* Select the Category - Recommend / Invite sounds best, but is your choice.
* Rule Name - "Facebook Request" - again, whatever you want
* Plugin Type - JFBConnect
* Unique function name - plgjfbconnect_request_sent (exactly)
* Points - Amount of points to award per user invited. (If a user opens up the dialog and invites 50 people, they will get this point value 50 times)
* Fixed Points - Yes
* Method - Whenever

Update JFBConnect to Award Points
Then, open the /components/com_jfbconnect/controllers/request.php file. Around line 38, you'll see:
$data['created'] = JFactory::getDate()->toMySQL();
        $data['modified'] = null;
After that, add:
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
        if ( file_exists($api_AUP))
        {
            require_once ($api_AUP);
            $aupInstalled = true;
        }
        else
            $aupInstalled = false;
Then, further down (around line 54, after the code above is added), you'll see:
$row->save($data);
Add the following after that:
if ($aupInstalled)
                AlphaUserPointsHelper::newpoints( 'plgjfbconnect_request_sent', '', $fbTo);
When done, the user should get the points specified from the rule whenever they invite a friend. They will only be awarded the points for each unique friend they invite. Inviting the same friend repeatedly should not award points.

Again, this is new to us, but we've been pleasantly surprised with how easy it was to implement. We'll be looking for feedback or improvements for flexibility to suite different usage cases. If there are other areas you'd like to award points now, let us know. It should be pretty easy to add points all over the place from here on out :D

Thanks for your patience, and good luck!
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #18855 by codeify
Hi Alzander,

Sounds good!

First bug:
In AUP 1.5.13 - Joomla 1.5.23 you cant create a rule thru rule / new,
you have to upload an xml file =(

Cheers!
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #18856 by codeify
Hi again Alzander!
*I forced the JFBConnect rule thru the database admin.

Works like a charm!
Give points thru Request - Confirmed
Not give point if already invited user - Confirmed

Next up....
Points for JFBC Like
Requests that leads to new user
Requests that leads to virtuemart order... =)

Please PM me how i can donate to you!
Keep it up!

Cheers!
The topic has been locked.
Support Specialist
12 years 2 months ago #18916 by alzander
Codeify/All,
Thanks for the verification that it works. We'll have to work on the XML files for the points so you don't have to create them manually if you're in Joomla 1.5. The system for Joomla 2.5 is pretty slick, actually, but understand not being ready to upgrade yet :)

The points for Like'ing should be pretty simple.. we'll try to get that code out in a few days (or a week) as well as for commenting (since it will be in the same file).

Requests that lead to a new user may be a little more difficult as that's stitching some data together as well as having to work around a bug in Facebook . Right now, there's not a way to see who accepted a request unless they've already approved your application.. which is kinda weird. We have some plans to work around this where we can put together that if a FB user registers and there is an outstanding Request for that user, that the Request is what made them register. It's a work in progress, but we'd prefer Facebook to simply fix their bug.

Anyways, as for donations, we really don't get offered them often as you already paid your dues :) While we definitely appreciate it, if you're looking to give back, we'd recommend the following:
* Donate to Alpha User Points. Their extension is free in many cases, but they gladly accept donations and have some paid add-ons. If you haven't given back to them, we'd recommend rewarding them.
* Re-subscribe to JFBConnect for a longer term. We'll extend your subscription out for the extra duration.
* If you have money burning a hole in your pocket, we can take care of that too.. you can donate to our PayPal address at This email address is being protected from spambots. You need JavaScript enabled to view it.

Hope that all helps,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #18977 by codeify
Hi Alzander,

For the like'ing, is it the controllers/social.php thats need to be configured/changed?

I understand the problem with the request, the odds that someone that you/anybody send the request to
has the application approved is minimal! =(

Thanx for you thougts about the donations!
I will contribute!

Cheers!
The topic has been locked.
Support Specialist
12 years 2 months ago #18983 by alzander
Yup, the social.php file is where to hit. It should be pretty straightforward if you compare it to the code-snippet above.. just haven't done it yet.

We're irked (to say the least) about the change that made it so we can't see who's accepting the Request. It worked until January 1st when they changed the behavior. There are numerous bugs submitted about it, but it's not seemingly high on the to-do list.

Hope that helps, and let us know if you get something going!

Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #19001 by codeify
Hi,

Yeah, i hit it!

Points for like confirmed, also no points if a person "re-likes"!
The topic has been locked.
Support Specialist
12 years 2 months ago #19004 by alzander
Fantastic. Glad you got something going. If you have any code or details you'd like to share, we'd love to have them.

Either way, hope it was simple, and we hope to have something similar available soon.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #19030 by codeify
Hi Alzander,

I have pm'd you with the code.
*Better you see it/publice it so it will be "correct" =)

Cheers,
Mac
The topic has been locked.