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 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2008
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts

    facebook postToFeed() on phpbb3 post, slight issue, help required

    I have a phpbb3 forum that I have modified for my requirements. I have used the Facebook post to feed dialog to allow users to send the text from their forum post to their facebook wall.

    I have added the code between the <!-- BEGIN postrow --> <!-- END postrow --> tags.

    The postToFeed() function works well, all except when I there are more then one post to a topic/thread. The PostToFeed() button/link appears on each post of the topic, but when using the function, it will only post the most recent post in the topic rather than the post that the button/link appears on.

    Has anyone please got any suggestions? Here is my code from the viewtopic_body.html or which I have removed some of the styling to make the code easier to read:




    Code:
        <!-- BEGIN postrow -->
            		<div class="postbody">
            
            
            			<a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a>
            			
            			<div class="content">{postrow.MESSAGE}</div> ************************this is the topic text content here		
            		</div>
            
            		
            	<div id='fb-root'></div>
            
                <script src='http://connect.facebook.net/en_US/all.js'></script>
                <p><img src="http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981"/><a onclick='postToFeed(); return false; '>Post to Facebook profile</a></p>
                <p id='msg'></p>
                <script> 
                  FB.init({appId: "83103676329", status: true, cookie: true});
            
                  function postToFeed() {
            
                    // calling the API ...
                    var obj = {
                      method: 'feed',
                      redirect_uri: 'http://tributetothem.com',
                      link: 'http://www.tributetothem.com/phpBB3/viewtopic.php?p={postrow.POST_ID}',
                      picture: 'http://tributetothem.com/images/logo.gif',
                      name: '{TOPIC_TITLE}',
                      caption: 'http://tributetothem.com',
                      description: '{postrow.MESSAGE}'  ************************this is the topic text content here
                    };
            
                    function callback(response) {
                      document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
                    }
            
                    FB.ui(obj, callback);
                  }
                
                </script>
            
            	</div>
            <!-- END postrow -->

    Thanks in advance

    Antony

  • #2
    New Coder
    Join Date
    Oct 2008
    Posts
    43
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hi

    I just solved it using the post_id as a variable for the function name.

    Thanks

    Antony


  •  

    Posting Permissions

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