Group Mods

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

Demo Data Plugin with BuddyPress 1.2 (7 posts)

Started 2 years, 2 months ago by: Chris Taylor

  • Profile picture of Chris Taylor Chris Taylor said 2 years, 2 months ago:

    Hi everyone,

    I have a problem with my Demo Data Plugin (http://wordpress.org/extend/plugins/demo-data-creator/) in Buddypress 1.2. The functions that add dummy wire messages no longer work, and looking for the string “wire” in the BP source gives very few results. I guess it’s all rolled into the activity system now, yes?

    So my question is: can I use thebp_activity_add function to add wire messages to groups and profiles? The defaults for this function are:

    $defaults = array(
    		'id' => false, // Pass an existing activity ID to update an existing entry.
    
    		'action' => '', // The activity action - e.g. "Jon Doe posted an update"
    		'content' => '', // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!"
    
    		'component' => false, // The name/ID of the component e.g. groups, profile, mycomponent
    		'type' => false, // The activity type e.g. activity_update, profile_updated
    		'primary_link' => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink)
    
    		'user_id' => $bp->loggedin_user->id, // Optional: The user to record the activity for, can be false if this activity is not for a user.
    		'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id
    		'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id
    		'recorded_time' => gmdate( "Y-m-d H:i:s" ), // The GMT time that this activity was recorded
    		'hide_sitewide' => false // Should this be hidden on the sitewide activity stream?
    	);

    So to add a dummy wire message to a group I’d use:

    bp_activity_add( array(
    "action"=>"Posted a Wire message",
    "content"=>"Lorem ipsum...",
    "type"=>"groups",
    "item_id"=>[ the group ID ]
    );

    If anyone uses this plugin and can help with any other bugs I’d be very grateful.

  • Profile picture of Mike Pratt Mike Pratt said 2 years, 2 months ago:

    I do not use the plugin but you should know that the wire no longer exists in 1.2. It has been rolled into Status Updates

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

    Chris – your latest update says compatible with standard wordpress but I have Wordpress 2.9.2 and BP 1.2.3 and can’t find your plugin settings screen in my dashboard after activating. Can you tell me where to look?

  • Profile picture of Andy Peatling Andy Peatling said 2 years, 2 months ago:

    $activity_id = bp_activity_post_update( array( ‘content’ => $content, ‘user_id’ => $user_id ) );
    $activity_id = groups_post_update( array( ‘content’ => $content, ‘user_id’ => $user_id, ‘group_id’ => $group_id ) );

    The functions above will post an update by the user on their profile, or in a group. It will return the activity ID which you can use to attach a comment:

    $comment_id = bp_activity_new_comment( array( ‘activity_id’ => $activity_id, ‘content’ => $content, ‘user_id’ => $user_id, ‘parent_id’ => [optional] ) );

    You could post a reply to that comment by using the same function and passing the $comment_id as the parent_id param.

  • Profile picture of Tom Longmate Tom Longmate said 2 years ago:

    @chembro303 – I have the same issue, did you manage to find the form screen anywhere in regular Wordpress?

  • Profile picture of Chris Taylor Chris Taylor said 2 years ago:

    Thanks Andy, I’ll try to use that syntax in the plugin.

    @chembro303 and @amigolargo: The Demo Data menu item is under “Tools” in standard Wordpress. Let me know if you still have problems (I keep a closer eye on the WP forums, but I’ll try to remember to check here as well).

  • Profile picture of syedmasudulhasib syedmasudulhasib said 1 year, 3 months ago:

    This is smh reply