Forum Replies Created
-
Haha…DJPaul beat me by 30 seconds
P.S. stwc – There isnt really much Andy could have done better…its the plugins core that isnt really desinged to work with Buddypress (and Andy didnt write that).
Andy created a single file “port” (to help the community) that amemnds certain functions to the core of the original plugin – to help “insert” data into buddypress fields. Unfortunately, becuase of the way the core of the plugin was written…there are some problems that can’t be addressed with default hooks (ie globals).
I am going to write a post about this soon, and hopefully get some input from the community on the best way to handle the registrationn process in accounting for all of these “new” ways to register.
HOpefully there is a solution I am not seeing
DJPaul is correct – its pretty shot code, and it looks (more and more) like I am going to have to write a facebook connect module from scratch…bummer
My suggestion above was just a way to give some suggestions on a way to hack around it rather than having to rewrite the whole thing
I dont want to make this “fix” sound official – it clearly isnt – and unfortunately fixing this (as I am seeing days later) is causing some other problems….plug one hole, and sure enough the water shoots out somewhere else
So as anyone else would say, if your coding skills are limited – I would urge you to proceed with caution.
Has to do with the fact that a few global variables and functions are not being loaded in the right order…ie the system tries to send out a welcome message before the BuddyPress messaging function’s globals are setup…but only when you use facebook as the registration/login mechinism
Thats what those changes (above) take care of.
///////////
Your problem sounds more like you need to set the facebook application settings. I assume you have created a facebook app on Facebook’s dev side right? Did you set the “Connect URL” in the facebook app settings to be your domain ie : http://www.yourdomain.com.
I beleive whats happening to you would happen if thats not explicitly set.
Turned out to be a fairly simple fix in the end… the facebook_init was loading to early, I changed the order of that to load after globals and added a few new calls ….and now its working great with your plugin!
I will create a new post to explain what needs to be done to make sure both plugins (bp-facebook and welcome work togeather)
Thanks for the help
Hey DJ Paul
I noticed that you added bp_core_account_activated hook which should work in most cases, but like I said (in my particular case) I skip over the activation via the buddypress fbconnect plugin. It inserts the user directly.
Maybe there is a way for me to call that activation once the facebook user is authenticated? Do you know of a way to trigger that whole authorization process without actually making the user click on an email?
That way it basicaly works like this
1. User registers with Facebook conenct button
2. Facebook sends back userinfo (via the api) – thats working currently
(and here is where I am fuzzy)
3. Take the fb information and trigger the account activation “automatically” …effectively bypassing the need for a “key”
Or
Is there another hook I can grab onto somewhere in the process beyond bp_core_account_activated that would work only on INITIAL Registration…but still after all globals are loaded (to ensure the messaging will work)
Any ideas?
Thanks again for the help!
Wow thanks…I will try as soon as I get back to the local computer hosting my test dev. What seems to be happening (in short) is that becuase my users use facebook to login/register…it never goes through the “activation” email scenario….and becuase it registers a new user (and activates them) BEFORE those messages_global are set – the send message function fails.
I tried reording the load_plugin order of the core and the message globals so that they would boot before, but once I did that it screwed up other things (like the order they need to be in to boot through the various functions in buddypress)..so I reverted, and have sense been trying to figure out how to maybe Trigger the “activation” silently in the registration process so that the email verification is not necissary.
I will try the new plugin and report back
Anybody have ideas on the post/question above????
Is there a way to be notified when there is a reply to a post? I almost missed this one/forgot about it.
Thanks for looking into it Andy
Okay…I have more details from my testing. It works now, but I am not really sure WHY. It seems to me that you have to (for some reason) call the get_field_data function (even if its on a useless peice of data) before you can use the set_field_data function.
If you notice from my post above…the only thing that is different is that I have added a new variable that is simply capturing the Name field (number 1). Well when I add this:
$nametestfield = xprofile_get_field_data(1,$wpuid);
And then the set_field after it (with my age variable)…than it starts working, and the field is inputted.
SO….Is there a reason why you can’t call the set_field independently. Calling in the name is basicaly useless in the function above, but it DOES make the whole thing work for some reason.
///////////////////////////////
function BP_Insert_Test($wpuid, $age) {
$age = ‘tester gender’;
$nametestfield = xprofile_get_field_data(1,$wpuid);
echo(‘user name exists already’ . $wpuid . ‘ and userdata is ‘ . $age);
echo(‘Need Field is’ . $nametestfield);
xprofile_set_field_data(2, $wpuid, $age);
}
For some reason…no matter what I try, I can’t inject SPECIFIC variables via the xprofile_set_field_data function….I run this function (below)
ONLY AFTER running two conditionals to make sure
/////////
ONE the buddypress globals are set
and
TWO the check for the xprofile function passes
Both conditionals pass (as expected) then go to my test function below
////////
End result — The echo statement appears correctly…but nothing is appearing in the field values for the user – I am pulling my hair out??????
Sample
////////
function BP_Insert_Test($wpuid, $age) {
$age = ’22’; // Should appear in the profile
echo(‘user id is ‘ . $wpuid . ‘ and userdata is ‘ . $age);
xprofile_set_field_data(2, $wpuid, $age);
}
Any ideas?
Okay….Andy is probably busy, I didnt mean to explicitly ask Andy (only) …if anyone has any advice on this I would appreciate it!
Andy let me ask you….I am playing with the bp-facebook plugin you ported, and specifically trying to add a value to the insert function you have in there now
function bp_fbconnect_insert_data( $user_id, $usermeta )
///////I tried setting an extra value inside that function – statically for now (just for testing) right under the default “full name” insert you have in there now.
I set it up like this:
xprofile_set_field_data(‘Age’, $user_id, ‘Test’);
I have tried setting with double quotes, no quotes, and several different ways, but it never seems to insert into the “Age” field I created in Buddypress.
Any ideas whats going wrong here? I am wondering if this function isnt firing at the right time? OR maybe I am making a stupid mistake
Thoughts? Thanks
I see….I am trying to get my head around the buddypress architecture now, and I guess I got confused from the readme in the skeleton package
It says
Copy /bp-example/ and bp-example.php into /wp-content/plugins/ and activate the plugin.
Thats why I tried to activate it.
Reading that, I figured it had functions “working” so you could see how some of the aspects of the plugin interact with the hooks/front end.
I basically assumed it was a barebones (working example) of several functionsk and calls…but now ooking at it…I assume the statement in the readme is a template to…basically saying “this is waht you put in your readme”?
Thanks for getting back to me
Thanks Andy, I appreciate it. I can see it now…I will dig through the bp-xprofile.php to figure out the other functions.
Thanks for the great work!
Anybody???
I could really use the help please!