WordPress.org

Ready to get started?Download WordPress

Forums

Simple Facebook Connect
Like Button Conflict With Simple:Press Forum (22 posts)

  1. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Using newest version of both plugins (non-dev)

    When the Like button module of SFC is active, Simple:Press Forum will not load. The template will load, just not the forum. When the Like button is deactivated, forum comes back.

    Don't suppose their is any way to exclude the like button from a certain page/template? Especially since I am manually placing the button, it would be great if there was no code to manually place the Like button, nothing loads.... or a way to exclude from a page ID or template or something.

    Other than this issue, stellar plugin!

    Thanks!

    http://wordpress.org/extend/plugins/simple-facebook-connect/

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    // STOP SFC LIKE BUTTON FROM RUNNING ON FORUM PAGE
    add_action( 'parse_query', 'disable_sfc_on_forum_page' );
    function disable_sfc_on_forum_page() {
    	if( is_page('forum') )
    		remove_filter( 'the_content', 'sfc_like_button_automatic', 30 );
    }

    I thought this would help....but it does not......

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    OK, so...when the SFC Like button is active, I get this in my source:

    <div id="forumContent">
     <a name="content"></a>
    <script src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php'></script><script src='http://www.rvoodoo.com/empire/wp-includes/js/jquery/jquery.js'></script> <style type="text/css">
     h1 a { background-image:url(http://www.rvoodoo.com/empire/…..oplate.png) !important; height:145px !important; }
     </style>
      <script type="text/javascript">
     function sfc_login_check() {
      FB.Facebook.apiClient.users_hasAppPermission('email',function(res,ex){
       if( !res ) {
        FB.Connect.showPermissionDialog("email", function(perms) {
         window.location.reload();
        });
       } else {
        window.location.reload();
       }
      });
     }
     </script>
     <script type="text/javascript">
    FB_RequireFeatures(["XFBML"], function() {
       FB.init("6b7cf5de09147699357e2a34cdd3a27e", "http://www.rvoodoo.com/?xd_receiver=1", {"permsToRequestOnConnect":"email"});
    });
    </script>
    <noscript><div class="sfregmessage">This forum requires Javascript to be enabled for posting content</div></noscript>
    <!– Start of SPF Container (sforum) –>

    followed by deformed forum code like this:

    <div>
    <a>&nbsp;</a>
    <div></div>
    <div class="sfloginstrip">

    When the Like button is not active, I just get this

    <div id="forumContent">
     <a name="content"></a>
    
     <noscript><div class="sfregmessage">This forum requires Javascript to be enabled for posting content</div></noscript>
    <!– Start of SPF Container (sforum) –>

    Followed by proper forum code:

    <div id="sforum">
    <a id="forumtop">&nbsp;</a>
    <div id="sflogininfo"></div>

    So, it definitely looks like the code being brought in above by the SFC Like button won't allow the forum to load. The forum will load with SFC base active, and several other modules, just not the Like button.

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Also, turning on the 'Allow Multiple Load' option in the integration section of Simple:Press worked for a day. After that it will no longer load the forum stylesheet. The theme template will load fine, just the forum template won't load. I can get the content with no styling if I allow multiple load. If I turn that off, I get nothing.

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Jeez man, I can't win! I was actually considering switching forum plugin, so I tested Mingle forum. And the forum loaded twice. Did a little research, and it looks liek this is an issue for others.

    Seems I'm gonna have a heck of a time running the SFC Like with any forum!

  6. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    Sounds like these forum software packages you're trying are all doing the wrong thing with regard to the_content filter.

    If a plugin, like a forum plugin, produces output from the_content filter, then that plugin is broken. Filters should not produce output, they return it into variables.

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Thanks for the input! Gives me something to work with at least.... or to report to them!

  8. Mark / t31os
    Moderator
    Posted 3 years ago #

    Simple Forum runs the following filters (all return data, no echo/printing going on)

    add_filter('the_content', 'sf_show_blog_link');
    add_filter('the_content', 'sf_filter_syntax_display', 0);
    add_filter('the_content', 'sf_filter_syntax_display', 0);
    add_filter('the_content', 'sf_setup_forum', 1);
    add_filter('the_content', 'sf_wptexturize');

    Simple Facebook Connect

    add_filter('the_content', 'wptexturize' );
    add_filter('the_content', 'sfc_like_button_automatic', 30);
    add_filter('the_content', 'wptexturize' );
    add_filter('the_content', 'sfc_share_button_automatic', 30);

    Maybe the texturize functions aren't playing nice... as a guess...

  9. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    Hmm.. Basically, both share and like do their own apply_filters for 'the_content' on some data, and that data gets scanned to go into the header (as meta tags). So I can't think of anything else that would cause it to appear twice.

    Without seeing the resulting HTML, there's no easy way to tell why it's behaving this way.

    That "setup_forum" call is suggestive to me though. Because with SFC, it's going to get called twice, perhaps three times. SFC needs to get the content to look for images or to build meta tags.

  10. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Somebody order some html up in here? Order up!

    Here is Simple:Press active, Like Button Inactive: Forum is Fine
    http://wordpres.pastebin.com/dcRppiWS

    Here is Like Button Active, Simple:Press active, with simple:press 'allow multiple loading of forum content' feature turned OFF: Forum does not load at all
    http://wordpress.pastebin.com/pUD8LrZP

    Here is Like Button Active, Simple:Press active, with simple:press 'allow multiple loading of forum content' feature turned ON: Forum content loads, but output is broken and style is all jacked up
    http://wordpress.pastebin.com/mXrbg718

    And finally, for comparison sake, here is the other forum I tried to load, Mingle. Like Button Also active: Forum Loads Twice
    http://wordpress.pastebin.com/9UbmFLwN

    I think that's everything, hopefully this can help get things possibly sorted out. It'd be great to get things playing nice!!

    Site in question is http://www.rvoodoo.com

    Thanks all!

  11. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    Looking at http://www.rvoodoo.com/forum/ I see that something there is heavily jacked up. The facebook code is loading two or three times, and the init function call is happening in multiple places. Code that is supposed to be in the footer is loading in the header (twice), and something else is loading the Facebook JS code improperly to begin with.

    Do you have any other facebook plugins of any sort? They're probably conflicting in some fashion.

  12. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    I do not have any other facebook plugin,or anything that even references facebook in any way.

    currently I have the Like buttoon, and Simple:Press activated. I have the "allow multiple loading of forum content" feature in Simple:Press also turned on. That allows the forum to load, it just does it all messed up. If I turn that off the forum doesn't load at all, but it gets rid of that jacked up code.

    In the interest of keeping the discussion going, and to try to get all the information I can to anyone involved who may come up with a solution, I'll post the reply from over on the Simple:Press support forum.

    We remove the filter 'wptexturize' from forum content because it makes a real nasty mess of quotation marks. So this other plugin just puts them back again!
    I think you should push for being able to exclude individual pages which is the best and most useful option and, in my personal opinion, should be a feature of ANY plugin that works on content.

    Again, I thank anyone taking the time to look at this. I really enjoy both plugins, and understand it is hard to develop all this stuff, plus maintain a personal life!

  13. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    This has nothing to do with wptexturize, so I have no idea what the heck they're talking about there. And excluding a page wouldn't make any difference, because the plugins he's talking about are not the source of the problem to begin with.

    The JS code that SFC normally puts into the footer (by hooking to wp_footer or admin_footer) is present on your forum page no less than 4 times. So something there is seriously jacked up and I have no idea of how to correct that.

    It looks to be around the login form there that all this is happening. I suspect they're doing something weird there.

    My advice to you is to simply use one or the other, not both. They're just not going to work together. SimplePress is doing too much weird stuff.

  14. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    To be more specific, this code:
    <script src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php'></script>

    Comes out of the SFC-Login plugin. It has nothing to do with the Like button at all. It gets added to the login_head action.

    And this code:

    <script type="text/javascript">
     function sfc_login_check() {
      FB.Facebook.apiClient.users_hasAppPermission('email',function(res,ex){
       if( !res ) {
        FB.Connect.showPermissionDialog("email", function(perms) {
         window.location.reload();
        });
       } else {
        window.location.reload();
       }
      });
     }
     </script>
     <script type="text/javascript">
    FB_RequireFeatures(["XFBML"], function() {
       FB.init("6b7cf5de09147699357e2a34cdd3a27e", "http://www.rvoodoo.com/?xd_receiver=1", {"permsToRequestOnConnect":"email"});
    });
    </script>

    Comes out of the login plugin too, only it's supposed to be hooked to the login_form action.

    Neither of those actions should ever be anywhere but on the wp-login.php page. I suspect the SP code that displays the login form has been copied from that code, only badly. And anyway, that code copying is now unnecessary, as WP has a function specifically designed to let you display a proper login form anywhere you like: wp_login_form().

  15. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    I don't see any of that code at all. I'm guessing it's only loaded when the user is not logged in? The only code I see is this in the footer:

    <script type="text/javascript">
    FB_RequireFeatures(["XFBML"], function() {
      	FB.init("6b7cf5de09147699357e2a34cdd3a27e", "http://www.rvoodoo.com/?xd_receiver=1", {"permsToRequestOnConnect":"email"});
    });
    </script>

    Is that portion connected to just the login plugin as well?

    Other than that, just the meta tags in the header. I don't see anything loading multiple times, or at all really.....

  16. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    I'm guessing it's only loaded when the user is not logged in?

    I suspect that to be the case, as if you're logged in, there would be no need to load the login box there.

    Log out, then look at your forum.

    The bit of code you posted is the Facebook initializer code. It'll be in the footer of all pages.

  17. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Hmm, well Simple:Press has the ability to totally switch off their login/registration component. So then the forum reverts to simply using WPs in-built login/registration mechanisms. Turning off the simple:press login did nothing. Forum still loads broken, or not at all depending on setting as listed before

  18. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    I'm hesitant to mark this thread resolved, as a conflict definitely exists. However, for my own personal use I have fixed my site. I had a cleanup filter on the_content to strip away extranneous crap posted to my site from auto-posting services. This always kept my blog valid. The script works fine with either plugin, but not both plugins.

    The SFC Like button, and simple:press definitely have a conflict. But it can be worked around by allowing multiple loads of simple:press in the settings for the forum.

  19. kgagne
    Member
    Posted 3 years ago #

    it can be worked around by allowing multiple loads of simple:press in the settings for the forum.

    I get a bit lost among Simple:Press's many options; could you point out where the settings you reference are? I'm having the same conflict between the forum and the Like plugin that you had with SFC.

  20. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    The settings to mess with are on the page and permalinks menu option within simple:press.

    Load js in footer, and allow multiple loads are the options I needed turned on

  21. kgagne
    Member
    Posted 3 years ago #

    Thanks, Voodoo! I found that info under "WP Integration". I already had the footer option enabled; changing the other one cured what ailed me.

  22. Mullows
    Member
    Posted 2 years ago #

    Hi I installed the Facebook likes plugins for my blog but for some reason it has imported likes on all my pages. I am OK with this but it has appeared on all pages. How do I fix this????

    Thanks Paul

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic