Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I get the activity id, if somebody posts

  • We are facing some technical issue with adding categories to activity in BuddyPress. In this project we are also using a plugin ‘BuddyPress Activity Plus’.

    The idea was to create and maintain two separate tables (activity_category, activity_category_relation); activity_category is for holding category data and activity_category_relation will hold their relationship.

    Problem

    The problem is when somebody posts an update in the activity; we need to retrieve the particular activity id.

    When I checked codes of ‘BuddyPress’ plugin and ‘BuddyPress Activity Plus’ plugin, ‘BuddyPress Activity Plus’ plugin jquery ajax functions to post activity updates, so it seems hard to retrieve the activity post id that we are using to relate with the category id.

    Please explain if I miss anything/ did anything wrong. I’m new to BuddyPress. :)

Viewing 4 replies - 1 through 4 (of 4 total)

  • shanebp
    Moderator

    @shanebp

    I think you want $aid out of function ajax_update_activity_contents in class_bpfb_binder.php in Activity Plus

    Hi shanebp,

    Thanks for your reply :)

    Yes I know its the $aid in activity plus, is there any way to get the activity id if somebody posts an activity? the activity plus only works when if somebody post with using its functionality(sharing photos, links and videos) for a normal posting stuff buddypress default function is working. So I need to get the activity id in both cases.

    (The whole thing I’m using for categorizing the activity. Please tell me if any plugin is available for this.)

    Thanks.


    shanebp
    Moderator

    @shanebp

    In bp-activity-functions.php
    there is
    function bp_activity_post_update
    which has
    ` do_action( ‘bp_activity_posted_update’, $content, $user_id, $activity_id );`

    I would use add_action in bp-custom to run a function that takes the $activity_id and does whatever you need.

    Ditto for
    do_action( ‘bp_groups_posted_update’, $content, $user_id, $group_id, $activity_id );
    in
    bp-groups.php

    Hi shanebp,

    Thanks for the tip. I will try that :)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I get the activity id, if somebody posts’ is closed to new replies.
Skip to toolbar