Buddypress Media is a great plugin authored by rtCamp. They enable site users to upload media in albums. Media includes music, videos and photos.
However, the plugin lacks one important part - Adding media from the front end. Much like how another plugin Activity Plus does. Activity Plus lacks what BP Media provides - and that is - organizing into albums and having them stored for future use right on the members pages.
I thought of marrying both. i.e bringing BP media on the front-page where Activity Updates are posted.
//add media links
function add_media_links(){
global $bp, $current_user;;
if (is_user_logged_in()) {
echo '<div style="float:right; font-weight:bold;">';
echo '<a href="'.$bp->root_domain . '/members/' . $current_user->user_login .'/media/" style="color:black; padding-right:10px">Upload</a>';
echo '<a href="'.$bp->root_domain . '/members/' . $current_user->user_login .'/albums/" style="color:black; padding-right:10px">My Albums</a>';
echo '<a href="'.$bp->root_domain . '/members/' . $current_user->user_login .'/photos/" style="color:black; padding-right:10px">My Photos</a>';
echo '<a href="'.$bp->root_domain . '/members/' . $current_user->user_login .'/videos/" style="color:black; padding-right:10px">My Videos</a>';
echo '<a href="'.$bp->root_domain . '/members/' . $current_user->user_login .'/music/" style="color:black; padding-right:10px">My Music</a>';
echo '</div>';
}
else {
echo '<div style="float:right; font-weight:bold;">';
echo '<a href="'.$bp->root_domain . '/login/" style="color:black; padding-right:10px">Upload</a>';
echo '<a href="'.$bp->root_domain . '/login/" style="color:black; padding-right:10px">My Albums</a>';
echo '<a href="'.$bp->root_domain . '/login/" style="color:black; padding-right:10px">My Photos</a>';
echo '<a href="'.$bp->root_domain . '/login/" style="color:black; padding-right:10px">My Videos</a>';
echo '<a href="'.$bp->root_domain . '/login/" style="color:black; padding-right:10px">My Music</a>';
echo '</div>';}
return;
}
add_filter('bp_before_directory_activity_content',add_media_links');
?>
You may want to add this to your functions.php file.
This code, specially the last line of the code adds a filter such that whenever
bp_before_directory_activity_content
function is triggered, my own custom function
add_media_links
will trigger automatically where in, if the user is logged in, it provides direct links to the media upload as it takes $current_user->username to take them to their own page for media uploads.
And if its just a visitor, these links will redirect to the login page.
You can see this in my site which is live in action at:
DublinWala.Com