• 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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    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.

    Thread Starter Taylor Baybutt

    (@taxbax)

    <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.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

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

    Thread Starter Taylor Baybutt

    (@taxbax)

    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="https://static.ak.connect.facebook.com/connect.php/en_US/js/Api/CanvasUtil/Connect/XFBML"> </script>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Simple Facebook Connect] putting the publish to fan page button on the front end’ is closed to new replies.