Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<?php bp_activity_id() ?> in buddypress, anyone up to scratch?

I have been trying to sort this problem out for the last few days, here is an overview of my problem relating to

<?php bp_activity_id() ?>

I have 2 comment forms for a gallery plugin in buddy press, the first appears if there are no comments, and it 'creates' a activity it, the 2nd form appears if a comment has ever been made to and has the <?php bp_activity_id() ?> attached it it.

I would like to know how to automatically create a activity item as the first form cannot use features such as favorite or like as there is no id to associate with. I would like the 2nd form to be filled with an id, or in worst case scenario is it possible for some jquery/javascript to automatically add a comment and remove it ONCE (one time only) so that there is an ID? I can find more info if required, any really appreciate any help given!

like image 586
user1110237 Avatar asked Dec 30 '11 22:12

user1110237


1 Answers

$newActivity = bp_activity_add($args); // you dont NEED args, but you can pass them.
// $newActivity = the new activity's ID.

Source: http://www.buddydex.info/buddypress/bp-activity/bp_activity_add/

like image 163
Applehat Avatar answered Oct 16 '22 08:10

Applehat