The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Ability to Restrict amount of downloads from Attachments
I requested this before, but no one came up with a solution, so I am doing it again here.
I need the ability to restrict the amount of attachments for certain membergroups. The strain on my server because people are greedy is causing a lot of problems. Either by a amount of attachments a member can download per day (like say just 5) or even the ability to have a page that comes up with a countdown of a time period, before the link will appear to be downloaded (Should not be a pop up page, just changes the page from the thread) Please, I have no idea on scripting, and this has killed my server a few times, and one of these days, I may go over my bandwidth limit. Help? |
#2
|
||||
|
||||
Limiting the amount of DL/day should be fairly easy with a Plugin:
- Create a new Field in Table User for counting - In Hook attachment_start check this field. If we're over quota: eval(standard_error(fetch_error('dlquotareached')) ); If not: Increment the Counter - Cronjob run at midnight to reset the counter. Done. |
#3
|
|||
|
|||
......
|
#4
|
|||
|
|||
please delete post
|
#5
|
||||
|
||||
[sql]ALTER TABLE user ADD downloadcount INT (5) DEFAULT '0' NOT NULL[/sql]
[high]attachment_start[/high] PHP Code:
[high]dlquotareached[/high] Code:
You have already downloaded the maximum number of attachments for today. Please try again tomorrow! |
#6
|
||||
|
||||
Hi, this is actually similar to what I'm looking for and I tried following your instructions but erhm... I couldn't find attachment_start and I have no clue how to do a Cron Job file
Though instead of downloaded attachments, I'd be more interested to know if we do a whole Bandwidth limit, but download attachments works fine too. Can you walk me step by step for 3.5.1? I'd greatly appreciate it. Thanks! |
#7
|
||||
|
||||
Chris |
#8
|
||||
|
||||
Wow, you're da bomb!
You had me at hello! Erhm, you had me up until cron job I don't know how to create a Cron Job, I can find it in the Scheduled Tasks and I can enter all the necessary fields, but don't I need a PHP file? Like, Downloadlimitreset.php? And if so, what should I put inside it? resetdownloadcount = 0 ? *edit: ok, now I'm getting a MySQL error too Code:
Invalid SQL: UPDATE user SET downloadcount = downloadcount + 1 WHERE userid = Array['userid']; |
#9
|
||||
|
||||
You'll need to make a file with the following Query:
[sql]UPDATE user SET downloadcount = 0[/sql] You should change the php code to the following: PHP Code:
I'll do the usergroup thing when I get more time Chris |
#10
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|