Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problems working on a bp-like for comments plugin

  • Avatar of darrenmeehan
    darrenmeehan
    Participant

    @darrenmeehan

    I’m currently customizing the BuudyPress Like plugin to include the “Like” button on comments in the BuddyPress’s activity though I could do with some help.
    to figure out if its a comment or parent activity item we’re dealing with, can you figure out whats wrong with the following code?
    if ( !bp_activity_comment_id() ){` $type = ‘activity’;
    }

    else {
    $type = ‘activity_comment’;
    }`

    Has anyone carried out any work on something similar? I’ve finding it hard completing this, I’ve been reading through a ton of buddyPress code but can’t quite get my head around how to organize this

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of darrenmeehan
    darrenmeehan
    Participant

    @darrenmeehan

    I was able to get this fixed myself. By checking if $bp_like_comment_id was empty using PHP’s empty() function I was able to if it was an activity item or a comment I was dealing with. an example for anyone wondering

    			if ( empty( $bp_like_comment_id ) ) {
    			    echo "this is not a comment";
    				
    			}
    			else {
    			   echo 'this is a comment';
    			}	
    Avatar of darrenmeehan
    darrenmeehan
    Participant

    @darrenmeehan

    I didn’t find anything to easily get the activity type of an item by its ID, does anyone know of any? Maybe I’m missing something.

    Avatar of darrenmeehan
    darrenmeehan
    Participant

    @darrenmeehan

    Found bp_get_activity_type()

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

You must be logged in to reply to this topic.