PDA

View Full Version : Protected file downloads by user group


noppid
10-31-2003, 04:37 AM
Here's what I got so far...

This allows you to host files for download and only allow certain user groups to see certain files. The file is streamed to the user form a folder protected by htaccess.

So far I have been using phpmyadmin to add a file to the list. There are fields for filename, author, description, and category(group).

When the file is listed the number of downloads will be dispalyed and the file size.

Files are uploaded via ftp to a protected folder.

There is a table that records all downloads. This too is viewed in phpmyadmin currently.

For it to be a complete hack I think it needs an admin page for adding, editing, and deleting files form the list. It would be nice to to have a view and delete for the log as well.

It's handy as is if ya don't mind using phpmyadmin, but if anyone feels like taking over this could be a nice hack.

Regards

Rein Masamuri
11-12-2003, 06:43 AM
I'd LOVE this to be completed with an admin page!
If you get someone with some talent (i.e. I don't have any) please tell me ^_^

barrywien
11-12-2003, 03:36 PM
Im up for the challenge, I have created an installation file to automatically setup the databases however when viewing fplist.php I just get vB header, footer etc however the table is empty and an error saying

Warning: Invalid argument supplied for foreach() in /home/phpcart/public_html/forum/fplist.php on line 116

Here it is: http://www.phpcart.co.uk/forum/fplist.php

Intergrating this into the Admin CP shouldnt be to hard once I solve this problem.

Rein Masamuri
11-12-2003, 05:32 PM
Is this going to have usergroup><= can download this ?

barrywien
11-13-2003, 10:58 AM
I edited the code to include either usergroup or depending upon how many posts the user has, but as I said, still got the above mentioned problem.

noppid
11-18-2003, 04:43 PM
Sorry I haven't been around. I'll take a look and try to catch up and help with that error.

EDIT:

The error is most likely caused by a typo is this block of code. The foreach uses these params to check for valid usergroups...


/*********** SET YOUR GROUPS HERE ****************************/
$gadmin=6; // admin
$g1=2; // Registered
$g2=5; // Super Mod
$g3=7; // Mods
$g4=8; // Adult Members

$fp_groups=array($g1,$g2,$g3,$g4,$gadmin);



Take a look there or paste yours here. I'll keep an eye out to help.

FleaBag
11-29-2003, 01:04 PM
barrywien I see this seems to be working on your site now?

Is that so?

Dean C
11-29-2003, 01:38 PM
Why construct your array like that


$allowedusergroups = array(1,2,3,4,5); // add allows usergroups here


Then check with:


if(in_array($bbuserinfo['usergroupid'], explode(',', $allowedusergroups)))
{
// stuff
}

barrywien
11-29-2003, 06:10 PM
barrywien I see this seems to be working on your site now?

Is that so?

No I still get the same error message. I havnt been able to fix it or find a work around.

noppid
12-04-2003, 05:28 PM
Im up for the challenge, I have created an installation file to automatically setup the databases however when viewing fplist.php I just get vB header, footer etc however the table is empty and an error saying

Warning: Invalid argument supplied for foreach() in /home/phpcart/public_html/forum/fplist.php on line 116

Here it is: http://www.phpcart.co.uk/forum/fplist.php

Intergrating this into the Admin CP shouldnt be to hard once I solve this problem.

I can't duplicate the problem you are having. Can you send or post your fplist file? I'm assuming you've modified it.