Search Results for 'custom activity page'
-
Search Results
-
Topic: Newbie questions
Hey guys. I’m building a social media focusing on educational matters but I’m having some problems (as I’m not a dev and have never tried to build anything so complex):
1) How can I change labes like “following”, “followers”, “follow”, “friends”, etc. sitewide?
2) How can I make the BuddyPress Login widget for non-logged users I’m using in redirect to a page other than wp-login? (And the same with the Activity widget for logged users)
3) How can I customize the tabs on the Activity page? (I want to hide some options)
Thank you very much!
(Latest version of WP/BP; non-bundled custom theme, using child theme.)
When adding a custom index & members-loop to /members/ in my child-theme, to make some adjustments to the members directory layout, individual profile pages break completely, I think defaulting to the pages.php but loaded without any content.
childtheme/members/members-loop.php
<?php //global $members_template; //$reset_members_template = $members_template; do_action( 'bp_before_members_loop' ); ?> <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) . '&per_page=21&type=alphabetical' ) ) : ?> <div id="pag-top" class="pagination"> <div class="pag-count" id="member-dir-count-top"><?php bp_members_pagination_count(); ?></div> <div class="pagination-links" id="member-dir-pag-top"><?php bp_members_pagination_links(); ?></div> </div> <?php do_action( 'bp_before_directory_members_list' ); ?> <ul id="members-list" class="item-list" role="main"> <?php while ( bp_members() ) : bp_the_member(); ?> <li> <div class="item-avatar"> <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar('type=full&width=80&height=80'); ?></a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a></div> <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div> <?php do_action( 'bp_directory_members_item' ); ?> </div> <div class="action"> <?php do_action( 'bp_directory_members_actions' ); ?> </div> <div class="clear"></div> </li> <?php endwhile; ?> </ul> <?php do_action( 'bp_after_directory_members_list' ); ?> <?php bp_member_hidden_fields(); ?> <div id="pag-bottom" class="pagination"> <div class="pag-count" id="member-dir-count-bottom"><?php bp_members_pagination_count(); ?></div> <div class="pagination-links" id="member-dir-pag-bottom"><?php bp_members_pagination_links(); ?></div> </div> <?php else: ?> <div id="message" class="info"><p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p></div> <?php endif; //$members_template = $reset_members_template; ?> <?php do_action( 'bp_after_members_loop' ); ?>
childtheme/members/index.php
<?php /** * BuddyPress - Members Directory * * @package BuddyPress * @subpackage bp-default - SSSMG */ get_header( 'buddypress' ); ?> <?php do_action( 'bp_before_directory_members_page' ); ?> <div class="container"> <div class="row"> <div id="primary" class="col-md-10"> <div id="content" role="main" class="<?php do_action( 'content_class' ); ?>"> <div class="padder"> <div class="buddypress"> <?php do_action( 'bp_before_directory_members' ); ?> <form action="" method="post" id="members-directory-form" class="dir-form"> <?php do_action( 'bp_before_directory_members_content' ); ?> <div id="members-dir-search" class="dir-search" role="search"> <?php bp_directory_members_search_form(); ?> </div><!-- #members-dir-search --> <?php do_action( 'bp_before_directory_members_tabs' ); ?> <div class="item-list-tabs" role="navigation"> <ul> <li class="selected" id="members-all"><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members %s', 'buddypress' ), '<span>' . bp_core_get_total_member_count() . '</span>' ); ?></a></li> <?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> <li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/'; ?>"><?php printf( __( 'My Friends %s', 'buddypress' ), '<span>' . bp_get_total_friend_count( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> <?php do_action( 'bp_members_directory_member_types' ); ?> </ul> </div><!-- .item-list-tabs --> <div id="members-dir-list" class="members dir-list"> <?php //bp_get_template_part( 'members/members-loop' ); locate_template( array( 'members/members-loop.php' ), true ); ?> </div><!-- #members-dir-list --> <?php do_action( 'bp_directory_members_content' ); ?> <?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?> <?php do_action( 'bp_after_directory_members_content' ); ?> </form><!-- #members-directory-form --> <?php do_action( 'bp_after_directory_members' ); ?> </div><!-- #buddypress --> </div><!-- .padder --> </div><!-- #content --> </div><!-- primary --> <?php get_sidebar( 'buddypress' ); ?> </div><!-- row --> </div><!-- container --> <?php do_action( 'bp_after_directory_members_page' ); ?> <?php get_footer( 'buddypress' ); ?>
bp-custom.php
<?php // bp-custom.php - BP hacks and mods will go here /** * Include bbPress 'topic' custom post type in WordPress' search results */ function ntwb_bbp_topic_cpt_search( $topic_search ) { $topic_search['exclude_from_search'] = false; return $topic_search; } add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' ); /** * Include bbPress 'forum' custom post type in WordPress' search results */ function ntwb_bbp_forum_cpt_search( $forum_search ) { $forum_search['exclude_from_search'] = false; return $forum_search; } add_filter( 'bbp_register_forum_post_type', 'ntwb_bbp_forum_cpt_search' ); /** * Include bbPress 'reply' custom post type in WordPress' search results */ function ntwb_bbp_reply_cpt_search( $reply_search ) { $reply_search['exclude_from_search'] = false; return $reply_search; } add_filter( 'bbp_register_reply_post_type', 'ntwb_bbp_reply_cpt_search' ); /** * Ensure that multiselect boxes have trailing brackets in their 'id' and 'name' attributes. * * These brackets are required for an array of values to be sent in the POST * request. Previously, bp_get_the_profile_field_input_name() contained the * necessary logic, but since BP 2.0 that logic has been moved into * BP_XProfile_Field_Type_Multiselectbox. Since bp-default does not use the * BP_XProfile_Field_Type classes to build its markup, it did not inherit * the brackets from their new location. Thus this workaround. */ function bp_dtheme_add_brackets_to_multiselectbox_attributes( $name ) { global $field; if ( 'multiselectbox' === $field->type ) { $name .= '[]'; } return $name; } add_filter( 'bp_get_the_profile_field_input_name', 'bp_dtheme_add_brackets_to_multiselectbox_attributes' ); // add the custom column headers to BP manage signups function philopress_modify_user_columns($column_headers) { $column_headers['extended'] = 'Extended'; return $column_headers; } add_action('manage_users_page_bp-signups_columns','philopress_modify_user_columns'); // dump all the pending user's meta data in the custom column function philopress_signup_custom_column( $str, $column_name, $signup_object ) { if ( $column_name == 'extended' ) return print_r( $signup_object->meta, true ); return $str; } add_filter( 'bp_members_signup_custom_column', 'philopress_signup_custom_column', 1, 3 ); //* Redirect WordPress Logout to Home Page add_action('wp_logout',create_function('','wp_redirect(home_url());exit();')); //add @mentions to bbpress forum function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) { if ( function_exists( 'bbpress' ) && is_bbpress() ) { $retval = true; } return $retval; } add_filter( 'bp_activity_maybe_load_mentions_scripts', 'custom_bbpress_maybe_load_mentions_scripts' ); function bphelp_dpioml(){ $bphelp_my_profile_field_1='Profession'; $bphelp_my_profile_field_2='Primary Institution'; if( is_user_logged_in() && bp_is_members_component() ) { ?> <div class="bph_xprofile_fields"> <?php if(bphelp_my_profile_field_1<>"") echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_1 ); ?><br /> <?php if(bphelp_my_profile_field_2<>"") echo bp_member_profile_data( 'field='.$bphelp_my_profile_field_2 ); ?><br /> </div><?php } } add_action('bp_directory_members_item', 'bphelp_dpioml'); ?>
I’ve tried all sorts of different combinations but whatever I do, the only way to get both the profile pages and the members directory to display is to remove the index and members-loop customizations. Then everything works fine, but without the adjustments to the members directory that I want (removing recent updates, for instance). Any pointers would be brilliant!
Topic: Separate activity per post
Hello!
I have searched for such similar solution and tried to figure out how this would be possible, but could not come up with anything usefull.The point is:
1. I have two CPT.
2. Both look like profile page.
3. I want on both of them the default activity form (extended with rtMedia and some geolocation).
4. I want to be able to add with this form activities that will say i.e. “John posted a link in [cpt title].
5. All activities posted to that CPT should be listed under it.What would be the best way to do this? I have thought about filtering activity by some custom variable – ok, I could do this in the activity loop BUT hot to assign the form and make it post/save the activity as an actual activity of given CPT?
Something like comments but preserving activity abilities.I know it may be hard to do or even not possible but any feedback that could even partially help me accomplish this is great!
I’m developing a plugin that adds a custom group home page (
groups/single/front.php
. The page will display the latest activity for each component that as active for the group. In the template, I’m checking withbp_is_active( {component} )
.The problem is that some of the components return false even though they are active, a tab is displayed for them.
Only xprofile, activity, docs and members return true.
global $bp;
returns["loaded_components"]=> ["loaded_components"]=> array(8) { ["forums"]=> string(6) "forums" ["members"]=> string(7) "members" ["profile"]=> string(8) "xprofile" ["activity"]=> string(8) "activity" ["groups"]=> string(6) "groups" ["settings"]=> string(8) "settings" ["events"]=> string(4) "bpeo" ["docs"]=> string(7) "bp_docs" }
["active_components"]=> array(6) { ["xprofile"]=> string(1) "1" ["settings"]=> string(1) "1" ["activity"]=> string(1) "1" ["groups"]=> string(1) "1" ["members"]=> string(1) "1" ["bp_docs"]=> string(1) "1" }
In the template:
<?php if ( bp_is_active( 'xprofile' ) ) : ?> <div class="buddypress-module xprofile intro">Intro</div> <?php endif; ?> <?php if ( bp_is_active( 'activity' ) ) : ?> <div class="buddypress-module activity">Activity</div> <?php endif; ?> <?php if ( bp_is_active( 'forums' ) ) : ?> <div class="buddypress-module forums replies">Replies</div> <div class="buddypress-module forums topics">Topics</div> <?php endif; ?> <?php if ( bp_is_active( 'blogs' ) ) : ?> <div class="buddypress-module blogs">Blogs</div> <?php endif; ?> <?php if ( bp_is_active( 'events' ) ) : ?> <div class="buddypress-module events">Events</div> <?php endif; ?> <?php if ( bp_is_active( 'bp_docs' ) ) : ?> <div class="buddypress-module docs">Docs</div> <?php endif; ?> <?php if ( bp_is_active( 'members' ) ) : ?> <div class="buddypress-module members">Members</div> <?php endif; ?>`
Confirmed with twentysixteen
WordPress 4.6.1
BuddyPress 2.7.2Hi everyone!
We are using on our website Buddypress and want to make more SEO frendly profile urlโs
example.com/{City}/{Instrument}/{Firstname-Lastname}
example.com/{City}/{Style}/{Band-Or-Ensemble name}it posible with standart post types with hierarchical categories, but I didnโt found posibility to add taxonomy to activity and groups.
ust small clarification:
I have urlโs:
example.com/members/{user}
I want them to be more SEO friendly such as:
example.com/{City}/{Instrument}/{Firstname-Lastname}
example.com/{City}/{Style}/{Band-Or-Ensemble name}I have found the way, how to update urlโs structure:
in functions.phpadd_filter( 'bp_get_member_permalink', 'custom_bp_get_member_permalink' ); function custom_bp_get_member_permalink(){ global $members_template; $url = get_site_url(); $city = xprofile_get_field_data('City', $members_template->member->id); $instrument = xprofile_get_field_data('Instrument', $members_template->member->id); $full_name = $members_template->member->fullname; return $url.'/members/'.convert_to_url_ready($city).'/'.convert_to_url_ready($instrument).'/'.convert_to_url_ready($full_name); }
but I need to rewrite urlโs to get userโs pages.
Wating for any ideas. Thanks in advance.Hello
I would exclude automatically, some categories of the blog post, in the activity stream. It’s possible?I saw that the same problem was seen here: https://buddypress.org/support/topic/possible-to-exclude-post-categories-in-activity-stream-and-make-a-user-profile-private-like-with-pri/
But applying the same function with the latest version of BuddyPress, it does not work. is possilibe?
I also tried to customize the Post Types default ‘post’, following this guide: https://codex.buddypress.org/plugindev/post-types-activities/
changing fields as well:
add_post_type_support( 'post', '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( 'post', array( 'component_id' => buddypress()->blogs->id, 'action_id' => 'new_blog_post', // or 'new_post' 'bp_activity_admin_filter' => __( 'Published a new post', 'emt-buddypress' ), 'bp_activity_front_filter' => __( 'Posts', 'emt-buddypress' ), 'contexts' => array( 'activity', 'member' ), 'activity_comment' => true, 'bp_activity_new_post' => __( '%1$s shared a new <a href="%2$s">post</a>', 'emt-textbuddypress' ), 'bp_activity_new_post_ms' => __( '%1$s sahred a new <a href="%2$s">post</a>, on the site %3$s', 'emt-textbuddypress' ), 'position' => 100, ) ); } add_action( 'bp_init', 'customize_page_tracking_args' );
Finally I tried to customize the content of the post, in activity stream, as always suggested in this post:
guide:https://codex.buddypress.org/plugindev/post-types-activities/
or this:
https://buddypress.org/support/topic/custom-activity-new-post-content-not-broken-after-update-the-post/This is my function:
function record_cpt_activity_content( $cpt ) { if ( 'new_post' === $cpt['type'] ) { $cpt['content'] = '<a href="' . get_permalink( $post->ID ) . '" class="activity-content-title" >' $post->ID). '</span><br />' . get_the_post_thumbnail( $post->ID, '') . '<br /> <br />' . get_post_field('post_content', $post->ID); } return $cpt; } add_filter('bp_before_activity_add_parse_args', 'record_cpt_activity_content');
The problem is that the added HTML
<a href="' . get_permalink( $post->ID ) . '" class="activity-content-title" >' $post->ID). '</span><br />
tags are not preserved when the post is published. Solutions?
Thanks for your attention and assistance
I posted up on this a little while ago, and danbp was a boss and helped me out, and I thought I could get it to work, but the end fix ended up unfortunately not really fixing the problem.
I’m having difficulty with a profile tab that is supposed to link to a separate forums profile (wpForo) via a dynamic link that recognizes the displayed user’s page. danbp set me up with something like the below, I changed a bit to make it work better…
function tab_custom_link_to_page() { if ( bp_is_page( 'BP_MEMBERS' ) || bp_is_activity_component() || bp_is_profile_component () || bp_is_groups_component () || bp_is_notifications_component () || bp_is_messages_component () || bp_is_settings_component () || bp_is_following_component () || bp_is_followers_component () ) { $link = bp_get_root_domain() . '/community/profile/'. bp_get_displayed_user_username(); echo '<li><a href="'. $link .'">Community</a></li>'; } } add_action( 'bp_member_options_nav', 'tab_custom_link_to_page', 10 );
but I couldnt change the location of the tab, using code or BuddyBoss Reorder Tabs plugin, which is an issue because the theme I’m using (BuddyBoss Boss.) hides the tabs at the end under a clickable “…”. I spoke to someone at BuddyBoss and they told me I wouldn’t be able to move the tab unless it was registered as a “bp_core_new_nav_item( array(“, which requires an array like:
function add_communityprofile_tab() { global $bp; bp_core_new_nav_item( array( 'name' => 'Community', 'slug' => 'community', 'parent_url' => $bp->displayed_user->domain, 'parent_slug' => $bp->profile->slug, 'position' => 200, 'default_subnav_slug' => 'community' ) ); } add_action( 'bp_setup_nav', 'add_communityprofile_tab', 100 );
which works fine until I have to link it, apparently I can’t use the tab array/slug thing to reach a dynamic link without the same “$bp->displayed_user->domain”. The link I’m trying to reach is currently at:
http://localhost/wordpress/community/profile/*displayeduser*/
from:
http://localhost/wordpress/users/*displayeduser*/
If nobody has any helpful suggestions otherwise, I’m thinking the best route might be to have the page
http://localhost/wordpress/users/*displayeduser*/community/
redirect to
http://localhost/wordpress/community/profile/*displayeduser*/
via a dynamic redirect…I’m trying to figure out how to do that.
If anyone has any helpful advice it would be super appreciated. My boss wants me to take the site live this week and I think I’m just about there…aside from this huge disconnect between the two separate user profiles…not too bad for someone who has barely any idea what they’re doing. but yeah, sorry for the super long post. thanks for reading and hopefully you can throw me a line.
– Andrew
WP ver 4.6.1
BuddyPress ver 2.6.2Members, activity, profile, are all empty…. Register redirects to something that doesn’t exist, despite setting a known page in the dropdown. Attempted to redirect to known page, via bp-custom.php -this moved it to the page, but it rendered entirely blank. Attempted re-install of buddypress – somehow it claims there’s everything deleted but magically retains all settings when installed again – tried several themes, See mention of “bp template pack” plugin in forum that’d reset it all up, but unable to locate it as an installable plugin…
I’m trying to edit BP theme and to figure out which files control what. Would appreciate if someone could go over a couple of basics:
I’m looking in the folder: plugins/buddypress/bp-templates/bp-legacy/buddypress
1) What does the /activity folder control?
2) There’s another instance of activity related file in /members/single/activity.php
what’s the difference?3) What’s the difference between
plugins/buddypress/bp-templates/bp-legacy/ and
plugins/buddypress/bp-templates/bp-themes/4) Which file controls the header? Where the cover photo and avatar image are displayed towards the top.
5) I would like to add a custom BP page/tab. I’ve found instructions to add pages through the function.php file (located in my child-theme), is that the best way?
Hello posting this question again, hopefully all is well and I’m informative as much as I can be.
WP 4.6.1
bbpress 2.5.10
buddypress 2.6.2
rtmedia 4.1.6WP installed as directory in root, no sub-directory
Tested with no plugins other then the ones listed above.
Custom theme SweetDate
No core files changed other than a landing page changed in wp-config.php
which was this:/** * Change BuddyPress default Members landing tab. */ define('BP_DEFAULT_COMPONENT', 'profile' );
I use bluehost version that has an installed WP
I’ve inquired this issue with the SweetDate Theme support forum and they told me to ask
about it here.My site is not live yet.
I hope that these two questions are at the right place.
I just have 2 concerns:
1. When creating a Group there is the option to post texts, pics, etc. If it is a long post and then it is submitted, the post comes with a ‘Read More’. When I click on it it opens up to a new page. From there if I hit the back button the post is gone. If I remove the Read More using:
.activity-read-more { display: none !important; }
then the text field is limited to about 30 words. Is there a way to remove the Read More and just have it as an open regular forum where there isn’t a need to expand or have it go to another page?
I’ve shared images labeled GroupPost 1to42. The other concern I have is in regards to uploading a Cover Photo for the User Group. If I post an intro text and it winds up being lengthy, the text expands the image. That seems odd. Wondered if this is how it is or on my end. Is there a way to have the text separate and not laid out on the Cover Photo? Would rather have the Cover Photo as a stand alone.
I’ve added an image COVER-TEXTThanks.
I realize the photos are a little small.
Hello,
The ultimate goal is to mask the content and selector when a member arrives on the page of a public group to which it has not acceded. In fact he will see just the top of the page, and description button to join group
screenshot:
https://framapic.org/j4FYWFvZmHVI/sOyIzEz0Gl7F.pngThe idea is to reach over activities and other menu group visited oblige to register if he sees that description, avatar and the button to join
I found bp_group_is_member to test ()
http://buddypress.wp-a2z.org/oik_api/bp_group_is_member/
If I do not put any argument, I understand that it will test whether the member is party group (and I add the condition to be displayed in a group?I have an error message:
ยซ Fatal error: Call to undefined function bp_group_is_member() in /var/www/../wp-content/plugins/bp-custom.php on line 3 ยปWhat I found to achieve the goal:
if ( !bp_group_is_member() || bp_is_active('groups') ) {add_filter( 'bp_after_has_activities_parse_args', 'my_bp_activity_types_non-membre' );} function my_bp_activity_types_non-membre( $retval ) { $retval['action'] = array( //'activity_comment', //'activity_update', //'created_group', //'friendship_created', nouv relation entre membre //'joined_group', //'last_activity', //'new_avatar', //'new_blog_comment', //'new_blog_post', //'new_member', //'updated_profile', //'rtmedia_update' ); return $retval;
Regards
Hi,
I am using WP 4.6.1 in a network site, directory install using a Divi child theme. I have BuddyPress 2.6.2 with BuddyBlock, BuddyPress Cover Photo, BuddyPress Group Email Subscription and BuddyPress Group Tags. No bbPress.
I would like to make all posts and comments in a group visible to anyone who joins the group. At the moment group members can only see the posts and comments of their friends.
This implies that if a new member wants to see all the activity in a group, they have to send friend requests to everyone in the group.
I believe this should be done in bp-custom.php with code something like the following. I don’t know if I should be using the ‘has_groups’ or ‘has_activites’ loop or some other loop. I confirmed that bp_is_group_single does target the page in question because I could change the per_page entries successfully.
Thanks for any suggestions,
David Tuttle