This is the bit that I am sure I need to change:
function bp_album_upload_path(){
if ( bp_core_is_multisite() )
$path = ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path' );
else {
$upload_path = get_option( 'upload_path' );
$upload_path = trim($upload_path);
if ( empty($upload_path) || 'wp-content/uploads' == $upload_path) {
$path = WP_CONTENT_DIR . '/uploads';
} else {
$path = $upload_path;
if ( 0 !== strpos($path, ABSPATH) ) {
// $dir is absolute, $upload_path is (maybe) relative to ABSPATH
$path = path_join( ABSPATH, $path );
}
}
}
$path .= '/album';
return apply_filters( 'bp_album_upload_path', $path );
}
But what in there?
And, is there a way to do it via bp-custom.php, so that I don’t need to change the plugin core file everytime there is an upgrade?
Add a filter to bp_album_upload_path.
function my_bp_album_upload_path() {
$path = ABSPATH . 'wp-content/uploads/album';
return $path;
}
add_filter('bp_album_upload_path','my_bp_album_upload_path');
This code snippet is untested, but should give you some ideas.
You’re basically redefining the upload path that BP Album+ has set.
Lucky for you that the plugin offers a filter to change the upload path!
Thanks r-a-y, I can’t test it right now (am at the seaside), but tomorrow evening when I’ll be back, I will.
I’ll let you know.
r-a-y, without success, I tried those two options in bp-custom.php:
function my_bp_album_upload_path() {
$path = ABSPATH . 'wp-content/uploads/album';
return $path;
}
add_filter('bp_album_upload_path','my_bp_album_upload_path');
and:
function my_bp_album_upload_path() {
$path = ABSPATH . 'site/wp-content/uploads/album';
return $path;
}
add_filter('bp_album_upload_path','my_bp_album_upload_path');
“site” is my subfolder.
The images sources still doesn’t have the subfolder in the path.
As I said, this is due to the previous filter:
_bp_override_core_domain() {
$domain = get_bloginfo('url');
return $domain;
}
add_filter('bp_core_get_root_domain','my_bp_override_core_domain');
Still didn’t solve this. I am missing something very basic here.
Anyone?
I need to fix this.
I noticed that now Tweetstream adds a litle icon to post generated from Twitter and the image path to that icon image is broken too.
And I can’t afford not to have broken images within Album+!
I got WP in a subfolder and the images from plugins stuff are broken because they don’t find the right path due to a function I need to have in “bp-custom.php”, that allows me to have permalinks such as mysite.com/activity, instead of mysite.com/subfolder/activity.
This is the code:
function my_bp_override_core_domain() {
$domain = get_bloginfo('url');
return $domain;
}
add_filter('bp_core_get_root_domain','my_bp_override_core_domain');
What’s the best solution, knowing that I need to keep permalinks structure without the “subfolder”?
Should I write other functions per plugin to indicate the correct path (with “subfolder”)?
And what this code would be?
@r-a-y unfortunately the above code didn’t work for me.
Please help me with this.
I’m having the same problem.
We’ve just made modifications to the new BP Album+ beta that fix the problem you’re describing.
Get it here:
https://buddypress.org/community/groups/bp-album/forum/topic/new-bp-album-version-download-and-test/