Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Support: Creating & Extending

Existing and new plugins/components and themes.

External Group Blogs bug (16 posts)

Started 2 years, 2 months ago by: Anton

  • Profile picture of Anton Anton said 2 years, 2 months ago:

    I’m running wp single with bp 1.2.1 and the latest external group blogs plugin (1.2.1)

    At first it fetches the the external rss feed items but after an hour it adds the same items again to the activity stream resulting in a couple of duplicate feed items.

    Where can I add something to check for existing records before they are added to the activity stream? I have tried this with no luck.

    /* Record or update in activity streams. */

    $own=mysql_query(“select * from wp_bp_activity where content=”.$activity_content);

    if(mysql_num_rows($own) == 0)
    {
    groups_record_activity( array(
    ‘id’ => $id,
    ‘user_id’ => false,
    ‘action’ => $activity_action,
    ‘content’ => $activity_content,
    ‘primary_link’ => $item['link'],
    ‘type’ => ‘exb’,
    ‘item_id’ => $group_id,
    ‘secondary_item_id’ => wp_hash( $post['blogurl'] ),
    ‘recorded_time’ => gmdate( “Y-m-d H:i:s”, $post_date ),
    ‘hide_sitewide’ => $hide_sitewide
    ) );
    }

  • Profile picture of rich! @ etiviti rich! @ etiviti said 2 years, 2 months ago:

    i notified Andy of this problem, but here is my fix – needs to hash the post link (but this would leave to problems when removing a feed and the activity not deleting)

    /* Fetch an existing activity_id if one exists. */
    		if ( function_exists( 'bp_activity_get_activity_id' ) )
    			$id = bp_activity_get_activity_id( array( 'user_id' => false, 'component' => $bp->groups->id, 'type' => 'exb', 'item_id' => $group_id, 'secondary_item_id' => wp_hash( $post['link'] ) ) );
    
    		/* Record or update in activity streams. */
    		groups_record_activity( array(
    			'id' => $id,
    			'user_id' => false,
    			'action' => $activity_action,
    			'content' => $activity_content,
    			'primary_link' => $post['link'],
    			'type' => 'exb',
    			'item_id' => $group_id,
    			'secondary_item_id' => wp_hash( $post['link'] ),
    			'recorded_time' => gmdate( "Y-m-d H:i:s", $post_date ),
    			'hide_sitewide' => $hide_sitewide
    		) );
  • Profile picture of Anton Anton said 2 years, 2 months ago:

    by deactivating and activating the plugin removes the duplicates but it will happen again :(

  • Profile picture of Anton Anton said 2 years, 2 months ago:

    Any news on this fix?

  • Profile picture of Robert Robert said 2 years, 2 months ago:

    I have the same problem.

    Is it possible to make external blogs appear in a specific page and hide it from the site wide activity? It could be a great news aggregator if there’s a fix for the duplicates and if the links are configured to open in a new window. I’ve edited the plug-in and used “target=”_blank” but didn’t work.

  • Profile picture of modemlooper modemlooper said 2 years, 2 months ago:

    Andy posted a bit ago he is fixing this plugin this weekend :)

  • I’m using the plugin “wp-external-links-bar” which makes a bar appear for external links but only for posts and pages.

    Inside this plugin I added “http://farmvillechicken?” before

    $items[$key]['blogurl'] = ‘http://farmvillechicken.com?’.$rss->channel['link'];

    and

    ‘ .

    to make that happen.

    I wonder if it is possible to add some kind of filters/plugin settings for this to make it easier to upgrade.

  • I copied and pasted the fix however… see: http://farmvillechicken.com/ on the left you see the entries with minimal 5 duplicate entries.

  • Profile picture of rich! @ etiviti rich! @ etiviti said 2 years, 1 month ago:

    the fix is not retro-active – so you’ll need to delete those out

  • I’ve let it run for a little while and the new key works.

    Thanks Etiviti !!!! (cant give out kudos)

  • Profile picture of abcde666 abcde666 said 1 year, 11 months ago:

    @andy
    Just wondering whether this is really a bug and if so, whether this is fixed in the latest release of the Plugin ?

    Many thanks,
    Erich

  • I dont know for sure but if I go to { group url}/admin/external-blog-feeds without being logged in i can edit the rss feeds.

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 8 months ago:

    nice catch but if andy hasn’t updated this plugin to address the simple dup bug….

    so

    this could either be a class BP_Group_Extension issue or when a plugin extends the class and setting some check

    // Make sure user has access
    			if ( !$bp->is_item_admin )
    				return false;

    so I would crack open the plugin file and add the above code snippet inside the functions create_screen(), edit_screen(),

  • done. Actually the reason why i was looking at the code was to see if I could add a twitter feed e.g. http://search.twitter.com/search.rss?q=wordpress and somehow not have the forum icon showing in the activity feed but the icon of the original author of the “tweets”

    this is in the google:image_link entry so I was thinking if “groups_record_activity” handles something like “avatar” , have to look in to it

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 8 months ago:

    re: activity avatars – wait for 1.2.6 as i believe JJJ added/fixed the ability to change up the avatars via a filter. (just need to store that reference, activity_meta)