[buddypress-trac] [BuddyPress Trac] #6931: Cover Image location is incorrect for blogs other than the primary blog

buddypress-trac noreply at wordpress.org
Thu Mar 3 18:38:06 UTC 2016


#6931: Cover Image location is incorrect for blogs other than the primary blog
-------------------------------------+--------------------
 Reporter:  rbaccaro                 |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  2.6
Component:  Component - Attachments  |     Version:  2.4.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch 2nd-opinion    |
-------------------------------------+--------------------

Comment (by rbaccaro):

 Hi imath,

 Thank you for your inputs. My feedback is only 2 cents compared to what BP
 community hard work gave me already.

 1) Avatar: I see. But if I remove this function from bp-custom.php, the
 avatar is not fetched for the same user in a different blogs, note that I
 have network activated BP and define( 'BP_ENABLE_MULTIBLOG', true ), sorry
 if I mentioned the wrong ticket, but this is the code:

 {{{#!php
 add_filter('bp_core_avatar_upload_path',
 'nfm_bp_avtar_upload_path_correct', 1);

 function nfm_bp_avtar_upload_path_correct($path){
     if ( is_multisite() ){
      //   $path = ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path'
 );
                 $path = ABSPATH . 'wp-content/uploads/';
     }
     return $path;
 }

 add_filter('bp_core_avatar_url', 'nfm_bp_avatar_upload_url_correct', 1);

 function nfm_bp_avatar_upload_url_correct($url){
     if ( is_multisite() ){
         $url = get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . "/wp-
 content/uploads";
     }
     return $url;
 }
 }}}

 2) MS installation: true, not everyone, but our multisite setup is more
 common than we may think, IMHO, for example, it is used to support
 multilingual versions of a specific website, because we can set different
 languages for different blogs, instead of installing a plugin, as WMPL,
 for a single site. But I agree, probably, it is not common to add BP as
 network and multiblog activated on the top of that, but that is the
 challenge.

 3) Gist: thank you so much! I will try and let you know.

 4) Sure and agree, and since you mentioned, yes, the /uploads/buddypress
 /cover-image/ dir for any blog would be a great idea as well as move the
 /avatar/ dir under /uploads/buddypress/ as you already mentioned here
 https://buddypress.trac.wordpress.org/ticket/6925#comment:3

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6931#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list