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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.