Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 30 total)

  • milenushka
    Participant

    @milenushka

    Hi @imath, thank you so much for writing back. For some reason I didn’t get the notification, and was depressed over the site for a month. Today I decided to finally face the issue again, and what a nice surprise!

    So my code is:

    add_filter( 'bp_blogs_record_post_post_types', 'inspired_record_more_types' );
    function inspired_record_more_types( $types ) {
         $types[] = 'projects';
         $types[] = 'sfwd-courses';
         $types[] = 'uig_image';
            return $types;
    }
    
    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 == 'projects' ) {
    	$activity_action  = sprintf( __( '%1$s created a new project, %2$s  ', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
       }
    if( $post->post_type == 'sfwd-courses' ) {
    	$activity_action  = sprintf( __( '%1$s added a new workshop, %2$s  ', 'buddypress'  ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
       }	
    if( $post->post_type == 'uig_image' ) {
    	$activity_action  = sprintf( __( '%1$s added a new image, %2$s  ', 'buddypress'  ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
       }
       return $activity_action;
    }
    
    function bbg_record_my_custom_post_type_comments( $post_types ) {
          $post_types[] = 'projects'; 
          return $post_types;
      }
      add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_my_custom_post_type_comments' );
    
    

    Thank you so much. I really appreciate it.


    milenushka
    Participant

    @milenushka

    Hi @imath

    I am sort of loosing my hair since I updated to the latest version of buddypress.
    had searched the forum a few months back and put a LOT of time into custom coding that the activity will read my custom post types. I put that code in my functions.php file and was really happy with everything- each activity had it’s own text and it was really nice.

    I am not a coder, just building my site, and now, since this update, all my work is gone- all I get is the generic “posted a new item”, and a link to the post- not even the name of the post. I have 3 custom post types, and I need them all to be unique.
    I don’t know what to do now, how to start over?

    Can I just cancel the new custom post support and go back to my own code?
    Please help.


    milenushka
    Participant

    @milenushka

    this 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’ );


    milenushka
    Participant

    @milenushka

    Here is what they said in bbpress
    https://bbpress.trac.wordpress.org/ticket/2599


    milenushka
    Participant

    @milenushka


    milenushka
    Participant

    @milenushka

    Thanks @henrywright , I did that.


    milenushka
    Participant

    @milenushka

    Yes.

    If the admin is creating the groups and forums there is no problem (well if he knows this is an issue),
    but if the members are creating groups and later want to change groups settings to “private”, they have no control over the forums’ privacy. And that leaves them confused or if sensitive info was shared in the forums, upset too.

    So, yeah, something needs to be done.

    thank you for looking into this @henrywright.


    milenushka
    Participant

    @milenushka


    milenushka
    Participant

    @milenushka

    @henrywright

    Ok, I can confirm the issue now.

    If a group is created as private and a forum is created with it- it will be a private forum and its activity will remain invisible to non group members.

    If a private group is created and an existed forum is added to it- this forum need to be changed to private- otherwise the forum will remain public, even though the group attached to it is private- and the activity of the forum will be public.

    Same goes for a public group+ forum , that is created together and later group setting are set to private. Forum remains public- forum’s activity -too.

    Is there something to be done with the buddypress-bbpress integration to make this work?
    Creating a function that will make a forum private too- if the group it was attached to becomes private? @johnjamesjacoby
    https://buddypress.org/support/topic/bugs-between-bbpress-and-buddypress/


    milenushka
    Participant

    @milenushka

    Hi @henrywright,

    I am using buddyboss (child theme), tested it with default wp theme and buddyboss parent.

    I also found this thread https://buddypress.org/support/topic/forum-in-private-groups/ started a few weeks ago, and I think @melle328 is right, this happens if the group is first set as public and later changed to private or as in my case- group forum is set to public first and then chosen as the private’s group forum.

    So far it seems that if users create a group and a forum and later change their settings- the activity privacy is not updated. I keep testing different options as we speak, so I find something new, I will post it too.


    milenushka
    Participant

    @milenushka

    Hi @danbp, thank you. The problem is mysite is RTL and when I try to add the translation into functions.php %1$s and %2$s jump and I get a weird sequence. How would I

    add this custom string to your po file

    ?

    I am saving my plugin’s translation files in wp/languages/plugins so they are safe from updates.

    Thank you.


    milenushka
    Participant

    @milenushka

    Hi @danbp, thanks for the note.

    First of all I can still edit the activity page if that’s called activity. Members, groups and forums are locked to additions. I want to add some information for users – why shouldnt I be able to edit this page? It makes no sense.

    Also that doesn’t not answer the question why changing the slug would have such an influence. Renaming the slugs used to be a built in buddypress option, since everybody wants to make their buddypress unique and right for their community.


    milenushka
    Participant

    @milenushka

    Hello….? Anybody here? 🙂


    milenushka
    Participant

    @milenushka

    Me too!! @style960 you have an eye for details! What is this about now..:(


    milenushka
    Participant

    @milenushka

    Hi @shanebp,

    Thank you for your help. I found this article by @boonebgorges about adding the comments to custom posts to the activity feed. I actually have that working already, but the text is generic- “user commented on a post”. Is there a way to add a specific slug here too?

      function bbg_record_my_custom_post_type_comments( $post_types ) {
          $post_types[] = 'dolphin'; // Add your custom post type name to the array. If you have a post type called 'dolphin' then you have a weird plugin
          return $post_types;
      }
      add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_my_custom_post_type_comments' );

    With kind regards,

    M


    milenushka
    Participant

    @milenushka

    Hi @@hnla, thank you for addressing this.
    I did research some more and found that the default buddypress moved the post link “read more” to the time. I guess that was only done to the post excerpts, because if I post a long status- the [read more] link will appear (like in the attached screenshot).

    If I use your code- I change the excerpt length of the updates. I lengthened it and now at least the activity wall looks more uniform.
    But the post excerpts are still pretty short (about 1/3 of the thumbnail height)
    Do you have an idea how to change the post excerpts length? (The first example in the screenshot).

    Thank you.


    milenushka
    Participant

    @milenushka

    Wow, @shanebp, thank you so much! That worked perfectly!

    Perhaps you can help me with something else, i’ve been struggling for some time?

    I would like to add the featured image to these activity updates (whether it’s a regular blog post or the custom post – such as projects).

    I found this code before- this one is for posts. It works, but there is something in it that makes all the excerpts in the activity – short and unclickable.
    Also some custom post types do not show the attached image.

    function icondeposit_bp_activity_entry_meta() {
     
        if ( bp_get_activity_object_name() == 'blogs' && bp_get_activity_type() == 'new_blog_post' ) {?>
            <?php
            global $wpdb, $post, $bp;
            $theimg = wp_get_attachment_image_src(  get_post_thumbnail_id( bp_get_activity_secondary_item_id() ) );
            ?>
            <img src="<?php echo $theimg[0]; ?>" >
     
        <?php }
     
    }
    add_action('bp_activity_excerpt_append_text', 'icondeposit_bp_activity_entry_meta');

    And another thing I was researching and could find any reference to :
    How can I add the group description to the activity update?
    I think if it shows up in the activity- it should at least carry some information that will make members want to click and join the group.

    Thank you for your help!


    milenushka
    Participant

    @milenushka

    p.s. it’s a singe blog installation (not a multisite)


    milenushka
    Participant

    @milenushka

    Hi @shanebp,

    I am sorry I don’t quite understand..

    My exact code looks like this:

    add_filter( 'bp_blogs_record_post_post_types', 'inspired_record_more_types' );
    function inspired_record_more_types( $types ) {
        $types[] = 'projects';
            return $types;
    }
    
    add_filter('bp_blogs_activity_new_post_action', 'record_cpt_activity_action', 1, 3);
    function record_cpt_activity_action( $activity_action, $post, $post_permalink ) {
    global $bp;
    if( $post->post_type == 'projects' ) {
    if ( is_multisite() )
    $activity_action = sprintf( __( '%1$s created a new project, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '' . $post->post_title . '', '' . get_blog_option( $blog_id, 'blogname' ) . '' );
    else
    $activity_action = sprintf( __( '%1$s created a new project, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '' . $post->post_title . '' );
    }
    return $activity_action;
    }

    and the link to the project custom post is not showing. It does show with only the first part of the code- but the slug is generic – .. “wrote a new post”


    milenushka
    Participant

    @milenushka

    Anybody?

    How do I put the link back into the (..) and add a “read more” text?


    milenushka
    Participant

    @milenushka

    Anybody?


    milenushka
    Participant

    @milenushka

    Example


    milenushka
    Participant

    @milenushka


    milenushka
    Participant

    @milenushka

    Hi, I was researching how to do this too. So plus 1 on this topic.


    milenushka
    Participant

    @milenushka

    Issue solved. Problem was I changed the default slug of activity page.

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