Search Results for 'custom activity page'
-
AuthorSearch Results
-
May 26, 2015 at 7:52 am #239695
In reply to: Custom Post activity_action output wonky
majecdad
ParticipantFirst, @henrywright, I think you were right, that code was not creating the entry, it was created because I had
add_post_type_support( 'alert', 'buddypress-activity' );in bp-custom too. Thanks for making me think twice.It’s amazing what you can learn in 12 hours. Not enough, but it’s a start. So I tossed the baby out with the bathwater, and read this about 15 times to get to a partial understanding of it. I am now using this:
// Don't forget to add the 'buddypress-activity' support! add_post_type_support( 'alert', 'buddypress-activity' ); function customize_page_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'alert', array( /*'component_id' => buddypress()->blogs->id,*/ 'action_id' => 'new_alert', 'bp_activity_admin_filter' => __( 'Published a new alert', 'buddypress' ), 'bp_activity_front_filter' => __( 'Alerts', 'buddypress' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted an important new <a href="%2$s">** Alert **</a>', 'buddypress' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">alert</a>, on the site %3$s', 'buddypress' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_page_tracking_args' );After about 20 different mods, adding and deleting and changing, I got a CPT to take to the activity stream, with the (mostly) modified text I was looking for.
I actually don’t even know what some of the items in the array are, I just changed things until they worked. ๐ In fact, I had to comment out component id, because I still haven’t figured out what goes there to keep from getting a WSOD.
The only main thing I’d really still like to accomplish is getting the Post Title in the link that is created here:
'%1$s posted an important new <a href="%2$s">** Alert **</a>'— where it would be like “soandso posted an important new Alert:The Title of the CPT”Any ideas out there?
If this is still not the right/best way to accomplish this, I’m open to suggestion. But I think I am at least stepping in the right direction.
Thanks.
May 19, 2015 at 5:07 pm #239409In reply to: Change "activity" slug
danbp
Participant3 mounth later….
just tested the defines and they’re working ! You have a cote error in above code. ๐Try this:
define( 'BP_ACTIVITY_SLUG', 'activitissima' );Remind also that BP’s activity page, defined in BP settings, must be empty, without shortcodes, template or page model. Just a title. These pages are dynamic, not static like normal WP pages.
If you need to modifiy it, use a template override.If you still want to understand, please read here:
https://buddypress.org/support/topic/changing-slugs-with-bp-custom-php-no-change/May 19, 2015 at 12:44 pm #239405In reply to: Change "activity" slug
milenushka
Participantthis one is still uresolved.
@danbp (https://buddypress.org/support/topic/custom-activity-slug/)
custom slug change for ACTIVITY does not work for me.To change slugs on the sub nav on a member page add these defines to a file bp-custom.php and place this file in /plugins/bp-custom.php
?
1
2
define( ‘BP_SETTINGS_SLUG’, ‘settings’ );
define( ‘BP_XPROFILE_SLUG’, ‘profile’ );May 15, 2015 at 4:03 pm #239126In reply to: Error When Adding Custom Post Type to Activity Feed
producist
ParticipantI just tried adding the snippets and again and that problem isn’t happening anymore. However, the filter functionality isn’t working…
See Screenshot —
http://postimg.org/image/5ulodg0wz/
Here’s the code I used….
<?php // hacks and mods will go here ok // Don't forget to add the 'buddypress-activity' support! add_post_type_support( 'page', 'buddypress-activity' ); function customize_page_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'page', array( 'component_id' => buddypress()->blogs->id, 'action_id' => 'new_blog_page', 'bp_activity_admin_filter' => __( 'Published a new page', 'custom-domain' ), 'bp_activity_front_filter' => __( 'Pages', 'custom-domain' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">page</a>', 'custom-textdomain' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">page</a>, on the site %3$s', 'custom-textdomain' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_page_tracking_args' ); ?>Is there anything I need to add or change in the above code in order to make PAGES show in the filter area?
May 13, 2015 at 4:28 pm #239042In reply to: Remove friend notifications for all activity page
shanebp
ModeratorYou can place this in your theme/functions.php or in bp-custom.php.
It will stop recording entries for 3 types after you include the function.
You can add othertypesas desired to the$excludearray.function steve_dont_save_activity( $activity_object ) { $exclude = array( 'new_avatar', 'updated_profile', 'friendship_created' ); if( in_array( $activity_object->type, $exclude ) ) $activity_object->type = false; } add_action('bp_activity_before_save', 'steve_dont_save_activity', 1, 1 );To delete existing entries, use the interface here
[yoursite]/wp-admin/admin.php?page=bp-activityMay 12, 2015 at 6:50 pm #238987In reply to: Error When Adding Custom Post Type to Activity Feed
producist
ParticipantI also saw this about multisite installs in the thread you posted:
“On multisite configurations, the post types that are registered on any sub-site will need to be registered on the root site in order to be listed in the Activity dropdown filters. Thatโs the case for the post and page post types”
The site I’m trying to create a custom post type for is a subsite. I assume the Page Post Type is registered for the root install, so this shouldn’t be causing the problem right?
April 24, 2015 at 9:21 pm #238324In reply to: Avatar does not show outside BuddyPress
danbp
ParticipantPrevious snippet changed all avatars (user, blogs and groups) which is not what you want. Here’s a snippet which works almost correctly, but not to 100%. Give it a try anyway.
It changes the user avatar depending of an xprofile value.
(add to bp-custom.php)
function bpfr_my_new_avatar_url() { global $bp; if( bp_is_user() && ! bp_get_member_user_id() ) { $user_id = bp_displayed_user_id(); } else { $user_id = bp_get_member_user_id(); } if ( is_page( 'activity' ) ) { $user_id = bp_get_activity_user_id(); } $ranking = xprofile_get_field_data ('ranking', $user_id ); if ($ranking == "Top 25") { $url = get_stylesheet_directory_uri() .'/custom_img/25.png'; } if ($ranking == "Top 24") { $url = get_stylesheet_directory_uri() .'/custom_img/24.png'; } return $url; } add_filter( 'bp_core_default_avatar_user', 'bpfr_my_new_avatar_url' );Create a profile field called “ranking” with 2 options (top 24 & top 25).
Create a folder in your child-theme called “custom_img” and add 2 pictures: 24.png & 25.png (250×250)
If everybody must those avatars, disallow avatar upload in BP settings.
Site default avatar stays as Mystery Man (wp default setting).You have also to get rid of Gravatar, so you must add this to bp-custom.php
add_filter('bp_core_fetch_avatar_no_grav', '__return_true');The thing who doesn’t work is related to
X & Y are now friends. Both willhave the same avatar.Can probably by better improved.
danbp
ParticipantHi,
to show only notices (aka updates) on the SWA, try this snippet (place in bp-custom.php)
function make_swa_show_notice_only( $retval ) { if ( bp_is_page( 'activity' ) ) { $retval['action'] = 'activity_update'; } return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );Reference: https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/
April 14, 2015 at 4:47 pm #237873In reply to: [Resolved] Activity stream – show personal activity
shanebp
ModeratorYou want to add a ‘Personal’ option to the ‘Show’ selector on Site Wide Activity?
Try this in your theme/functions.php or in bp-custom.php
function leanne_activity_filter_options() { if ( is_user_logged_in() ) echo '<option value="personal">Personal</option>'; } add_action( 'bp_activity_filter_options', 'leanne_activity_filter_options' ); function leanne_ajax_querystring( $query_string, $object ) { if ( 'activity' != $object ) return $query_string; if ( ! bp_is_activity_directory() ) return $query_string; $query_args = wp_parse_args( $query_string, array() ); $page = $query_args['page']; if( isset( $query_args['action'] ) && $query_args['action'] == 'personal' ) { $query_args = array(); $query_args['page'] = $page; $query_args['user_id'] = bp_loggedin_user_id(); $query_string = http_build_query( $query_args ); } return $query_string; } add_filter( 'bp_ajax_querystring', 'leanne_ajax_querystring', 20, 2 );April 11, 2015 at 11:32 pm #237717Garydock
ParticipantI’m not sure if this is valuable information. I’ve used firebug to try and locate a file where I can remove this or something and this is all I can see but I don’t know if its related. I just want to remove this warning whatever way possible, everything else seems to all be working ok. activity bp-user my-activity my-account just-me buddypress page page-id-0 page-parent page-template-default logged-in custom-background js woocommerce.
April 11, 2015 at 7:21 pm #237701In reply to: Custom Post Type Support for Activity
aaronkine
ParticipantYes… the post type is registered by another plugin “Wp Job Manager”. I am new at coding so if i find a script and it actually works “i use it” even though there may be a more correct way.
I also have another plugin “The Events Calendar” that has post type of ‘tribe_events’ and i am trying to do the same thing as the Job post type.
I also don’t understand the difference between using “text-domain” and “custom-domain” for the bp_activity_admin_filter ?
I used info from this Topic/Discussion here: https://buddypress.org/support/topic/cant-seem-to-get-bp-2-2s-post-types-activities-working/
Here is my full code in bp-custom for Jobs and Events post types…
//The 'WP Job Manager' post type add_post_type_support( 'job_listing', 'buddypress-activity' ); function customize_page_tracking_args_job() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'job_listing', array( 'component_id' => 'activity', 'action_id' => 'new_job_listing', 'bp_activity_admin_filter' => __( 'Published a new Job', 'text-domain' ), 'bp_activity_front_filter' => __( 'Job', 'text-domain' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new Job: <a href="%2$s">Job</a>', 'text-domain' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new Job: <a href="%2$s">Job</a>, on the site %3$s', 'text-domain' ), 'position' => 100, ) ); } //'The Calednar Events' post type add_action( 'init', 'customize_page_tracking_args_job', 999 ); add_post_type_support( 'tribe_events', 'buddypress-activity' ); function customize_page_tracking_args_event() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'tribe_events', array( 'component_id' => 'activity', 'action_id' => 'new_tribe_events', 'bp_activity_admin_filter' => __( 'Published a new Event', 'text-domain' ), 'bp_activity_front_filter' => __( 'Event', 'custom-domain' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted an Event: <a href="%2$s">Event</a>', 'custom-domain' ), 'bp_activity_new_post_ms' => __( '%1$s posted an Event: <a href="%2$s">Event</a>, on the site %3$s', 'custom-domain' ), 'position' => 100, ) ); } add_action( 'init', 'customize_page_tracking_args_event', 999 );April 10, 2015 at 4:24 pm #237624In reply to: Custom Post Type Support for Activity
aaronkine
Participant@imath thanks for the above code which “adds the post type title into the link in replacement”
But i need to change one small thing in that code but i dont know how.
Here is my code in bp-custom.php —
add_post_type_support( 'job_listing', 'buddypress-activity' ); function customize_page_tracking_args_job() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'job_listing', array( 'component_id' => 'activity', 'action_id' => 'new_job_listing', 'bp_activity_admin_filter' => __( 'Published a new Job', 'text-domain' ), 'bp_activity_front_filter' => __( 'Job', 'text-domain' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new Job: <a href="%2$s">Job</a>', 'text-domain' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new Job: <a href="%2$s">Job</a>, on the site %3$s', 'text-domain' ), 'position' => 100, ) ); } add_action( 'init', 'customize_page_tracking_args_job', 999 );Here is the result…
PathPoint-SSB posted a new Job: Job 5 hours, 53 minutes agoHere is what it looks like after I use your code to insert the Title of the Job
pathpoint posted a new Receptionist/Administrative Assistant 5 hours, 49 minutes agoAs you can see, it changes the Users name and also I cant change this part “posted a new”. I would like it to read “posted a new Job: ”
Any ideas?
Thanks for any insight on this,
AaronApril 8, 2015 at 8:52 am #237459In reply to: link to user's profile (non-template)
danbp
ParticipantHi @andrew55,
add this snippet to bp-custom.php. Now you can use shortcode [profilo] in any blog post, blog comment, page and BP notice. Note that activity walls are stripped, the shortcode will not work/appear there.For bbPress topics and replies, use this plugin. Read the doc, as you’ll have to check user capacity to get it to work for participant.
function bpfr_link_to_profile() { return ' <a href="'. bp_get_loggedin_user_link() .'">View my profile</a>'; } add_shortcode( 'profilo', 'bpfr_link_to_profile' ); add_filter( 'comment_text', 'do_shortcode' );April 7, 2015 at 10:07 am #237370In reply to: Customizing Buddypress Activity Wall
Roger Coathup
ParticipantChanging these titles isn’t the easiest thing, but BuddyPress does provide 2 ways you can do it. However, hacking core files like bp-activity-loader.php is definitely not one of them. [Never hack core files — have a Google if it’s not obvious to you why you shouldn’t]
Ok the 2 solutions are:
- Use a language / translation file
- Use the template hierarchy
The string “Site-Wide Activity” is translatable — all the strings are. You can implement a language file that translates ‘Site-Wide Activity’ into whatever string you’d like. Have a search for translating BuddyPress strings / POT files / poedit. There’s also a documentation (they call it the Codex) page on it: https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/
The second solution is to use the template hierarchy. If you don’t provide a specific template for your activity directory, BuddyPress will use the page.php file from your theme and ‘inject’ the title “Site-Wide Activity” where page.php makes a call to the_title().
You can override this by implementing your own template — create a file called index-directory.php inside /buddypress/activity in your site’s theme. Copy the basics of page.php into that file, and replace the_title() with your hardcoded title for the page.
You can read more about the template hierarchy here: https://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/
Neither solution is simple, you’ll either have to get your head around using poedit, or need some basic PHP coding skills and an understanding of the principles of templates and themes in WordPress. In the future, it would be nice to see a settings panel in wp-admin to configure these basic strings.
[p.s. if you don’t want to use poedit, you could take a look at plugin solutions for string translation, e.g. codestyling localisation]
March 31, 2015 at 5:23 pm #237066In reply to: Activity page template?
IHaveToDoThis
ParticipantHey,
I’m a newcomer to all of this and I can’t answer your overall question, but I can tell you how to change the name “Site-Wide Activity” on the activity page. You go to: wp-content>plugins>buddypress>bp-activity/bp-activity-loader.php and the title is towards the top the in $GLOBAL array. And you can change it from “Site-Wide Activity” to whatever you want.
I’ll be following this tho. I’ve been looking for way to customize my BP wall and make it look not so bland. I hope someone else can help you further!
March 23, 2015 at 11:40 pm #236465In reply to: Comments not showing up on activity stream
danbp
Participanthi @mjc82in,
BuddyPress is continuously evolving. 2 years back it was a mess trying to use CPT on SWA. That’s no more the case with BP 2.2
Maybe this example will help you. It creates a CPT called Music which will show up on the SWA where you can comment it.
Add the code to bp-custom.php
// allow tracking of our CPT add_post_type_support( 'music', 'buddypress-activity' ); function customize_page_tracking_args() { // Check if the Activity component is active before using it. if ( ! bp_is_active( 'activity' ) ) { return; } bp_activity_set_post_type_tracking_args( 'music', array( 'component_id' => 'activity', 'action_id' => 'new_music', 'bp_activity_admin_filter' => __( 'Published a new music', 'text-domain' ), 'bp_activity_front_filter' => __( 'Music', 'text-domain' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s posted a new <a href="%2$s">Music</a>', 'text-domain' ), 'bp_activity_new_post_ms' => __( '%1$s posted a new <a href="%2$s">Music</a>, on the site %3$s', 'text-domain' ), 'position' => 800, ) ); } add_action( 'init', 'customize_page_tracking_args', 999 ); function bpfr_create_post_type() { register_post_type( 'music', array( 'labels' => array( 'name' => __( 'Music', 'text-domain' ), 'singular_name' => __( 'Music', 'text-domain' ) ), 'public' => true, 'has_archive' => true, ) ); } add_action( 'init', 'bpfr_create_post_type' );Ref: https://codex.buddypress.org/plugindev/post-types-activities/
March 23, 2015 at 5:25 pm #236437In reply to: Comments not showing up on activity stream
Manoj Chacko
ParticipantDid do that,
I also enabled below for pages, but pages dont show up.
// Add custom post type to activity record
add_filter ( ‘bp_blogs_record_post_post_types’, ‘activity_publish_custom_post_types’,1,1 );
// Add custom post type comments to activity record
add_filter ( ‘bp_blogs_record_comment_post_types’, ‘activity_publish_custom_post_types’,1,1 );function activity_publish_custom_post_types( $post_types ) {
// add any custom post-type here
$post_types[] = ‘page’;
return $post_types;
}March 23, 2015 at 7:29 am #236414In reply to: Customizing Buddypress Activity Wall
IHaveToDoThis
ParticipantHey Everyone,
I still haven’t found out how to save edits in chrome inspector or how to customize my wall more…BUT I did find out how to do what was most important to me, which is change the text ‘Site-Wide Activity’ on the activity stream page. I found the solution here on a forum through a google search. Unfortunately I was on a work computer and left before copying the link and now of course I can’t find that forum anymore. Thank god I wrote it down!
Anywho, you find it in: wp-content>plugins>buddypress>bp-activity/bp-activity-loader.php and its toward the top the in $GLOBAL array.
Thanks to the stranger who found this!
And any help on how to design or what files to mess with to play the design of the activity stream is greatly appreciated!
March 15, 2015 at 3:40 pm #236042rosyteddy
Participantworks the same way for me โ you only get about 4 lines of the comment in the AS. I think only for Activity Updates there is a โMoreโ link.
True – I missed that. Long comments are truncated with […] at the end and that does not link to the original comment. W.r.t usability that is a critical bug for me. Thanks
activity entry for that comment does link directly to the post comment using the page anchor
It does not – default install of WP,BP latest versions, default theme – it does not for me. Any demo link with latest WP and BP that does this? Thanks
WAIT : […] does not link to, there is no ‘more’ link that does this BUT the time stamp does this. So I think UI and Userfriendiless tea should link […] to the same link as the time-stamp. Most users are accustomed with ‘more’ or ‘…’ – they won’t know they have to click time-stamp. Please submit an enhancement request. Thanks
March 14, 2015 at 7:55 pm #236020In reply to: Hiding stuff from the Activity stream
danbp
ParticipantRecently introduced function
bp_parse_argsallows since 2.0 to modify easely your templates. Faster and lighter than a plugin.As example, show only updates on the SWA (add snippet to bp-custom.php or child-theme functions.php)
function make_swa_show_notice_only( $retval ) { if ( bp_is_page( 'activity' ) ) { $retval['action'] = 'activity_update'; } return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );March 14, 2015 at 12:21 pm #236006In reply to: Change Group Member Slug
MonkimoE
ParticipantHi.. thank you to keep guiding me.
I don’t know why those code for single groups page doesn’t working in my site.Then I tried to modify nav tab in single members page those can working good.
This what I have in bp-custom.php:<?php function edit_tabs_options() { global $bp; // MODIFY GROUP TABS $bp->bp_options_nav['groups']['home']['name'] = 'Group Activity'; //NOT WORK $bp->bp_nav['groups']['home']['name'] = 'Member Activity 2'; //NOT WORK //MODIFY MEMBERS TABS $bp->bp_nav['home']['name'] = 'Member Activity'; //IT'S WORK bp_core_remove_nav_item( 'forums' ); //IT'S WORK bp_core_remove_subnav_item( 'profile', 'change-avatar' ); //IT'S WORK } add_action( 'bp_setup_nav', 'edit_tabs_options' ); ?>Last try on fresh install wp + bp with default theme. I will let you know if those code works or not.
March 12, 2015 at 11:50 pm #235917danbp
ParticipantBoth snippets are working. If really not for you, double-check that bp-custom.php is correctly using open/close php tags and if your theme doesn’t use some custom rss functions.
To remove the All members button :
remove line 19 in buddypress/activity/index.php from within your child theme.<li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php esc_attr_e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>and add
class='selected'to thelicontaining friends itemIf you remove the feeds display using the snippet, people won’t see anything even if they know the page url. And if this is not satisfying for you, you can write a rewrite rule to add to htaccess.
March 12, 2015 at 10:53 pm #235911danbp
ParticipantTry this to remove ALL activity feeds
function bpfr_hide_rss_feeds() { remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); remove_action( 'bp_actions', 'bp_activity_action_personal_feed' ); remove_action( 'bp_actions', 'bp_activity_action_friends_feed' ); remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); remove_action( 'bp_actions', 'bp_activity_action_favorites_feed' ); remove_action( 'groups_action_group_feed', 'groups_action_group_feed' ); } add_action('init', 'bpfr_hide_rss_feeds');This snippet will only show logged in users friends activities (on all activity pages of the site)
function bpfr_filtering_activity( $retval ) { $retval['scope'] = 'friends'; return $retval; } add_filter( 'bp_after_has_activities_parse_args', 'bpfr_filtering_activity' );Add to bp-custom.php or child-theme functions.php
More details about this on Codex
March 12, 2015 at 2:59 pm #235875In reply to: display only one group activity stream on homepage.
rosyteddy
Participant@martni You can get some ideas here:
https://premium.wpmudev.org/forums/topic/adding-a-single-group-activity-stream-to-bp-social-home-page
https://buddypress.org/support/topic/resolved-filter-custom-activity-stream-to-display-only-new-groups-new-topics-new-replies/Another way may be, making the other groups private, if that suits you / your site at all.
Thanks
March 6, 2015 at 11:43 am #235536In reply to: Member Count
rosyteddy
ParticipantHi you may check these threads – not sure if they can help you but you may consider to have a look. Have you any custom code and/or various plugins? Thanks.
https://buddypress.org/support/topic/member-counter-on-activity-page-not-working/
https://buddypress.trac.wordpress.org/ticket/5228
https://buddypress.trac.wordpress.org/ticket/4061 -
AuthorSearch Results