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.
Not a member yet? Click here to register.
Forgot Password?

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

Asked Modified Viewed 1,821 times
K
Kind_Aj
K
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
asked
Junior Member

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,
Kind_Aj attached the following file:
screenshot_at_2017-03-16_20-38-52.png [No information available / 94 Downloads]
0 replies

4 posts

F
Falk
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

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.
0 replies
K
Kind_Aj
K
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
answered
Junior Member

Okay, Falk. So I am doing something wrong. I Will do.I will explore AddonDB, examples.

Thank you Citizen.
0 replies
S
SnakeEye
S
If it aint broke...Don't fix it!
  • Junior Member, joined since
  • Contributed 37 posts on the community forums.
  • Started 15 threads in the forums
answered
Junior Member

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,
0 replies
F
Falk
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

Arise does tackle it on a theme.php level. ( https://www.php-fusion.co.uk/infusions/addondb/view.php?addon_id=414 )
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 4 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

F
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
S
S
If it aint broke...Don't fix it!
  • Junior Member, joined since
  • Contributed 37 posts on the community forums.
  • Started 15 threads in the forums
K
K
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet