Facebook plugin

Discussion in 'Subrion CMS Plugins Discussion' started by Eleanna, Nov 24, 2014.

  1. Eleanna

    Eleanna Member

    Thanks for updating the facebook plugin. Just installed it, and see that it puts itself on ALL the pages. This is not necessarily a good idea, and this site is one of the bad ideas for this behaviour, it's a funeral director's site. It's an open invitation for idiots to come along and "like" the death of somebody announced on the site... any way we can control where the plugin shows and where it doesn't? I also do not find anywhere to actually enter the facebook page URL it is supposed to link to?
    Last edited: Nov 24, 2014
  2. Vasily_B.

    Vasily_B. Project Manager

    Hi @Eleanna

    You can easily control its behavior in Admin Dashboard. Facebook widget is created via block for bottom position, so if you go to Dashboard / Blocks / and edit your facebook you can configure its display on the pages you need.
    Regarding Like button - yep, that does not sound like a good solution for the website you have. If you check Facebook plugin settings, you can see there is a way to disable Like button.

    Cheers
  3. Eleanna

    Eleanna Member

    Ok, thanks. Just checked, this still does not give us anywhere to put the facebook URL this is supposed to link to... Not to be seen anywhere....
  4. Vasily_B.

    Vasily_B. Project Manager

  5. Eleanna

    Eleanna Member

    Ok, let me try this again. If somebody clicks the "like" button, the app has to know which facebook page to add this like to. I must give it that information. Where?
    Last edited: Nov 27, 2014
  6. Vasily_B.

    Vasily_B. Project Manager

  7. Eleanna

    Eleanna Member

    Still struggling with this. I assume this has to do with api keys... I know I've got to create these somewhere, but can't figure out where or how...
  8. Vasily_B.

    Vasily_B. Project Manager

  9. Eleanna

    Eleanna Member

    I know that Vasily, did check it, and have used that before, but... when I login to FB, this is what I get. No matter what I try on this, FB gives me code they say I must to add to the site?. VERY confusing....



    FB.PNG
  10. Facebook changed how it did apps. It will not follow as the original tutorial on this site has instructed.
    Here is a basic HOW TO. In this example it will activate the 'Connect With Facebook' button provided with the Subrion Hybrid Authentication Extension / plugin.
    1. Click on Website (assuming you want a facebook login on your front page).
    2. Type in a unique name for your new application.
    3. Click on 'create new facebook app id' button.
    4. Choose 'apps for pages' in the category drop down.
    5. Click on 'create app id'
    6. It will show a page with code on it. Ignore it. Just page down where it asks "Tell us about your website"
    7. Enter your complete address "http://www.yoursite.com
    8. Click 'next'
    9. Ignore reading the code and other items it throws at you. Pay attention to the four blue buttons it provides.
    10. In my example, I was doing a facebook login, so I clicked on the second blue button 'Login'.
    11. This was the most confusing because it brought you to the 'Docs' page. You can't do anything with that information if you are just trying to do it the easy way.
    12. To avoid confusion ignore this page and click on the 'MY Apps' at the top left. It will load a page that shows your app id and secret.
    13. Click on 'settings' on the left. You can now fill in the blanks that the Subrion team had shown you in their tutorial. Your app domain, email, namespace will be available to fill in. Also your app id and secret appear.
    14. IMPORTANT: on the settings page, you must enter a good Contact Email address if you want your app to go from DEVELOPER stage to PUBLIC.
    15. Click on 'Status and Review on the left.
    16. Click on 'YES' next to your app name where it asks if you want to go public.
    17. On the left, click on FACEBOOK Login or find any page that allows the user to change security.
    18. Click on Client OAUTH Login to verify it is in YES, do not fill out Whitelist info.
    19. Click on WEB OAUTH Login verify it is in YES.
    20. Type your complete url into Valid OAuth Redirect urls.
    21. In my example: I am at http://projectashenfire.org and it redirects to http://projectashenfire.org/home/cms/subrion (note, this is where the index.php file is)
    22. Googling for this issue, people recommended putting all urls that point to config and index info.
    23. Find the software development kit for your app in the facebook developers menu, the links will change.
    24. The SDK code could change, but for now; using windows JAVA for my site; it is:
      <script>
      window.fbAsyncInit =function(){
      FB.init({
      appId :'Enter your facebook app id here',
      xfbml :true,
      version :'v2.4'});};

      (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>
    25. Copy your SDK code to any page that requires FACEBOOK interaction, into a page with html code already present, put the code after the <body> tag.
    26. Navigate to your /subrion/plugins/hybridauth/includes/Hybrid/Providers folder, on your local drive; or use ftp to copy it to your desktop and edit it.
    27. Back up the Facebook.php file.
    28. Edit the Facebook.php file.
    29. You will immediately see public $scope = "email, user_about_me, user_birthday, user_hometown, user_website, read_stream, publish_actions, read_friendlists";
    30. DELETE read_stream, read_friendlists
    31. Save
    32. Copy the new facebook.php to your server
    33. Login to Subrion as the administrator.
    34. Click on 'Extensions' on the subrion panel.
    35. Find the Facebook extension and click on the gear icon.
    36. Fill the Application ID and Application Secret fields provided by step 13.

    Once this is done, the user should be able to click on the login/register link at the
    top of the page (usually in the inventory menu), then click on the 'Connect With Facebook'
    button.
    That will take the user to the Facebook OAUTH page asking the user to login to facebook.
    After logging into facebook, the user will be redirected back to the author's website
    and a new negotiation with facebook and the author's login page will commence.

    The user should see an instant login and will be ready to enjoy the author's site.
    I hope this helps.
    Last edited: Jul 25, 2016
    Eleanna and Dayir_A. like this.

Share This Page