Topic-icon Connecting user accounts

Active Subscriptions:

None
12 years 2 months ago - 12 years 2 months ago #42307 by camjam
Hi there, sorry to bug u with all the questions!!! I want to have a area of my site devoted to connecting social networks to yoru account, that is, if your already registered on the site and wish to say connect linked in, u would be able to goto a page, and click connect account and then after that process is complete i want to detect the account connection and then ask them instead if they want to push status updates to the selected site, i pretty much made all this alreday, embedded into my jomsocial edit user area on a new page, i noticed in the code for edit user details i think, theres already a similar bit of code for facebook that asks this, or does similar, i wondered tho if perhaps it wasnt complete yet? cuz i added some debug txt to one of the functions and it doesnt get past this part

<?php
if( $config->get('fbconnectkey') && $config->get('fbconnectsecret') )
{
?> got keys!!!

i dont get to see my got keys txt so i scrolled around and im confused as to where $config is comming from, in my case its not defined i dont think at least not in the context of whats on my screen, and i wondered is there more properties similar to if( $associated ) but for the other 3 providers?

So far i basically grabbed the code for the buttons that can be set to appear on the sclogin module after logging in, i presume these will surfice.

Sorry to bug u, i really appreciate your help, i just thought this would be a fairly standard part of social network connecting and cant find alot of info about this partic aspect in your docs.

Kind Regards,
Last edit: 12 years 2 months ago by camjam.
The topic has been locked.
Support Specialist
12 years 2 months ago #42325 by alzander
Replied by alzander on topic Connecting user accounts
The code you're looking at is from JomSocial itself. The values that are checking to be set are the FB key set in JomSocial, not the ones in JFBConnect.

Since you're using JFBConnect (and you know you are), you don't really need to perform a check first. For a specific example of how to generate the connect buttons, see the /modules/mod_sclogin/helper.php file in the getReconnectButtons function.

Digging it down though, you should be able to add something like:
foreach (JFBCFactory::getAllProviders() as $provider)
        {
            $buttonHtml .= $provider->connectButton($params);
            if ($addClearfix && $buttonHtml != '')
                $buttonHtml .= '<div style="clear:both"></div>';
        }
        if ($buttonHtml)
            echo '<div class="sc-connect-user">Connect your accounts?</div>' . $buttonHtml;

I hope that helps, but let us know if you need anything else.

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

None
12 years 2 months ago #42349 by camjam
Replied by camjam on topic Connecting user accounts
Thanks Alex that looks like exactly what im after ill give it a shot and get back to you, thanks so much.

Also do u do a changelog or whatsnew.txt for ur updates? having done so many mods i always worry when i do an update!!!
The topic has been locked.
Support Specialist
12 years 2 months ago #42354 by alzander
Replied by alzander on topic Connecting user accounts
Glad to hear that seems to be putting you on the right track.

As for changes, you can always check out the JFBConnect Changelog and/or SCLogin changelog . We don't have a line-for-line change log anywhere if you need to see the actual code changes though. Hopefully, the above gives you some ideas of where to look for changes.

Of course, in general, if you're making changes to JFBConnect or SCLogin directly, you should hopefully be able to do so in our template files using overrides. If you're modifying our controllers or models, let us know what you're doing. It's possible we can integrate some changes, if they'd be beneficial to others, in an upcoming release.

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

None
12 years 2 months ago #42376 by camjam
Replied by camjam on topic Connecting user accounts
Hey alex i hope all is well,

The reason i asked about a changelog specifically is because after updating jfbconnect to the latest revision, my K2 front end editor fell to pieces, to explain, it has tabs on it, with functions like add image, add media, and so on, after the upadate the content of the k2tabs becomes split from the tab area and displayed below the k2 editor gui in my case i have JCE i think it is, as the editor.

So.. i do have windif, but im not sure i can load a whole bunch of files into it at once, thus making the procedure of seeing what has changed lengthy and troublesome, i do have a cpl of *nix shells at my disposal and im sure there is some command to compare directorys and output the diff, but i really havnt done it b4.

Anyway what i did is to fix the bug and bring the tabs back to life, (containing their content and actually shifting on clicks is this) ill just paste it, i essentially commented out 95% of the toolbar.php as shown below.

<?php
/**
* @package JFBConnect
* @copyright (c) 2009-@CURRENT_YEAR@ by SourceCoast - All Rights Reserved
* @license www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @version Release v@VERSION@
* @build-date @DATE@
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

class JFBConnectToolbar
{
private $buttons = array();

public function onAfterDispatch()
{
// if (JFactory::getUser()->authorise('jfbconnect.channels.post', 'com_jfbconnect'))
// {
// $path = JPATH_SITE . '/components/com_jfbconnect/libraries/toolbar/';
// $files = JFolder::files($path);
// foreach ($files as $f)
// {
// require_once($path . $f);
// $class = 'JFBConnectToolbar' . str_replace('.php', '', $f);
// $this->buttons[] = new $class();
// }
//
// $doc = JFactory::getDocument();
// $doc->addStyleSheet('components/com_jfbconnect/assets/jfbconnect.css');
// if (JFBCFactory::config()->get('facebook_display_errors'))
// {
//// $doc->addScript('media/sourcecoast/js/jquery-ui.js');
// $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.css');
// }
// else
// {
//// $doc->addScript('media/sourcecoast/js/jquery-ui.min.js');
// $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.min.css');
// }
// }
}

public function onAfterRender()
{
if (JFactory::getUser()->authorise('jfbconnect.channels.post', 'com_jfbconnect'))
{
// $buttons = array();
// $buttonHtml = array();
// foreach ($this->buttons as $b)
// {
// $buttons[] = '<button name="' . $b->systemName . '">' . $b->displayName . '</button>';
// $buttonHtml[] = $b->getHtml();
// }
// $buttons[] = '<button name="close">X</button>';
// $html = '<div id="social-toolbar" class="ui-widget-header ui-corner-all" style="position:fixed; top: 10px">';
// $html .= implode($buttons);
// $html .= '</div>';
// $html .= implode($buttonHtml);
//
// $body = JResponse::getBody();
// $body = str_ireplace("</body>", $html . "</body>", $body);
// JResponse::setBody($body);
}
}
}

I cant tell easily just by looking at this why this is occuring, i pressume there are some conflicts happening, that could maybe be resolved with noconflict() really not sure mate anyways i just thought i would pass that little gem on to u, im quite proud of myself for being able to find it and bring the front end editor back to life :D

P.S i did have to make some changes to the sclogin theme directory within the media/sourcecoast directry structure, simply to add a padding value to the sclogin div i place in my upper toolbar, which gets overridden along with the color changes i make on each update.

.sclogin {
text-align: right;
margin-top: 18px;
etc.

I also wanted to say thank-you very much for your support and help with this i really appreciate it.
The topic has been locked.
Support Specialist
12 years 2 months ago #42408 by alzander
Replied by alzander on topic Connecting user accounts
Thanks for the post and clarification. The issue is most likely these two lines specifically:
//                $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.css');
and
//                $doc->addStyleSheet('media/sourcecoast/css/jquery-ui/jquery-ui.min.css');
Those load an additional CSS file for jQuery-UI, which is the interface library we're using for the social toolbars. We already have a task to better namespace those CSS files so that their styles only apply to our toolbar. There's also a separate issue to be able to completely disable the social toolbar, if you never want it to appear.. even for super admins.

If you want the toolbar though, just commenting out those 2 lines *may* work for you. It should fix the K2 editor toolbar.. but our toolbar may be funky if some styles are missing. It should put you closer to where you want to be though.

I hope that helps and, as always, should you need anything else, just let me know!

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

None
12 years 2 months ago - 12 years 2 months ago #42423 by camjam
Replied by camjam on topic Connecting user accounts
Ahhh, cool ok ill give that a try and let you know, i face a new problem today surrounding associating accounts to jomsocial via jfbconnect, you see jomsocial, im not sure if u have checked recently has several options to allow status upates for 1, to be pulled and pushed back and forth from facebook to jomsocial, along with a few other options to add the fb watermark to the avatar, to import the avatar, along with the option i belive u also have to reimport the profile each time, and these are triggered only by a flag set by jomsocial for the account, if u open the file profile.edit.php from jomsocial u will see within a section with:

if( $config->get('fbconnectkey') && $config->get('fbconnectsecret') )
{
?>

this is pulling the api and secret key from the jomsocial facebook connect page, i belive i read in your docs at some point that u advise ppl not to have these filled out if using JFBConnect, so i had removed mine, and it wasnt until i looked in this file that i saw the if loop and as such a trigger to display more settings for the user to configure, anyways after this it does the isadmin check (something else i wanted to ask you about) and then it has:

if( $associated ) {

then if these vars are fulfulled it then and only then display the check box for the user woth associated account to be able to select if they want to push and in fact pull too, status updates to and from facebook. which for me is absolute necessity, it seems as tho after associating my regular jomsocial account with facebook via jfbconnect that the $associated variable has not been set for my account so i do not see any option for facebook, nor can i find a way to deassociate my account, and as u can imagine because $associate has not been met, jomsocial also still asking me, to login with facebook and is supplying an additional login with facebook button on the registration form lol! i kno this is confusing but for me now i had to turn off my jfbconnect :( a major part of our marketing strategy surrounds being able to push jomsocial posts and comments to facebook and other social networks, also i noticed after i associated my jomsocial account with facebook via jfbconnect, is that i was still presented with the same set of buttons as b4 i was associated if u follow there was no way to do any form of configuration such as deassociate or more, i think its important to set this $associated variable and try to hook into the same options as the jomsocial would then offer the user, u kno i turned on jomsocial facebook connect, logged in using that and JFBConnect was still asking me to login with facebook, even tho it was associated already, (since i enter the api keys and such to get the options for users) so its very confusing for me, tho i can follow _just_ what is happening! im not sure what to do tbh, its very hard to even think what can i do to resolve it quickly.

Also there is a link in Jomsocial alex next to use JFBCOnnect option that says documentation but i click this and it takes me to
shareasale.com/r.cfm?b=476384&m=46720&u=...omsocial&lplid=22616

sharesale.com? and my kaspersky has blocked it so i cant see exactly, maybe i missed something tho i see the url and i think i can find it on your site by converting the url encoded slashes but it comes up with not found.

Alex i see also in the jomsocial database a table called community_connect_users which has entry for users who have associated and i suspect its this table that is referenced when jomsocial is deciding whether to set the $associated variable to true or not.
Last edit: 12 years 2 months ago by camjam.
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #42424 by camjam
Replied by camjam on topic Connecting user accounts
On the if ($Admin) thing is there a specific reason why a superuser cant associate their accounts safely? just out of curiosity i wonderd what that could be
The topic has been locked.
Support Specialist
12 years 2 months ago #42593 by alzander
Replied by alzander on topic Connecting user accounts
Cameron,
Sorry for the delayed response.

The code you mention above for $associated and $isAdmin is JomSocial's code. That's not ours. We do recommend not setting the JomSocial Facebook API / Secret key because it can conflict with JFBConnect. There can be only one solution managing Facebook registrations/logins to your site at a time. If you have multiple, things can get out of sync and you can/will run into issues logging in. The extra Facebook login buttons are one symptom of the problem. By not filling out the keys in JomSocial, they won't show the buttons and then JFBConnect will be the only one that should be showing them.

For pushing status updates to Facebook, we don't currently have an option for users to do so. We try to do it in a more 'smart' manner. We will post any status update a user makes to JomSocial back to Facebook if all 3 of the below requirements are met:
a) The user has given the *optional* permission to post on their behalf to Facebook. This permission is presented when they register on your site using Facebook.
b) The user is creating a status update that is Public (the privacy options are not set). In this case, the post will be public on your site for search engines and all users already.
c) You've enabled the "Push status to Facebook" option in JFBConnect -> Profiles -> Facebook area.

We do have plans to offer more granularity over the posting options in a future update with deeper integration into the JomSocial streams. That should let a user choose which posts to broadcast to multiple networks. However, it's not an often requested feature to have that level of control for the user due to the constraints we already use above.. and the user's granting of permission to do so ahead of time.

Documentation link in JomSocial
That's an affiliate link to our documentation. The destination link is:
www.sourcecoast.com/jfbconnect/docs/thir...ration-for-jomsocial

JomSocial connect_users table
You're correct that that's the table that JomSocial uses. However, that table is not used by JFBConnect. We store additional details in our usermap table. If you've been using JomSocial previously for Facebook integration, we recommend importing the JomSocial connect_users table to JFBConnect. That can be done in the JFBConnect -> Usermap area. Click the "Import Connections" button when the Social Profiles - JomSocial plugin is enabled and your previous connections from JomSocial will be imported. That way, users won't notice that you upgraded to JFBConnect and will be able to login with Facebook just like before.

I hope that helps answer your questions,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #42646 by camjam
Replied by camjam on topic Connecting user accounts
Hi Alex, no problems, it would be great to be able to have an area where users could manage their connected accounts, is it possible to connect an account to more than 1 social network?
The topic has been locked.