Jump to content

Creating a table to limit downloading


DJP1986

Recommended Posts

Hello,

 

I am in the process of creating a download script, I am using a code to determine if someone is granted access or not to download the file. I want to set it up so they can only download, say, 250 MB a month worth of renders. And then, have the option for them to purchase an upgrade to their download limit, which will increase the limit for that user only.

 

I want to use my vBulletin memberlist for this, so I already have a database with the users.

 

I am a noob with MySQL though, and I am completely stumped. I tried this with PHP but failed.

 

Does anyone know how to set this up?

Link to comment
https://forums.phpfreaks.com/topic/97691-creating-a-table-to-limit-downloading/
Share on other sites

You need to store a limitation and usage related to the user. So you can either create a new table to link the 2 (as in a limits table and users table) or you can alter the original users table and add in 2 new columns. Up to you really. You'll also want to add the total filesize to the "usage" when you serve a file to the user.

 

Incidently I would recommend separating the tables because who knows what vbulletin updates might do to your table layout, whether it completely formats the table and reloads the data or b0rks because of unknown columns.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.