A fellow follower of our Blog, recently asked for a way of limiting the maximum number of videos a user can upload. In this article, I will show you how you can do just that! This article has been tested in version 2.6 of Clip-Bucket.
1. Open ./upload.php
2. Find
if(has_access('allow_video_upload',false,$verify_logged_user)) {
after that, add the following code
$video_limit = 10; //Change this as per your needs if($userquery->get_user_field(userid(),"total_videos") =< $video_limit) {
4. Where it says $video_limit = 10;, modify the 10 to the limit you want to set per user.
5. Find
$Cbucket->add_js(array('swfupload/plugins/fileprogress.js'=>'uploadactive'));
and after that, add the following code
} else { header("Location: ".BASEURL); }
6. Save & Upload
There you go! Once a user has exceeded that limit, it won’t be able to upload. You can make this modification more user friendly by showing them a message saying they couldn’t upload because they have exceeded the limit of X uploads per user.
If you get stuck at any step or need some assistance, do let me know and I’ll be more than glad to help you out.
Best Regards,
Richi González
Hello,
Nice useful article but no more working on ClipBucket 2.7
Is it possible to get the code for CB 2.7 ?
Thanks !
Hello,
Sure thing. What version of 2.7 are you using?
Regards,
Richi