MyBB Community Forums

Full Version: how to limit Download file X Per Day ...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hi , Without request a new plugins Not Already Created .. Does Exist a plugins already working with the last version of mybb or Does exist a way to Limit User to download 1 or 2 or X Attachment per Day .. Example I want to Limit Per user to Download max 10 File a day .. ?
I think there is no such plugin, but it should be possible to edit the following plugin to make this possible:
https://community.mybb.com/mods.php?action=view&pid=18
(2020-08-24, 04:49 AM)Omar G. Wrote: [ -> ]I think there is no such plugin, but it should be possible to edit the following plugin to make this possible:
https://community.mybb.com/mods.php?action=view&pid=18
Yaah Can you explain to me What i need to Edit please and What is Do in the final ? i prefer That to The next idea of i have 
With the plugins Download log you say is possible to limit to X file per day ? Does is possible to Log in the same time in the total Who have Download what and who is the user have Download The Much file ? and how many Time the user have download the file ? Does is possible to Block an User to Download 9999 X The same file ? ..

like Limit to 3 time per File an user can Download Each File or just 2 Time .. or 1 time and after he need to made request to Admin









--------------------------------------------------------------------------------------------------------------

second idea not the best Without log



or another way i have think is To use Newpoint and A plugins to Allow user to Earn X point Per day example They wait 24 hours and have X point like they wait 24 hours they have 100 Point Per 24 hours..



Does is possible For point to Give Automatically to user 100 point Every 24 hours ? Without they need to Create A Thread ,Reply to a post or make whatever..







---------------------------------------------------

Does is possible for Every File uploaded to check Before Allow the file To see if the same file Are Already Uploaded ? Like with the Signature of a file i have see on internet md5 i think ? To block user to Upload 9999 Time the same file to take bandwidth ?


Thank you man
Quote:Can you explain to me What i need to Edit

Ok, first, install the plugin. The plugin has issues with some setups, find and remove all instances of "tid" => "NULL", and "sid" => NULL,

Then use something like Hooks to add a new hook. You can take a quick look to the attached image, but I won't explain further on to how the plugin works.

The code is below, read the comments to undertand.
	global $attachment, $db, $mybb;

	if(isset($mybb->input['thumbnail']))
	{
		return;
	}

	$uid = (int)$mybb->user['uid']; // I'm assumming guests can't download attachments.

	$time = TIME_NOW - (60 * 60 * 24); // change 24 to your desired hours.

	$query = $db->simple_select('attachmentlog', 'COUNT(lid) as daily_downloads', "uid='{$uid}' AND date>'{$time}'");

	if($db->fetch_field($query, 'daily_downloads') >= 10) // change 10 to your desired maximum downloads
	{
		error('You have reached the maximum downloads allowed per day for you.');
	}

Quote:Does is possible to Block an User to Download 9999 X The same file ?

Yes, but sounds too troublesome so I won't even try.

Quote:Does is possible For point to Give Automatically to user 100 point Every 24 hours ?

Yes, with a plugin or plugin modification. But you want to avoid overload so I won't even try either.

Quote:Does is possible for Every File uploaded to check Before Allow the file To see if the same file Are Already Uploaded ?

Yes, probably not by md5, but ultimately possible. Regardless, the same reply as above.

You are pondering complex solutions to avoid issues that I think your solutions will ultimately end causing.
Hi I have try And is not working The Attachment in the post Now are Blank ( is like Not Loading for the image and for the file i have try when i click to download is open a page White and Nothing work .


i have deleted all "tid" => "NULL",

i have Deleted all sid null but for the sid -1 i dont have deleted


I re install the plugins hooks and try

Edit Not working I have fallow all in this post When i enabled the hook plugins The attachment after in the post not working I speak For The Attachment already Posted but i dont have try with a new post with new attachment.

Image not loading and File not loading..

i have Deleted all Command you have say to me ( in the attachment.log file)



Wait The Command To Deleted is in the Attachment.log or in the hook plugins ?
Does the Attachment Download Logs plugin even work? Get that plugin working and then I will provide you assistance with the rest.
the plugins Attachment download log Working Well in the admin control panel I can see Who have download file etc Why is not working Do you think is because i have a lot of plugins installed ?

Is wird like explained When i enabled your command in the hook is not working in the post but if i disabled and i refresh page in the post Where attachment are i can download PIcture , file..

Maybe is Your Code you have provideto me
Ah, yes, it was likely my fault. I did update the code in my previous post.

Edit: I suggest you to enable error display by editing your php.ini file. White pages are no helpful at all.
https://stackify.com/display-php-errors/
(2020-08-25, 08:04 AM)Omar G. Wrote: [ -> ]Ah, yes, it was likely my fault. I did update the code in my previous post.

Edit: I suggest you to enable error display by editing your php.ini file. White pages are no helpful at all.
https://stackify.com/display-php-errors/
working thanks you i will reply in 25 hours to see if is working Smile for the moment i have the message of The limit reach and need to wait .. Thanks you man

if one day you have a Way to Allow To The Board to Scan each File upload to See if is Already uploaded Lets me know .. With md5 or signature to


Edit
hi I have another questions How i Can Limit EveryUser To upload X Attachment Per day .. i want to Add the same Option to Download X file per day you have provide to me in this post but Now an user can upload and upload an upload how i can Limit that ?
Quote:How i Can Limit EveryUser To upload X Attachment Per day

This isn't possible, but a combination of the global setting Maximum Attachments Per Post and the group permission Attachment Quota you should be well served.

Why don't you simply disable attachments?
Pages: 1 2