Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • ethanstein
    Participant

    @ethanstein

    Looks like this setting within the class-bp-admin file controls whether it’s seen or not:

    // Cover images.
    if ( bp_is_active( 'xprofile', 'cover_image' ) ) {
    	add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_xprofile' );
    	register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );
    }

    Why would profile cover_image be disabled in nouveau template?


    ethanstein
    Participant

    @ethanstein

    I did try with 2017, same behavior. Is it possible to reload the nouveau theme?


    ethanstein
    Participant

    @ethanstein

    Did as requested. Disabled all but BP. Even still, when I switch to “nouveau” template and click “Save” the options disappear from the buddypress settings. If I switch back to legacy and click “save”, then it reappears. Is there logic in admin code that controls the appearance of those features?


    ethanstein
    Participant

    @ethanstein

    I agree it should, but it did not. It simply vanished when I have buddypress nouveau template. “Group Cover Image Uploads” also disappeared with the nouveau template.


    ethanstein
    Participant

    @ethanstein

    Looks like it was because I selected the “buddypress nouveau” template instead of legacy template. Once I chose legacy then I was able to see my cover art.

    Is there a particular reason this feature was removed from the nouveau template?


    ethanstein
    Participant

    @ethanstein

    Okay, I figured out why it failed. I am using my own custom class to create notifications through bp_notifications_add_notification. There was something in my logic that resulted in the additional 3 not coming through. Thanks.


    ethanstein
    Participant

    @ethanstein

    I see an option for “photo uploads” but not cover photos


    ethanstein
    Participant

    @ethanstein

    It seems like parameters 6-8 are no longer being passed with the new version of buddypress?

    This is my code which has been working:

    function bp_custom_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string', $component_action, $component_name, $id ) {
    
      if ("wbp_party" === $component_name && is_user_logged_in()) {
    
        ...
    
    if ( 'string' === $format ) {
          $return = apply_filters( 'wbp_notification_filter','<a href="'.$custom_link.'">'.$custom_title.'</a> ', $custom_text, $custom_link );
    
          // Deprecated BuddyBar
        } else {
          $return = apply_filters( 'wbp_notification_filter_array', array(
            'text' => $custom_text,
            'link' => $custom_link
          ), $custom_link, (int) $total_items, $custom_text, $custom_title );
        }
    
        return $return;
      }
    
    }
    add_filter( 'bp_notifications_get_notifications_for_user', 'bp_custom_format_buddypress_notifications', 10, 8 );

    ethanstein
    Participant

    @ethanstein

    I also had the same issue. It has been working for the past six months but for some reason I’m now getting the error:

    [Thu May 31 03:17:57.637007 2018] [proxy_fcgi:error] [pid 20994:tid 140462744499968] [client 76.95.217.178:52226] AH01071: Got error 'PHP message: PHP Warning: Missing argument 6 for bp_custom_format_buddypress_notifications(), called in /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php on line 286 and defined in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/wbp/lib/party/notifications.php on line 40\nPHP message: PHP Warning: Missing argument 7 for bp_custom_format_buddypress_notifications(), called in /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php on line 286 and defined in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/wbp/lib/party/notifications.php on line 40\nPHP message: PHP Warning: Missing argument 8 for bp_custom_format_buddypress_notifications(), called in /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php on line 286 and defined in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/wbp/lib/party/notifications.php on line 40


    ethanstein
    Participant

    @ethanstein

    Yes, definitely helpful. Any idea how to implement the solution within the groups index page as a bulk option as oppose to having to go into the individual group?

    I tried using wordpress’s bulk admin similar to the example pertaining to load-users.php, but it isn’t working.

    
    
    add_filter( 'handle_bulk_actions-toplevel_page_bp-groups', 'add_bpgroups_to_bpgroup', 10, 3 );
    
    function add_bpgroups_to_bpgroup($redirect_to, $doaction, $group_ids) {
      trigger_error($doaction);
      trigger_error($redirect_to);
        if( bp_is_active('groups') ):
    
          if ( $doaction !== 'assign_parent_group' ) {
              return $redirect_to;
          }
          trigger_error(print_r($group_ids,TRUE));
          $redirect_to = add_query_arg( 'groups_assigned' , implode(',', $group_ids) , $redirect_to );
        endif;
        return $redirect_to;
    }
    add_filter( 'bulk_actions-toplevel_page_bp-groups', 'register_bulk_assign_parent_action' );
    
    function register_bulk_assign_parent_action ($bulk_actions) {
     $bulk_actions['assign_parent_group'] = __( 'Assign Parent Group', 'assign_parent_group');
     //form submission
     add_action( 'admin_footer', function() { ?>
         <script type="text/javascript" charset="utf-8">
             jQuery("#doaction").click(function(e){
                 if(jQuery("select[name='action'] :selected").val()=="assign_parent_group") { e.preventDefault();
                     gid=prompt("Enter a Group ID","1");
                     if (gid != null) {
                       jQuery(".wrap form").append('<input type="hidden" name="bp_gid" value="'+gid+'" />').submit();
                     }
                 }
             });
         </script>
     <?php
     });
     return $bulk_actions;
    }
    
    add_action( 'admin_notices', 'bulk_assign_parent_action_admin_notice' );
    
    function bulk_assign_parent_action_admin_notice() {
      if ( ! empty( $_REQUEST['groups_assigned'] ) && ! empty( $_REQUEST['assigned_group'] ) ) {
        $groups_assigned =  $_REQUEST['groups_assigned'] ;
        $parent_id = $_REQUEST['assigned_group'];
        $parent_group = groups_get_group($parent_id);
        if ($parent_group->id == 0) {
          printf( '<div id="message" class="error">Unknown group ID %s</div>', $parent_id);
          return;
        }
        $group_ids = explode(',' , $groups_assigned);
        foreach ($group_ids as $group_id) {
          $group = groups_get_group( $group_id );
          if (false === groups_edit_group_settings($group_id, $group->enable_forum, $group->status, false, $parent_id )) {
            printf( '<div id="message" class="error">Failed to add group %s to %s.</div>', $group->name, $parent_group->name);
            break;
          }
    
        }
    
        printf( '<div id="message" class="updated fade">Successfully ' .
          _n( 'assigned %s group',
            'assigned %s groups',
            $groups_assigned,
            'assign_parent_group'
          ) . 'to %s</div>', $groups_assigned, $group_name );
      }

    It fires the
    add_filter( ‘bulk_actions-toplevel_page_bp-groups’, ‘register_bulk_assign_parent_action’ );

    correctly but seems to completely ignore

    add_filter( ‘handle_bulk_actions-toplevel_page_bp-groups’, ‘add_bpgroups_to_bpgroup’, 10, 3 );

    Any ideas?

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