BuddyBoss Home – Web Support Forums Plugins BuddyBoss Wall Get component type or activity type of photos

Viewing 4 posts - 1 through 4 (of 4 total)
  • Question

    #36062
    @jeremy2k316yahoo

    Im trying to customize the theme of my site and I am using the bp wall plugin and ive had some success, except for when I am customizing the the activity if the content thats being shown is a photo I have no way of detecting if it is a photo or a regular post. I check the component using bp_current_component() to see if it says its a photo and to my surprise its listed as an activity.

    What can I use to filter out if the post being shown is a photo or a regular blog post on my wall? I believe this is more so a buddyboss problem than a buddypress problem seeing how the issue is only with telling the difference between photos and post.

    Thanks

    Answers

    #36098

    Alyssa
    Participant
    @alyssa-buddyboss

    @jeremy2k316yahoo Welcome to the BuddyBoss community! Before I help you further I need more information:
    1) Are you simply styling CSS or trying the eliminate the activity from the wall stream or whatever Bp Wall Plugin is doing
    2) bp_current_component() is used to determine if you are on the group component, activity component, forums, profile, messages etc. NOT the activity type. I think bp_get_activity_type is the function you are looking for.
    3) I’m not sure how bp wall plugin does this but the BuddyBoss Media Plugin uses a separate table for tracking photos that would make it difficult to exclude from activity. What exactly are you trying to do?

    #36182
    @jeremy2k316yahoo

    I was able to write up a function to pull the activity meta from the db by passing the activity id into it the function.

    If you place this function into the functions file

    function activity_meta_info($activity_id){
    	global $wpdb;
    	$meta_info = $wpdb->get_results("SELECT * FROM wp_bp_activity_meta WHERE activity_id='.$activity_id.'");
    	return $meta_info;
    }

    And then call the function into your template and also place the activity id into the function it will return buddyboss_media_aid which is the meta key used for the photos.

    $act_meta = activity_meta_info( bp_get_activity_id());
    
    if($act_meta['1']->meta_key == 'buddyboss_media_aid'){
    echo 'blah here';
    		}else{
    echo 'blah here'
    }

    hopefully this will help someone in the future.

    #36214

    Alyssa
    Participant
    @alyssa-buddyboss

    Glad you were able to resolve this.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The question ‘Get component type or activity type of photos’ is closed to new replies.