Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to add Google +1 to the Activity Stream


  • gregfielding
    Participant

    @gregfielding

    There are a bunch of new +1 plugins out there, but I can’t find any yet to add the box to an activity stream entry. I’ve been hacking around with the google code and can’t seem to get it right.

    Anyone played around with this yet?

Viewing 1 replies (of 1 total)

  • nicholmikey
    Participant

    @nicholmikey

    To add to the activity stream you call
    `
    bp_activity_add(array(
    ‘action’ => ‘I did something awesome’,
    ‘content’ => ‘more content heret’,
    ‘component’ => ‘your component’,
    ‘type’ => ‘activity_thing’
    ));`

    If you are calling this from a plug-in, the function that contains this call needs to be hooked into bp_init

    Here is a full description of your options from bp-activity.php
    `
    $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’ => bp_core_current_time(), // The GMT time that this activity was recorded
    ‘hide_sitewide’ => false // Should this be hidden on the sitewide activity stream?
    );`

Viewing 1 replies (of 1 total)
  • The topic ‘How to add Google +1 to the Activity Stream’ is closed to new replies.
Skip to toolbar