Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Forgot Password?
Navigation

Where do I place this SDK code for social membership login??

Last updated on 9 years ago
K
Kind_AjJunior Member
Posted 9 years ago
Yo' Citizens,
Hello again. Problem, I cannot find, or figure out, where to actually place this SDK code?
I am not sure whether to place this here, or in code snippets. Figured to start here,

I have a "very similar, Discussion Forum website" and I am trying to allow citizens to join my website, and gain memberships using their, facebook and Google+ (G+) profiles, by adding that button to my login panel.

I tried using The "facebook_connect_panel" infusion, I have everything loaded correctly, and infused correctly, edited config.php, with the correct info. Everything shows in Admin panels, however the "login with fb" does not show up in panel.

I did some research, haven't found answer, yet. The best i got so far, is from facebook themselves, they tell me to:

** Setup the Facebook SDK for JavaScript
The following snippet of code will give the basic version of the SDK where the options are set to their most common defaults. You should insert it directly after the opening <body> tag on each page you want to load it:

** I Can Not Find The "<body>" tag ANYWHERE in my "File Manager". 98 percent of All my pages are .php. Not html.

** <script>
** window.fbAsyncInit = function() {
**    FB.init({
**      appId      : 'myappidnumber',
**      xfbml      : true,
**      version    : 'v2.8'
**    });
**    FB.AppEvents.logPageView();
**  };
**
**  (function(d, s, id){
**     var js, fjs = d.getElementsByTagName(s)[0];
**     if (d.getElementById(id)) {return;}
**     js = d.createElement(s); js.id = id;
**     js.src = "//connect.facebook.net/en_US/sdk.js";
**     fjs.parentNode.insertBefore(js, fjs);
**   }(document, 'script', 'facebook-jssdk'));
** </script>


** Then place this code wherever you want the plugin to appear on your page;


**<div class="fb-page" data-href="https://www.facebook.com/cfcspro/" data-tabs="timeline" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"><blockquote cite="https://www.facebook.com/cfcspro/" class="fb-xfbml-parse-ignore"><a href="https://www.facebook.com/cfcspro/">Citizens First Cyber Security Professionals</a></blockquote></div>

** Which ideally i want to place in panel for member login's, so citizens can see it and just click on fb button to login

Am I just blind and overlooking this/these file's? Or is there something else i have to do, or something I am missing?
Or do I need to create a custom file of some sort??

Thank You For Your Time Citizens.

Merged on Mar 16 2017 at 20:43:05:
Sorry, I don't know why those smilies show up in the code like that. i did not place that there.
Edited by N/A on 17-03-2017 19:34, 9 years ago
Kind_Aj attached the following file:
screenshot_at_2017-03-16_20-38-52.png [No information available / 94 Downloads]
F
FalkSuper Admin
Posted 9 years ago
It does not work like that in a CMS, there are plenty of ready to use Social Plugins, see examples in these from the AddonDB.
K
Kind_AjJunior Member
Posted 9 years ago
Okay, Falk. So I am doing something wrong. I Will do.I will explore AddonDB, examples.

Thank you Citizen.
S
SnakeEyeJunior Member
Posted 9 years ago
If you want it to work with any theme you have loaded, you will need to edit your header.php file in themes/templates/header.php
Around line 50 you will see:
echo "</head>\n<body>\n";


Start from there. I could be wrong so make sure you back up your files.

When done it should look like this:
echo "</head>\n<body>** <script>
** window.fbAsyncInit = function() {
**    FB.init({
**      appId      : 'myappidnumber',
**      xfbml      : true,
**      version    : 'v2.8'
**    });
**    FB.AppEvents.logPageView();
**  };
**
**  (function(d, s, id){
**     var js, fjs = d.getElementsByTagName(s)[0];
**     if (d.getElementById(id)) {return;}
**     js = d.createElement(s); js.id = id;
**     js.src = '//connect.facebook.net/en_US/sdk.js';
**     fjs.parentNode.insertBefore(js, fjs);
**   }(document, 'script', 'facebook-jssdk'));
** </script>\n";
Edited by SnakeEye on 17-03-2017 22:44, 9 years ago
F
FalkSuper Admin
Posted 9 years ago
Arise does tackle it on a theme.php level. ( https://www.php-fusion.co.uk/infusions/addondb/view.php?addon_id=414 )
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
You cannot set up a bounty in this discussion thread.
Moderator: Support Team
Users who participated in discussion: Falk, SnakeEye, Kind_Aj