Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • majecdad
    Participant

    @majecdad

    hey @maxgx, I had also used the plugin @sharmavishal mentioned. The plugin author recently came back to it after a long absence and says he is now going to continue updating. It has some limitations, but not a lot to choose from out there. Good luck.


    majecdad
    Participant

    @majecdad

    First, @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.


    majecdad
    Participant

    @majecdad

    Honestly, I have no idea. But it IS posting a new BP activity to the Stream when I have created a new custom post on the site… so that part is working.

    It is simply the description/permalink of that activity that was not posting as expected.

    I’m wondering if the if( $post->post_type == 'agency' ) needs to be the plural form? The CPT is set as agency, so that is what I used (but the original code was ‘projects’).

    I also wonder if the sprintf( __( '%1$s created a new Post is wrong, as the original code had the (singular) name of the CPT, where I changed this to Post – (thinking it was just text).

    I’ll try multiple changes to see what happens, but if anyone has a shortcut to “correct” 🙂 I’m all ears.

    Thanks.


    majecdad
    Participant

    @majecdad

    Hi @henrywright

    The code was that that I pulled from the other post. Here it is:

    add_filter('bp_blogs_activity_new_post_action', 'record_cpt_activity_action', 1, 3);
    function record_cpt_activity_action( $activity_action,  $post, $post_permalink ) { 
    
       if( $post->post_type == 'agency' ) {
    	$activity_action  = sprintf( __( '%1$s created a new Post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
       }
    	
       return $activity_action;
    }
    

    the only change was that I changed the post_type from ‘projects’ in the original to ‘agency’ in mine, and changed ‘Project’ to ‘Post’ in the next line.

    This is my first test use of CPT’s and then trying to tie them to the BP stream, so I’m learning. 🙂

    Thanks.


    majecdad
    Participant

    @majecdad

    Multiple hours later, thanks to some code I found kindly shared by @shanebp, I figured out how to do a CPT to the activity stream with Site Tracking off. Cool.

    I would still like to be able to *automatically* post *selected* posts to the BP SWA, maybe turn Site Tracking back on, filter the posts that are submitted based on something like a category, if that’s possible.

    So any ideas are still appreciated.

    Thanks.


    majecdad
    Participant

    @majecdad

    Thanks @danbp – I was looking for how to do this. Then I figured out how to pull the other activities from my database and was able to customize commenting options on several other activities. Tres cool. 🙂

    Just wanted to say thanks for sharing.


    majecdad
    Participant

    @majecdad

    In case anyone was wondering, this was resolved by the fine folks over here. https://buddypress.org/support/topic/group-moderator-broken/

    Just cleaning up after myself. I can’t close because I was not the OP. 🙂


    majecdad
    Participant

    @majecdad

    I tried in a number of different places, and while not perfect, I settled for placement just above the activity-header. I also caught the div was there and was able to target it to make styling mods in the theme.

    One of these days I’ll figure out how all this works, but for now trial and error (and error and error and error) 🙂 will have to do.

    Thanks for the help guys. Have a great day.


    majecdad
    Participant

    @majecdad

    Thanks @shanebp, I did that, but it put the xprofile field info under the avatar (using Line 24). I also tried to add it to line 32, like this:

    <div class="activity-content">
    		
    		<div class="activity-header">
    
    			<?php bp_activity_action(); ?>
    			<?php do_action( 'showsaxisme'); ?>
    		</div>

    but that put it *below* the area I was looking to do (was placed under the activity time stamp).

    If if goes somewhere in that same file, I just don’t see exactly where to inject it so it displays in the place I was looking to do.

    Thanks for any help you can provide.


    majecdad
    Participant

    @majecdad

    This.

    This is what is so great about the BP community.

    So while I didn’t fully understand the ‘why’ laid out in @danbp reference to bpcore, I appreciate his reply and direction to something. Still, I think the ‘logic’ of providing mods the specific group moderation capability should apply, but that’s ok, it’s above my paygrade 🙂 and besides…

    Major props and huge thanks to @shanebp – that code worked perfect. I can’t tell you how much I appreciate it. I know the BP community is volunteer, and folks get to stuff as they can out of the spirit of the open-source community – so thanks.

    Regardless, I also tracked you down at philopress and I’m going to figure out something to buy there just to support your efforts.

    Thanks all.


    majecdad
    Participant

    @majecdad

    So we’re about two months later, the problem remains, and I’m kinda bummed that no one around here cares enough to even respond.

    I get that BP is a volunteer deal, and I’m amazed at the commitment and how cool some of the stuff is that is put out, but I’d still think that when something comes across as a potential issue or problem that folks would care enough about the product to respond.

    So, if I may, I’d like to place a little BUMP on this thing, as guidance would still be appreciated.

    Thanks.


    majecdad
    Participant

    @majecdad

    Craptastic. In playing with capabilities over the past couple hours, it seems as though the ability to send a sitewide message is tied to the ‘manage options’ capability.

    I’m obviously not too keen on adding that capability to another user.

    How else can I accomplish the same thing: Allow another (non-admin, but very specific) user the ability to send a sitewide message?

    Thanks.


    majecdad
    Participant

    @majecdad

    Hey,


    @shanebp
    as I understand it, your plugin serves as sort of a ‘blacklist’ where you can block any user in a variety of ways. Have you considered making it the other way around? Whereby ALL other users were blocked from sending a Public or Private Message *unless* the User clicked on a button that added the other user to a ‘whitelist’?

    If the user B clicked on a ‘Message’ button, they would be precluded from sending a message to User A unless User B had already been whitelisted by the recipient/User A. Maybe with the attempt generating a prompt to User B to submit a whitelist approval request to User A.

    Maybe something like this already exists?

    Something for consideration. Thoughts?

    Thanks.


    majecdad
    Participant

    @majecdad

    Ok, so I thought I was either crazy or missing something simple, but this exact same thing is happening to me.

    I ‘promote’ a member to Moderator, their avatar shows up as “Group Mod” – however, they never realize the ability to delete content within that group (except their own, of course).

    Interestingly, after this ‘promotion’ their Forum role never changes from ‘participant’ in the WP users page, and their Site role stays at Subscriber. (not sure if that is normal behavior?)

    I have deactivated all the other plugins except bbpress and buddypress, and the required theme plugins. I have tried it on two different themes.

    If I promote the user to Group Admin, they do realize the delete privileges, but that’s not what I want to do as it includes other group edit functions.

    WP 4.1
    BP 2.2
    bbp 2.54

    Any guidance is greatly appreciated.

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