BuddyBoss Home – Web › Support Forums › Plugins › BuddyBoss Wall › Get component type or activity type of photos
- This topic has 3 replies, 2 contibutors, and was last updated 9 years, 9 months ago by Alyssa.
Question
February 16, 2015 at 2:47 pm #36062@jeremy2k316yahooIm 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
February 17, 2015 at 2:09 pm #36098@alyssa-buddyboss
AlyssaParticipant@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?February 18, 2015 at 4:45 pm #36182@jeremy2k316yahooI 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.
February 19, 2015 at 5:23 pm #36214@alyssa-buddyboss
AlyssaParticipantGlad you were able to resolve this.
- The question ‘Get component type or activity type of photos’ is closed to new replies.