• If I click “Logout” from within comments in my blog, I am redirected to a specific post. I have already tried deactivating all of my plugins, except SFC, but I have the same problem.

    WP-Theme: WooThemes Bueno
    URL: https://www.danedesutter.com/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    I think I’m in the same issue. My problem is: I’m looking at an attachment (image.php), and commenting it and logout. At this point I’m redirected to the parent post of the attachment.

    The problem should be in FB.Connect.logoutAndRedirect(\”<?php the_permalink() ?>\”), in these lines (taken from /plugins/simple-facebook-connect/sfc-comments.php):

    if (!jQuery('#fb-user').length) {
    		jQuery('#comment-user-details').hide().after("<span id='fb-user'>" +
    		"<fb:profile-pic uid='loggedinuser' facebook-logo='true' size='normal' height='96'></fb:profile-pic>" +
    		"<span id='fb-msg'><strong><fb:intl>Ciao</fb:intl> <fb:name uid='loggedinuser' useyou='false'></fb:name> !</strong><br /><fb:intl>Sei connesso con il tuo account Facebook.</fb:intl>" +
    		" <a href='#' onclick='FB.Connect.logoutAndRedirect(\"<?php the_permalink() ?>\"); return false;'>Logout</a>" +
    		"</span></span>");
    		jQuery('#sfc_comm_send').html('<input style="width: auto;" type="checkbox" id="sfc_comm_share" /><label for="sfc_comm_send"><fb:intl>Condividi anche su Facebook</fb:intl></label>');
    	}

    The Loop I’m using comments_template() in is a personalized one, so I’ve tried to add wp_reset_query() before comments_template(), but doesn’t work, and after the logout I’m redirected to the parent post.

    Anybody can help?
    Thanks

    This worked for me:
    <a href="<?php echo esc_url( wp_logout_url( $_SERVER['REQUEST_URI'] ) ); ?>">Log out</a>

    I added it to the /sfc-comments.php in the sfc plugin folder

    "<a href='#' onclick='FB.Connect.logoutAndRedirect(\"<?php echo esc_url( wp_logout_url( $_SERVER['REQUEST_URI'] ) ); ?>\"); return false;'> <?php echo addslashes(__('Logout', 'sfc')); ?></a>"

    I hope this helps, here is the link where I found this info:

    https://codex.www.ads-software.com/Function_Reference/get_permalink

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Simple Facebook Connect] SFC Comments Logout Redirects to Specific Post’ is closed to new replies.