WordPress.org

Ready to get started?Download WordPress

Forums

Simple Facebook Connect
putting the publish to fan page button on the front end (5 posts)

  1. Taylor Baybutt
    Member
    Posted 3 years ago #

    Hello,
    I have a password protected buddy press community for my office intranet. I have created a way for members to suggest status update suggestions and I want to put a post to fan page button on the front end for only the bosses to see and to easily select a status and post it to our fan page.

    I am just now delving into the code for the sfc-publish plugin but I thought I'd ask if anyone has any experience doing this, or moving the button at all.

    I also would like to hear if anyone has managed to get the plugin to post the content as a status instead of as a link attachment.

    Thanks!

  2. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    SFC-Publish adds the publish to fan page buttons to the Edit Post page, in a metabox. It doesn't have any way to put the same buttons on the front page though.

    I haven't tried it, but you could try calling sfc_publish_meta_box($post); from inside the Loop. This would *maybe* let it generate the same two publishing buttons on the front end of the site.

    Note that Facebook's methods really rely on a site being available to the public. So some things like the picture and such are not going to display on the page. If it doesn't have a public web address, you may not even be able to get the FB App to work at all.

  3. Taylor Baybutt
    Member
    Posted 3 years ago #

    <script type="text/javascript">
    	function sfcPublish(message,attachment) {
    	  FB.ensureInit(function () {
    	    FB.Connect.streamPublish(message,attachment,
    			<?php echo json_encode($action_links); ?>,
    			null, null, null, false,
    			'183229491704587'
    		);
    	  });
    	}
    
    	function sfcShowPubButtons() {
    		jQuery('#sfc-publish-buttons').html('<input type="button" class="button-primary" onclick="sfcPublish(); return false;" value="<?php echo addslashes(__('Publish to Facebook', 'sfc')); ?> <?php if ($options["fanpage"]) echo addslashes (__('Fan Page', 'sfc')); else echo addslashes(__('Application', 'sfc')); ?>" /><input type="button" class="button-primary" onclick="sfcPersonalPublish(); return false;" value="<?php echo addslashes(__('Publish to your Facebook Profile', 'sfc')); ?>" />');
    	}
    </script>

    put this in my page template

    and then this button

    <span onclick="sfcPublish(<?php the_content(); ?>);" style="cursor:pointer">fb</span>

    that was all, though I am still trying to get attachments to work.

  4. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    Yeah, just putting that code in won't work. There's more to it than that.

  5. Taylor Baybutt
    Member
    Posted 3 years ago #

    it does work in firefox. maybe because I also loaded this script in the header? doesn't work in chrome.

    <script type="text/javascript" src="http://static.ak.connect.facebook.com/connect.php/en_US/js/Api/CanvasUtil/Connect/XFBML"> </script>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic