vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Administrative and Maintenance Tools - Limit Attachment Downloads (https://vborg.vbsupport.ru/showthread.php?t=152701)

Abe1 07-18-2007 10:00 PM

Limit Attachment Downloads
 
Limit Attachment Downloads 1.3


The writing of this hack was sponsored by: sama3y.net

About this hack:
This hack allows you to limit the number of attachments users can download during a given time period.

This hack is pretty flexible right now. You can choose how many attachments a user can download in a give time. That given time can be set to an hour, a day, a week, a month, 3 months, 6 months, or a year. You also set which attachment types get counted for this hack. Also, you set which usergroups get affected by this hack and how many downloads each usergoup can make.

If a user tries downloading past their limit, they will get an error message. This error message includes when they will be able to start downloading again.

Also, there is a cron job to remove from the table that this hack creates, all the rows that are past the limit date so your table doesn't grow forever and saves you space.
  • Files edited: 0
  • Templates edited: 0
  • Files to upload: 2 (1 via ACP, 1 via FTP)
  • Time to install: 1 minute

Updates:
Version 1.0 (7/19/07):
  • First Release of this Hack

Version 1.1 (7/19/07):
  • [FIXED] MAJOR BUG, the main table needed was not being installed, causing database errors.
  • [CHANGED] I moved over the attachment limit to the usergroup settings to give an option of different download amounts per usergroup.

Version 1.2 (7/19/07):
  • [FIXED] I REALLY now fixed the MAJOR BUG, the main table needed was not being installed, causing database errors.

Version 1.3 (7/29/07):
  • [ADDED] I added a lot more options to 'Download Limit Time Frame' option.
  • [CHANGED] Thumbnails are not counted as download attachments.

Please post your comments or suggestions for this hack. I read ALL posts.

MAKE SURE YOU CLICK INSTALL!
You will get an email when a new version is released.

Pictures:
  • The error message.
  • Found in the main vb settings
  • Found in the attachment types setting
  • Found in the usergroup settings

shadowevil 07-19-2007 04:03 AM

first post ... nice mod ... *installed*

Roflstilzchen 07-19-2007 04:14 AM

cool hack, thank you :)

[edit] doesn?t work with 3.6.5 :(

Hornstar 07-19-2007 04:39 AM

This is something that heaps of people have been wanting for ever! very nice work.
Will install it on my site very soon.

I have some ideas for extra features, if your interested in expanding it, let me know.

thanks.

bashy 07-19-2007 04:50 AM

Hi
Great idea, i will take a look at it tonight Abe1, thanks :)
Perhaps 1 post could reset the limit?
Also, would this work with Downloads II or, could you make this work with it please Abe1?

mhammed 07-19-2007 08:43 AM

don't work
database error when downloading of a group subjected to this hack

Abe1 07-19-2007 10:04 AM

Quote:

Originally Posted by mhammed (Post 1295490)
don't work
database error when downloading of a group subjected to this hack

Can you post the error message?
Quote:

Originally Posted by Roflstilzchen (Post 1295347)
cool hack, thank you :)

[edit] doesn?t work with 3.6.5 :(

What doesn't work?

Abe1 07-19-2007 11:22 AM

Version 1.1 (7/19/07):
  • [FIXED] MAJOR BUG, the main table needed was not being installed, causing database errors.
  • [CHANGED] I moved over the attachment limit to the usergroup settings to give an option of different download amounts per usergroup.

Upload BOTH files again.

mhammed 07-19-2007 11:53 AM

install the 2 end version
member can download 1 st file
the second file give database error

Roflstilzchen 07-19-2007 01:37 PM

Quote:

Originally Posted by Abe1 (Post 1295596)
Version 1.1 (7/19/07):
  • [FIXED] MAJOR BUG, the main table needed was not being installed, causing database errors.
  • [CHANGED] I moved over the attachment limit to the usergroup settings to give an option of different download amounts per usergroup.

Upload BOTH files again.

uploaded new files, deinstalled old hack and installed new one, controlled settings but still doesn?t work.

Code:

Invalid SQL:

                        SELECT MIN(attachment_limit_date) AS limit_date, COUNT(*) AS total
                        FROM attachment_limit AS attachment_limit
                        WHERE attachment_limit_userid = 1
                                AND attachment_limit_date > 1184772649;

MySQL-Fehler : Table 'xxx.attachment_limit' doesn't exist
Fehler-Nr.  : 1146
Datum        : Thursday, July 19th 2007 @ 05:30:50 PM
Skript      : http://www.xxx.com/board/attachment.php?attachmentid=58&d=1183771605
Referrer    : http://www.xxx.com/board/showthread.php/memory-35918.html?t=35918
IP-Adresse  : 85.8.97.180
Benutzername : xxx
Klassenname  : xxx


Abe1 07-19-2007 04:17 PM

Quote:

Originally Posted by Roflstilzchen (Post 1295686)
uploaded new files, deinstalled old hack and installed new one, controlled settings but still doesn?t work.

Code:

Invalid SQL:

                        SELECT MIN(attachment_limit_date) AS limit_date, COUNT(*) AS total
                        FROM attachment_limit AS attachment_limit
                        WHERE attachment_limit_userid = 1
                                AND attachment_limit_date > 1184772649;

MySQL-Fehler : Table 'xxx.attachment_limit' doesn't exist
Fehler-Nr.  : 1146
Datum        : Thursday, July 19th 2007 @ 05:30:50 PM
Skript      : http://www.xxx.com/board/attachment.php?attachmentid=58&d=1183771605
Referrer    : http://www.xxx.com/board/showthread.php/memory-35918.html?t=35918
IP-Adresse  : 85.8.97.180
Benutzername : xxx
Klassenname  : xxx


Can you uninstall then re-install?

Roflstilzchen 07-19-2007 05:36 PM

Quote:

Originally Posted by Abe1 (Post 1295818)
Can you uninstall then re-install?

that?s what i meant with deinstalling and installing the new one.

Abe1 07-19-2007 06:50 PM

Any way I can check you ACP?

DJ XtAzY 07-19-2007 07:08 PM

Awesome! Now i dont need to use the points to download attachments for our members =]

Roflstilzchen 07-19-2007 07:36 PM

Quote:

Originally Posted by Abe1 (Post 1295928)
Any way I can check you ACP?

you?ve got a pm :cool:

Abe1 07-20-2007 01:32 AM

Version 1.2 (7/19/07):
  • [FIXED] I REALLY now fixed the MAJOR BUG, the main table needed was not being installed, causing database errors.

Roflstilzchen 07-20-2007 01:58 AM

thank you, works great now :)

Virtuosofriend 07-20-2007 11:04 AM

Great work mate. Is it possible, i still havent installed so i dont know, to limit it per forum?

Abe1 07-20-2007 11:17 AM

Quote:

Originally Posted by Virtuosofriend (Post 1296428)
Great work mate. Is it possible, i still havent installed so i dont know, to limit it per forum?

No. It is only done on a usergroup level.

PlymWS 07-26-2007 04:21 PM

If a user reaches their limit, will they still be able to see the thumbnails of attachment images or will they not be displayed ?

This mod would suit my site fantastically but I would still need users to be able to see thumbnails when they have reached their limit.

chapsrulez 07-27-2007 03:14 PM

Installed and working.
Great work.
thanks.

Quote:

Originally Posted by Virtuosofriend (Post 1296428)
Great work mate. Is it possible, i still havent installed so i dont know, to limit it per forum?

I think it can be done, in my site i have a download subforum, and per usergoups i deny the downloads. on all other subforums downloads are enable.

Quote:

Originally Posted by PlymWS (Post 1302330)
If a user reaches their limit, will they still be able to see the thumbnails of attachment images or will they not be displayed ?

This mod would suit my site fantastically but I would still need users to be able to see thumbnails when they have reached their limit.

In my site works
I didn't enabled the plugin for "jpg, gif, png and psd files" and enabled it for .dwg, .3ds, .rar, .zip, etc.
When a user uploads a new attachment in (dwg, 3ds, rar, etc) i create a thumb so user sees what they are downloading.

PlymWS 07-27-2007 03:55 PM

Quote:

Originally Posted by PlymWS (Post 1302330)
If a user reaches their limit, will they still be able to see the thumbnails of attachment images or will they not be displayed ?

This mod would suit my site fantastically but I would still need users to be able to see thumbnails when they have reached their limit.

This was easier than I thought. For everyone else who wants this feature :

ACP -> Products & Plugins -> Plugin Manager -> Edit attachment_display thus :
Code:

change

if ($count_download)

to read

if ($count_download && !$vbulletin->GPC['thumb'])

Save.

Abe1 07-29-2007 04:06 AM

Version 1.3 (7/29/07):
  • [ADDED] I added a lot more options to 'Download Limit Time Frame' option.
  • [CHANGED] Thumbnails are not counted as download attachments.

Just re-upload the product XML file.

PlymWS 07-29-2007 12:12 PM

The product download is for 1.2 yet the latest version is 1.3 ???

Abe1 07-29-2007 01:36 PM

Quote:

Originally Posted by PlymWS (Post 1304543)
The product download is for 1.2 yet the latest version is 1.3 ???

Sorry, forgot to change the file. Check now.

Hornstar 08-01-2007 02:51 AM

Some of my suggestions for a future update:
1. Any chance to add captcha to the attachments as an option?
2. If users go over allowed attachments, add a count down timer, that they will have to wait before they can download.

These 2 options would be mod of the month for sure!

gforce75 08-01-2007 03:13 AM

Very good concept :p

Abe1 08-01-2007 10:58 AM

Quote:

Originally Posted by hornstar1337 (Post 1306693)
1. Any chance to add captcha to the attachments as an option?

Not sure what you mean. How would this help this hack.
Quote:

Originally Posted by hornstar1337 (Post 1306693)
2. If users go over allowed attachments, add a count down timer, that they will have to wait before they can download.

This is a feature already! If you try to download an attachment after you used your time already, then it tells you how much time you have left. (look at the first image in the main post)

lasto 08-04-2007 05:41 PM

this is quite good but how about if a user uploads an attachment in a specific forum then their attachment limit goes up by 1

This would encourage people to just not download attachments but also to upload stuff which is relevant to the site in question.

Abe1 08-05-2007 01:15 AM

Quote:

Originally Posted by lasto (Post 1309781)
this is quite good but how about if a user uploads an attachment in a specific forum then their attachment limit goes up by 1

This would encourage people to just not download attachments but also to upload stuff which is relevant to the site in question.

If a user uploads an attachment, then they get an extra download?

lasto 08-05-2007 03:41 AM

yep because this hack limits them to how many per day/month etc but no incentive to try boost their limit back up.
Not sure if u can pull it off but cheers for hack Abe1

Hornstar 08-08-2007 04:22 AM

Quote:

Originally Posted by hornstar1337 (Post 1306693)
Some of my suggestions for a future update:
1. Any chance to add captcha to the attachments as an option?
2. If users go over allowed attachments, add a count down timer, that they will have to wait before they can download.

These 2 options would be mod of the month for sure!

Quote:

Originally Posted by Abe1 (Post 1306992)
Not sure what you mean. How would this help this hack.This is a feature already! If you try to download an attachment after you used your time already, then it tells you how much time you have left. (look at the first image in the main post)


1. I have 90 00 members on my site, I had a thread created 4 days ago which had a 1.9 meg attachment in it. within 4 days, 30 000 people have downloaded it, that is almost 60GB of bandwidth! I doubt those downloads were unique!

People can login create a bot, and then have that bot keep downloading that attachment to waste bandwidth. Having a catpcha image, would make the bot useless.

Not everyone may want this, but at least having the option in the admincp to turn it on/off would be great! as I would use it for sure!

2. I mean like rapidshare, if they go over then the countdown timer starts exactly like rapidshare, with ajax, so they dont have to refresh etc.

thanks.

iDenis 08-09-2007 10:43 AM

Thanks...nice mod ...

But now I'm have a simple problem...

Group "Unregistered / Not Logged In" don't have "Limit Attachment Downloads" and "Download Attachment Limit" parameters :confused:

Abe1 08-10-2007 11:58 AM

Quote:

Originally Posted by hornstar1337 (Post 1312413)
1. I have 90 00 members on my site, I had a thread created 4 days ago which had a 1.9 meg attachment in it. within 4 days, 30 000 people have downloaded it, that is almost 60GB of bandwidth! I doubt those downloads were unique!

People can login create a bot, and then have that bot keep downloading that attachment to waste bandwidth. Having a catpcha image, would make the bot useless.

Not everyone may want this, but at least having the option in the admincp to turn it on/off would be great! as I would use it for sure!

This would be a totally separate hack.
Quote:

Originally Posted by hornstar1337 (Post 1312413)
2. I mean like rapidshare, if they go over then the countdown timer starts exactly like rapidshare, with ajax, so they dont have to refresh etc.

thanks.

I dont think I'll add it.

Hornstar 08-14-2007 12:44 AM

K, but it would be really cool to have it all in one, with options to turn certain things on/off

Abe1 08-17-2007 02:54 PM

Quote:

Originally Posted by hornstar1337 (Post 1316965)
K, but it would be really cool to have it all in one, with options to turn certain things on/off

You do.

Hornstar 08-18-2007 06:41 AM

Quote:

Originally Posted by Abe1 (Post 1319680)
You do.

was referring to the extra features I mentioned above :) would be cool to have those built in :)

Zi55 09-03-2007 11:05 PM

hello ,
if you can add a small feature for it make it limited by IP not by the username , because he can have other username directly and contine downloading , also if you can add speed limit feature it's will be too much nice ,
I really like you hack .
Thanks ,
Zi5

Red Spider 09-10-2007 08:02 PM

thank you SOOOO much :D

canntoon 09-11-2007 10:27 PM

Quote:

Originally Posted by iDenis (Post 1313487)
Thanks...nice mod ...

But now I'm have a simple problem...

Group "Unregistered / Not Logged In" don't have "Limit Attachment Downloads" and "Download Attachment Limit" parameters :confused:

Yeah I'm having this same issue.


All times are GMT. The time now is 02:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01412 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete