Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)

  • crashy11
    Participant

    @crashy11

    Anyone know this? Please.


    crashy11
    Participant

    @crashy11

    Ah, what can I do, I hope in new version of buddypress there will be option to turn off activity for certain account.

    It could be done with custom post type, but then again you need to integrate some code, because when you make post with custom post type, posts are not showing in category they supposed to show.

    Custom post types doesn’t show in activity stream and that could solve to problem, but then again…


    crashy11
    Participant

    @crashy11

    Yes that could work with shortcodes, but You need to put content every time you make post between that shortcode.


    crashy11
    Participant

    @crashy11

    I tried to put your code and changed user login but its not working.

    echo 'Username: ' . $current_user->user_login . "\n";

    echo 'User ID: ' . $current_user->ID . "\n";

    This situation could be done with custom post type, but another problem is that posts are not showing in category that you mark.

    I found on this forum someone had similar problem like mine:

    Posts are added to the activity stream when the post is saved.

    It’s done in the bp_blogs_record_post() function, which is hooked on to the save_post action.

    There isn’t any easy way to filter bp_blogs_record_post() to stop certain categories appearing, so, your best options may be:

    1. To unhook the whole bp_blogs_record_post() function and replace with your own
    or:
    2. Use a custom post type for your teaser posts – the built in function will only post to activity stream if the post type is ‘post’

    That questions and solution is from this link:
    https://buddypress.org/support/topic/resolved-filter-posts-with-specific-categorytag-from-activity-stream/

    If I go with solution 1. that was offered “unhook the whole bp_blogs_record_post() function and replace with your own”, where to find bp_blogs_record_post(), and just to delete it or?


    crashy11
    Participant

    @crashy11

    Ok thank You I will try and let you know.

    What I am trying to accomplish is this. I created couple of categories by membership levels (1,2,3). I restricted those categories in S2 members options so only user that have certain level of membership can see posts in those category.

    Now problem is, when I create post for example for category level 3, everyone (all levels) can see that post in activity stream, that is what I am trying to remove. Posts don’t need to be in activity stream at all, or just to remove activity stream from account that I am making those posts.


    crashy11
    Participant

    @crashy11

    Hey, can you please tell where I should place that code you posted?

    I am trying to exclude one username from activity stream since with that account I will make posts that are based on different membership levels. Or as I wrote on beginning just exclude all blog posts from activity stream.

    I tried to do it with custom post types, it doesn’t show up in activity stream, which is good, but posts are not showing in category they supposed to show. I read that it is also necessary to post some code somewhere for custom post type.


    crashy11
    Participant

    @crashy11

    I tried to add this code to bp-custom.php but it seems that doesn’t work, does anyone maybe have new code?
    Code is used to exclude one user activity from buddypress activity stream.

    <?php
    add_action(“plugins_loaded”,”bpdev_init_sm_mode”);
    function bpdev_init_sm_mode(){
    global $current_user;
    if(is_user_logged_in()) {
    get_currentuserinfo();
    if(“username” == $current_user->user_login) {
    remove_action(“wp_head”,”bp_core_record_activity”);//id SM is on, remove the record activity hook
    }
    }
    }
    ?>


    crashy11
    Participant

    @crashy11

    I think I can do it with custom post type, but now I have problem that posts from custom post type are not showing in category.


    crashy11
    Participant

    @crashy11

    Hi, is that hard to make? Can I do that by myself maybe?

Viewing 9 replies - 1 through 9 (of 9 total)
Skip to toolbar