BuddyDev

Search

Conflict Between Activity As Wire and BuddyPress Activity Plus

  • Participant
    Level: Enlightened
    Posts: 66
    ljmac on #4375

    Hi Brajesh,

    Strictly speaking I think this is an issue with the way BP Activity Plus works, but their support isn’t very responsive – and the conflict is specific to Activity As Wire anyway – so I was hoping you might be able to suggest a workaround.

    Because of the way Activity Plus substitutes its own posting buttons for the standard “Post Update” button, the @mention from Activity As Wire isn’t passed when posting. Is there a way to hack Activity As Wire so that it works with Activity Plus’ posting buttons? Please note that I’ll need a hack that works with Activity As Wire 1.0 (for compatibility with BP1.8).

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #4402

    Hi Lee,
    It is a difficult one due to complexities involved. I am still looking at it and yes, you are right, the Activity plus completely overwrites any posting functionality.

  • Participant
    Level: Enlightened
    Posts: 66
    ljmac on #4420

    Hi Brajesh,

    Yes, having looked at the code myself I can see it won’t be simple – Activity Plus is a very capable plug-in, but very non-standard. I should have mentioned that if it’s easier for me to hack Activity Plus itself, I’m happy to do that too.

    Whatever the case, I greatly appreciate your help anyway.

  • Participant
    Level: Enlightened
    Posts: 66
    ljmac on #4427

    Hi again Brajesh.

    Here’s some code that will probably help a lot – the BuddyPress Activity Privacy plug-in has a function to work around Activity Plus’ oddities. Here’s the code it uses (I hope back ticks preserve the code):

    
    if( function_exists('bpfb_plugin_init') ) {
    
    	add_action( 'wp_footer', 'bp_activity_privacy_fix_bp_activity_plus' );
    	function bp_activity_privacy_fix_bp_activity_plus() {
    	?>
    	<script type="text/javascript">
    
    	if ( typeof jq == "undefined" )
    		var jq = jQuery;
    
    	jq(document).ready( function() {
    
    		form = jq("#whats-new-form");
    		text = form.find('textarea[name="whats-new"]');
    
    		//remove event handler previously attached to #bpfb_submit
    		jq("#bpfb_submit").die( "click" );
    
    		jq(document).delegate("#bpfb_submit", 'click', function (event) {
    
    			event.preventDefault();
    			var params = _bpfbActiveHandler.get();
    			var group_id = jq('#whats-new-post-in').length ?jq('#whats-new-post-in').val() : 0;
    			
    			jq.post(ajaxurl, {
    				"action": "bpfb_update_activity_contents", 
    				"data": params, 
    				// add visibility level to the ajax post
    				"visibility" : jq("select#activity-privacy").val(),
    				"content": text.val(), 
    				"group_id": group_id
    			}, function (data) {
    				_bpfbActiveHandler.destroy();
    				text.val('');
    				jq('#activity-stream').prepend(data.activity);
    				/**
    				 * Handle image scaling in previews.
    				 */
    				jq(".bpfb_final_link img").each(function () {
    					jq(this).width(jq(this).parents('div').width());
    				});
    
    				//reset the privacy selection
    				jq("select#activity-privacy option[selected]").prop('selected', true).trigger('change');
    
    				jq('select.bp-ap-selectbox').customStyle('2');
    			});
    		});
    	});
    
    	</script>
    	<?php 
    	}
    
    }
    
  • Participant
    Level: Enlightened
    Posts: 66
    ljmac on #4450

    Hi again Brajesh,

    I’ve been giving this some thought, and I think maybe the easiest way to do it would be to leverage BuddyPress Activity Privacy’s Activity Plus integration code to insert Activity As Wire’s posting function. However, the above code is implemented in JavaScript. Can you tell me how I could insert Activity As Wire’s PHP posting function into this?

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #4460

    Hi Lee,
    I will look at this and update you. I am sorry but my hands are full and could not find time to explore the integration.

  • Participant
    Level: Enlightened
    Posts: 66
    ljmac on #4466

    No problem Brajesh – I can see you have a lot on your plate. 🙂

You must be logged in to reply to this topic.

This topic is: not resolved