Forum Replies Created
-
Ok, thanks for your help today, it was much appreciated. And yes, I kicked myself. 🙂
Inside includes/members/functions.php there’s this function:
bp_nouveau_get_members_directory_nav_items()
I replaced bp_get_total_member_count with bp_core_get_active_member_count() as you stated above and I got the Total Members count.
The bp_core_get_active_member_count() in that function was only returning one member for some reason.
I was wondering, if it’s a bug fix would it be done in the next update?
If not then I know I would have to add a filter to bp_nouveau_get_members_directory_nav_items
to avoid having to have to make that change every time an update is issued.That worked, thanks. Will it be a fix in an update? We know what happens to altered core files on updates :).
Everything is fine inside includes/members/functions.php it’s calling bp_get_total_member_count().
I’ve used bp_get_total_member_count() elsewhere in my theme to see if it would return the members count and it works. For some reason it just doesn’t work with the Nouveau template.No, the 1-20 of 200 members is perfect, My Friends “Number” is fine. The one and only problem is the (All Members ‘#’) Count number.
All Members are shown with the Legacy Template and that’s what I can’t figure out. It is my opinion it should show the same number.I’m aware (
<?php bp_nouveau_pagination( 'top' ); ?>
) but that’s a template tag, the real magic is taking place in common->nav->directory-nav<a href="<?php bp_nouveau_nav_link(); ?>"> <?php bp_nouveau_nav_link_text(); ?> <?php if ( bp_nouveau_nav_has_count() ) : ?> <span class="count"> <?php bp_nouveau_nav_count(); ?> </span> <?php endif; ?> </a>
the problem is this calls all the different counts on every single nav.
I’ve also checked out bp-templates->bp-nouveau->includes->members->fuctions.php all seems well.
It’s a brain buster because as I said, everythings works fine with the Legacy template.
Don’t know what it can be. Database maybe refusing to play nice with Nouveau :(. I’m going to kick
myself if the solution is a simple one hiding in my face.Yes, I’ve tried deactivating all plugins, deleted
everything in bp_customs, and tried with a WP default theme. Nothing worked. I’ve tried adding a test user and the (All Members (count)) is still and one. I’m guessing that one is for admin. The weird thing is the count is fine in BP Legacy 3.1.0. all users in question are already, verified logged in, so, active users. The friends count works fine. bp_get_total_member_count works when placed in a custom function in functions.php. Scratching my head on this one.@shanebp and @hnla Can you please remove my site URL from this code snippet and from the other URL below? I’m sorry to ask but the snippets
seems to be added in Bing and Google searches. Thanks in advance.https://buddypress.org/support/topic/showing-wordpress-posts-on-buddypress-activity/
Also I submitted a ticket earlier today making the request can you check if it’s in moderation and cancel it? It’s not showing in my Topics Started Page. Thanks again in advance and sorry for the trouble.
Thanks for your prompt response and your help but that function did not achieve the goal I was looking for. I wanted the activation Key to come from Cymi User Extra Field. I found a solution from someone with a similar problem but it is a little too extreme for me. The result you get is a Cymi User Extra Field Key/URL, Looks like This(cimy_key=88fddcb568dcf2d6). It involved editing a core Buddypress file wp-content/plugins/buddypress/bp-core/bp-core-filters.php. Can you help with a function for my functions.php or bp-custom to achieve the same goal. If it’s not too much maybe generate the Cymi-Key in the Buddypress Email Template though not a priority. I’m fully aware that editing core files is not practical, especially being that you lose it during updates.
https://buddypress.org/support/topic/activation-email-key-doesnt-work-i-may-have-the-fix/
function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { $activate_url = bp_get_activation_page() . "key=$key"; $activate_url = esc_url($activate_url); $admin_email = get_site_option( 'admin_email' ); if ( empty( $admin_email ) ) $admin_email = 'support@' . $_SERVER; // Then it ends with, on line 255 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
Thanks a million danbp, it all worked out as you stated. You were quite thorough with your explanation…
Much appreciated.
I figured out the solution. I had to call
add_filter( ‘wp_mail_content_type’, ‘notification_content_type’ );
in each individual email function:
add_filter( 'wp_mail', 'dirty_wp_mail_filter' ); function dirty_wp_mail_filter( $args ) { // you can include your custom html mail template here // just use file_get_contents() functions to get template file and any php replace function like // str_ireplace or preg_replace to replace your given placeholder in template by the content which is sent by wp $stripped_mail_content = preg_replace("/<http(.*)>/m", "http$1", $args['message']); add_filter( 'wp_mail_content_type', 'dirty_notification_content_type' ); $dirty_wp_mail = array( 'to' => $args['to'], 'subject' => $args['subject'], 'message' => $stripped_mail_content, 'headers' => $args['headers'], 'attachments' => $args['attachments'] ); return $dirty_wp_mail; } function dirty_notification_content_type() { return 'text/html'; }
found here:
core.trac.wordpress.org/ticket/21095Yes. I might add I have bbpress child theme don’t think that should matter
Hi, Paul. If you cold be so kind to remove the email and site UrL from my correspondence. I added the plugin code to Post bin where you can take a look. Pastebin
Thanks Rimon and Shane bp for your reply.
Shanebp your solution is the one I’m looking for except it doesn’t seem to have any affect. I tried the function first in bp_custom and then in funtions.php both didn’t work. What am I missing?
No, the plugin is not online. I built it with bits of code and tuts across the web about customizing WordPress notification emails. if you can send me an email address (please black this out **** (removed at users request ~hnla)) I can send you the plugin and you look it over. I saw on the web that you should remove filter after applying it but it didn’t seem to have any affect.
remove_filter( 'wp_mail_content_type','mycustom_mail_content_type' );
Thanks, Rock on you Rock Stars 😉
If you guys want to keep it for other people facing similar issues, please remove or add a space holder here:
.../wp-content/themes/Starkers-Child-2/images/vidimage.jpg
This posts comes up in the Google searches of my site. I made a mistake including a site identifier in the funtion.
I’m no Buddypress or WordPress pro but for a temporary fix add this to your styles.css
ul.first.acfb-holder li{
list-style:none;
}I just saw the add_filter( ‘bp_is_messages_star_active’, ‘__return_false’ );
Placed it in mu function.phpIt worked like a charm. Thanks a lot, I really appreciate your help with this.
That didn’t work. I lost the page with user Posts and The messages->button stills take you the posts. I think it’s best for me to remove the Starred button for the time being. Ho can I go about doing so using a function?
I need some help. I’ve decided to remove the the messages->starred from BBP Activity and the Admin bar links.
I’ve tried a lot of functions and none of them seem to be working.four examples:
1. $bp->bp_nav[‘starred’] = false;
2. function remove_nav_items() {
bp_core_remove_nav_item( ‘starred’ );
}
add_action( ‘bp_setup_nav’, ‘remove_nav_items’);
// ——- End Removes Forum link Activity feed ————- //// ——- Removes member link forum AdminBar ————- //
3. $wp_admin_bar->remove_menu(‘starred’);
4. function the_bp_admin_bar_remove() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu( ‘my-account-starred’ );
}
add_action( ‘bp_setup_admin_bar’, ‘the_bp_admin_bar_remove’, 301 );I’ve done so successfully using CSS but I would like to use the functions instead. Can you please help?
li#starred-personal-li{
display:none;
}
li#wp-admin-bar-my-account-messages-starred{
display:none;
}Yes it is related to “Messages > Starred”. There is nothing wrong with the new feature. It’s this function that I found online that’s causing a conflict.
/* ——————————Start BP Post in profile code for function——————– */
function importSomething(){
return include_once ‘bp-custom.php’;
}
add_action( ‘bp_setup_nav’, ‘buddyboss_child_bp_nav_adder’ );
add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );function buddyboss_child_bp_nav_adder() {
global $bp;
$post_count = count_user_posts_by_type( $bp->displayed_user->id );
bp_core_new_nav_item(
array(
‘name’ => sprintf( __( ‘Posts <span>%d</span>’, ‘my-poems’ ), $post_count ),
‘slug’ => ‘Articles’,
‘position’ => 250,
‘show_for_displayed_user’ => true,
‘screen_function’ => ‘buddyboss_child_list’,
‘item_css_id’ => ‘articles’,
‘default_subnav_slug’ => ‘public’
));
}
function buddyboss_child_list() {
add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}
/*——- This is end of the code for above function ———*/
function profile_buddyboss_child_loop() {
$myposts = get_posts( array(
‘posts_per_page’ => -1,
‘author’ => bp_displayed_user_id(),
‘post_type’ => ‘post’
));
if( ! empty($myposts) ) {
foreach($myposts as $post) {
setup_postdata( $post );
if (has_post_thumbnail( $post->ID ) ):
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘sidebar-smallthumbnew’ );
else :
$image[0] = “…/wp-content/themes/Starkers-Child-2/images/vidimage.jpg”;
endif;
echo ‘<li class=”sidebar mostpop post-‘ . $post->ID . ‘”><div id=”postimage”>ID) . ‘”></div><div id=”postinfo”>ID) . ‘”>’ . get_the_title($post->ID) . ‘</div>‘;
}
echo ‘‘;
wp_reset_postdata();
} else { ?>
<div class=”info” id=”message”>
<p><?php bp_displayed_user_fullname(); ?> has No posts.</p>
</div>
<?php }
}
/* This is end of the code for above function */
remove_filter(‘bp_setup_nav’,”);
function count_user_posts_by_type( $userid, $post_type = ‘post’ ) {
global $wpdb;
$where = get_posts_by_author_sql( $post_type, true, $userid, true);
$count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where” );
return apply_filters( ‘get_usernumposts’, $count, $userid );
}
/* ——————————This is end of the code for post in profile above function——————– */It adds a new button on the user activity page and when the Message-Starred button is clicked it takes the user the lists of post page that the above function creates. How can I stop that fro happening. I really want to keep the starred message function and I don’t want to lose the lists of WordPress post in the user Activity page.
I have a problem, I found this snippet of code in the forum:
<?php if ( bp_displayed_user_is_friend() ) : ?>
<?php locate_template( array( ‘members/single/not-friend’ ), true ) ?>
<?php else : ?>figured out the problem, for some reason the external message was not loading so I placed this simple message inside like so wrapped in that div:
<?php if ( bp_displayed_user_is_friend() ) : ?>
<div class=”info” id=”message”>
<p>You must be friends in order to access users activity.</p>
</div><?php else : ?>
Body
<?php endif; ?>