Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    Unable to Link from Facebook Wall Post back to Website Comment Box

    Hi there,

    I test posted a post from my website at this test link:

    http://www.junctional.com/1/Independ...iate-Networks/

    (I am using mod-rewrite for my URLs). I used the following code to get the URL of the page:
    Code:
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="<?php echo "http://" . $_SERVER['HTTP_HOST']  . $_SERVER['REQUEST_URI']; ?>" num_posts="100" width="650" colorscheme="dark"></fb:comments>
    The comments post fine on the site and the comments also post fine on my facebook wall. The only problem is that the link from my facebook wall back to the website adds the "fb_comment_id" to the URL so the comments no longer show up because the URL has changed now that facebook has added this parameter. The new URL now looks like this:


    http://www.junctional.com/1/Independ...5591#f2b5ac26a


    I assume the problem is with the PHP code I am using to get the current URL. How can this problem be solved? Try posting a comment and testing it for yourself please.

    thanks!

    (I also posted in the dev FB forums.. no one can answer so I thought I would try here.. thanks)
    Last edited by Bobafart; 05-01-2011 at 04:16 PM.

  • #2
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    846
    Thanks
    15
    Thanked 10 Times in 10 Posts
    If you don't really need the fb_comment_id try linking back to
    PHP Code:
        echo "http://" $_SERVER['HTTP_HOST'].''.$_SERVER['PHP_SELF']; 
    Good luck in the dev forums of FaceBook. I've never had too much success there with getting my questions answered.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • Users who have thanked dniwebdesign for this post:

    Bobafart (05-02-2011)

  • #3
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post
    Quote Originally Posted by dniwebdesign View Post
    If you don't really need the fb_comment_id try linking back to
    PHP Code:
        echo "http://" $_SERVER['HTTP_HOST'].''.$_SERVER['PHP_SELF']; 
    Good luck in the dev forums of FaceBook. I've never had too much success there with getting my questions answered.
    Hi there

    I appreciate your advice. What I am trying to explain is very difficult... it looks like I didn't explain it properly.

    If you go to my profile wall:
    http://www.facebook.com/drdel

    and look for the first post on the wall and click the link: "Independent-Affiliate-Networks-vs-Large-Affiliate-Networks" it takes you back to my website but with the irritating parameter in the URL: "?fb_comment_id=fbc_10150581353070591_20769083_10150581375875591#f1de71922"

    I want to get rid of that URL parameter. The problem is facebook adds it automatically.

    How do I get rid of it?

  • #4
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post
    help pls?

  • #5
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    You wall isn't publicly accessible. You can't remove that URL param from Facebook if they are adding it to the links on their own page. You can redirect people that have that parameter to a page without, in effect stripping it, but the initial request will have it.

  • #6
    New to the CF scene
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have the same issue.

    I've post the situation in my blog. (written by Korean, but I think you can check it up.)

    I think that this issue can solve 'RewriteRule' in '.htaccess' in server root folder.
    Check the '?fb_comment_id=xxxxx' using Regular Expression, get rid of the issued code and Redirection URL.

    but I can't coding Regular Expression, I'm trying to find it.

    If you can find something, let me know please.

  • #7
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tengo el mismo problema.

    Me parece que ese problema siempre va ha estar ahí, a nos ser que Facebook, deje de enviar ese fb_comment_id.

    Esperemos que Facebook haga algo al respecto.

  • #8
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Maybe you can use my solution:
    your code for fb:comments:
    PHP Code:
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="<?php echo "http://" $_SERVER['HTTP_HOST']  . $_SERVER['REQUEST_URI']; ?>" num_posts="100" width="650" colorscheme="dark"></fb:comments>
    you can change it to;
    PHP Code:
    <?php 
                    $url_now
    ="http://" .$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
            list(
    $url_new,$fb_id)=split('fb_comment_id'$url_now2);
            
    $url_now=str_replace("?","",$url_new);
    ?>
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="<?php echo $url_new?>" num_posts="100" width="650" colorscheme="dark"></fb:comments>
    maybe it can't remove fb_comment_id variable on your address bar but it can fix fb:comment

    please tell me if it works.

    regards

    alel_0502


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •