I would like Buddypress group folders to be enabled in all of my groups. I don’t want to have to keep putting each group ID’s in the admin setting of this plugin.
Any way to accomplish that?
Many thanks in advanced!
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>I setup this plugin and the options show in the theme but uploads just give a falied error. The gfold folder doesn’t exist either. Uncertain what to do to get it working
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>For security, it seems like you should move the default gfold folder from wp-content/gfold to uploads/gfold, no?
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>How about adding the extension as a class on each filename (for icons etc)? And maybe using pathinfo($files[$f][‘name’], PATHINFO_EXTENSION) instead of strrchr() (via https://stackoverflow.com/questions/173868/how-to-extract-a-file-extension-in-php)
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Hello Ruuttu,
here is another patch for a little bit more security: Check the uploaded file against allowed file types.
inside function find_filename() after line 376:
$extension = strrchr($name, '.');
add this:
/* check for allowed extensions / mime type */
$ext = substr($extension,1);
$mimes = get_allowed_mime_types();
$mime_ok = false;
foreach ($mimes as $type => $mime) {
if (strpos($type, $ext) !== false) {
$mime_ok = true;
}
}
if(!$mime_ok)
return false;
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>One more thing: Please change in function bp_gfold_admin_menu() the capability from ‘edit_plugins’ to ‘manage_options’.
If you put this into wp-config for security reasons the edit_plugins seems not to work: define(‘DISALLOW_FILE_MODS’, true);
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Hi,
I’ve translated your plugin into German and would like to give the language files to you. Can I upload them somewhere or send to you per email? I’m not on svn yet…
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Hello,
here again. Your plugin is so wonderful that I’d like to add some more feature enhancement: Add an activity update when a new document was uploaded.
Here’s the patch:
–> class gfold_Group_Extension
into function __construct():
// Add the activity actions for uploaded group documents
add_action( 'bp_gfold_activity', array( $this, 'activity_for_gfold_upload' ) );
add_action( 'bp_register_activity_actions', array( $this, 'register_activity_types' ) );
add_action( 'bp_group_activity_filter_options', array( $this, 'register_filter_options' ) );
add_action( 'bp_member_activity_filter_options', array( $this, 'register_filter_options' ) );
new functions into same class:
//register the activity type for Group Folder Uploads
function register_activity_types() {
bp_activity_set_action( $this->gid, 'gfold_upload', __( 'New document uploaded', 'bp-gfold' ) );
}
//add filtering options for activity types for Group Folder Uploads
function register_filter_options() { ?>
<option value="gfold_upload"><?php _e( 'Uploaded Documents', 'bp-gfold' ) ?></option>
<?php }
// generate activity update on document uploding
function activity_for_gfold_upload( $success, $type = 'upload' ){
global $bp;
$page = get_query_var('name');
$files = $this->gfold->fetch($page);
if ($success == 1) {
$activity_action = sprintf(
__( '%s uploaded the document %s to %s in %s:', 'bp-gfold'),
bp_core_get_userlink( bp_loggedin_user_id() ),
'<strong>' . htmlspecialchars($files[0]['disp']) . '</strong>', // Name of File
'<a href="' . bp_get_group_permalink( $bp->groups->current_group ).$this->slug.'/">' . $this->name. '</a>', // Gfold Tab Link
'<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>'
);
} else {
for ($f = 0; $f < $success; $f++) {
$filename[] = htmlspecialchars($files[$f]['disp']);
}
$activity_action = sprintf(
__( '%s uploaded the documents %s to %s in %s:', 'bp-gfold'),
bp_core_get_userlink( bp_loggedin_user_id() ),
'<strong>' . implode(', ', $filename) . '</strong>',
'<a href="' . bp_get_group_permalink( $bp->groups->current_group ).$this->slug.'/">' . $this->name. '</a>',
'<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>'
);
}
unset($files);
groups_record_activity(
array(
'action' => $activity_action,
'content' => '',
'primary_link' => bp_get_group_permalink( $bp->groups->current_group ).$this->slug,
'type' => "gfold_upload",
'item_id' => $this->gid
)
);
}
And last but not least, call the action inside the function display():
if ($success == 0) {
$msg = __('Upload failed.', 'bp-gfold');
} else {
if ($success == $total) {
$msg = $total > 1 ? __('Done!', 'bp-gfold') : __('All done!', 'bp-gfold');
} else {
$msg = $success == 1 ? __('1 file uploaded successfully.', 'bp-gfold') : __('%s files uploaded successfully.', 'bp-gfold');
}
// Do activity update
do_action( 'bp_gfold_activity', $success, 'upload' );
}
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Yeah, cool plugin! And it works out of the box ?? Big thanks to you!
Request: Make it multisite / multinetwork compatible. Yes, some people have multiple buddypress communities in one install. Just change this:
In class bp_gfold line 122-123 to:
if ( is_multisite() ){
$this->repo_root = WP_CONTENT_DIR.'/'.$this->get_pref('path').'/'.BP_ROOT_BLOG.'/'.$this->get_pref('path');
$this->repo_root_url = WP_CONTENT_URL.'/'.$this->get_pref('path').'/'.BP_ROOT_BLOG.'/'.$this->get_pref('path');
} else {
$this->repo_root = WP_CONTENT_DIR.'/'.$this->get_pref('path');
$this->repo_root_url = WP_CONTENT_URL.'/'.$this->get_pref('path');
}
This works for me ??
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Hi Rudolf,
It’s important to have a setting for every group (Group Admin Tab) where a group Admin is able to define if Members of that group are able to upload, rename and delete files or not. A simple checkbox, but an important one…
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Would be nice to have a file counter in the folder tab (the way BP is doing it e.g. for the members tab).
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>You will get a lot of downloads the coming days…
…why not include a Donate button in your next release? ??
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Please automatically put an index.php with…
<?php
// Silence is golden.
?>
…in the upload directory / directories while saving your settings to prevent indexing (important for private or hidden BP groups)
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Hi Rudolf,
Is the group folder always in /wp-content/ or would it be possible to enter a absolute path – eventually below (outside) the web path (public_html)? Thanks for info.
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>Hi Rudolf,
Cool plugin. Thanks for coding!
Please allow spaces in file names.
Best,
HansRudolf ??
https://www.ads-software.com/extend/plugins/buddypress-group-folders/
]]>