Forums

[Plugin: WPBook] | Excluding a Plugin from Use Inside of FB | Feature Request (2 posts)

  1. rashadow
    Member
    Posted 8 months ago #

    John (or Dave or Bandon?)

    I found the instructions: How do I exclude a plugin from use inside of Facebook or only us a plugin inside of Facebook? (http://wpbook.net/docs/faq/) -

    - and I was wondering if it would be possible to include that functionality (those options) directly into the plugin in a future update.

    It is completely out of pure laziness that I ask this, but I think it would be a boon to many of us that use this plugin...if it's possible.

    How do I exclude a plugin from use inside of Facebook or only us a plugin inside of Facebook?

    You'll want to go to the your plugin file you wish to exclude/include inside your app and add this to the top of the main file that calls the function.

    if (isset($_SERVER["HTTP_USER_AGENT"])) {
    $is_facebook = "false";
    }
    if (isset($_GET['fb_sig_in_iframe']) || isset($_GET['fb_force_mode'])) {
    $is_facebook= "true";
    }

    if ($is_facebook == "false") { //make sure the user IS NOT logged into Facebook
    //(rest of plugin code)
    } //end check to see if user is inside of facebook

    To only use a plugin in facebook use

    if ($is_facebook == "true"){ //make sure the user IS logged into Facebook
    //(rest of plugin code)
    } //end check to see if user is inside of facebook

  2. johneckman
    Member
    Posted 4 months ago #

    @rashadow - not sure we can do this, as it requires modifying other plugins' files.

    There's no standard API I know of for disabling the actions of other plugins - things could get a bit scary if it was possible!

    No reason other plugin developers can't use the same approach to check to see if they are inside FB, but I don't know how I can force them to

Reply

You must log in to post.

About this Topic