Description - Allows administrator to setup a Download page, seperate from UBBT, where allowed users can upload and maintain files and descriptions. Files can be categorized, and will display who uploaded them, and a download count. Uploaders can return and edit, delete, or upload a newer version of the file. Admin has full control with admin pages to edit and delete files. Custom settings include file size limit and file type restrictions.
Notes: All new files go into their own directory, i.e. domain.com/downloads. The files are designed to work with an installation of IIP 4.3, so if you are using a different page layout, you will need to edit each page except for download.php to match your site.
Holy crap, that's awesome! Now, not to be picky... but do you think in the future you could allow the admin to setup categories? Say documents, programs, etc..
It does have categories. You need to have admin authority to see the admin links show up on the index.php page. But it does put everything on one page. I plan on giving the option to make each category a seperate page in the next version, perhaps multiple pages with a max file limit admins can set.
This addon ended up being quite massive, so I had to set some limits to get it done! LOL
It will not let you delete a category if files are still in it. If you rename a catagory, it will update the category name for each file in the database. I tried to make it foolproof, because if a file has an invalid category name, it will not show up on the list as a download. Editing the table by hand is such a pain.
Please let me know what else this addon could use, maybe I'll add it next version.
OK, seems like I messed up the second table creation syntax. I'll fix it and make the ubbt path a config file feature and reupload an updated version today!
The second table creation syntax should be:
code: CREATE TABLE w3t_Dlcat ( DL_CategoryName varchar(30) NOT NULL, DL_CatOrder tinyint(3) Default '0' NOT NULL, KEY DL_CategoryName (DL_CategoryName) );
Updated directions with a fix to the second table creation syntax.
The path to the main.inc.php file can not be put in the config file because these files are in a different directory than UBBT. Perhaps in a future release I will create a seperate config file for this addon, which would remove the need to edit this in each file. I gotta think about this a bit.
The $BasicTitle can be cusomized for each page, thus I prefer to leave it in each page for full feature. The pals path is probably gonna be edited out by many, I'll wait for some more feedback on this before making any changes.
I just made a trial installation of this, finally, and found some minor caveats.
First, the category list numbers need to start from 0 and be consecutive numbers, which wasn't entirely clear, should be in the description. Or even better, why not just sort by the number and do the loop on the number of rows returned?
Also, the check for if the user is in the right group isn't entirely correct. If the group chosen is first on the list, php returns a false value (position 0). Just change the following:
if (!strpos($user['U_Groups'],$dlgroup)) {
to this, in all pages:
if (strpos($user['U_Groups'],$dlgroup) === false) {
It was also a bit of a pain that the configuration strings weren't the same in all files, it would have made it so much easier to do a search and replace. =]
I think it might be a good idea to add the updated instructions to the main package in the first post of this thread.
"To match your paths. If you are not using IIP 4.3, then remove the '$palspath... line and replace with what you are using for menu/page layout. There is an include of menupal.php which you will want to edit or remove if not using IIP 4.3. Change the $BasicTitle to what you want to call each page, or leave them all the same for the whole section."
Question 1 What is IIP 4.3?
Question 2 What is a palspath?
Question 3 What is it referring to when it says "remove the '$palspath... line and replace with what you are using for menu/page layout?
What would I be using for menu/page layout in UBBT?
Question 4 In the line: $config['dlgroup'] = "5";
What the heck does 5 represent?
So, before I complete this one, is the a new version with Gardener's minor caveat suggestions above?
IIP 4.3 is JustDaves Integrated Index Page add-on, which can be found in the Forum Design Integration board. The latest version is 5.x which I think might not be completely compatible with this script. It might be though.
palspath is from the IIP add-on and is the path to where all the scripts for that add-on is located. Usually it is a sub-directory of the ubbthreads directory called "pals".
It means that in order to get a menu if you don't have the IIP add-on you will have to create your own menu with at least a link to the main page of this download add-on.
The number is the number of the user group that users have to be in to be allowed to download. If you want everyone to be able to download, set it to 3, which should be the regular user group. If you want to use some other group, you can find out which number it has by running the query below in the Admin->SQL Command page: select * from w3t_Groups
I don't think anyone has done any work on this, and I'm not using it myself either, I just tried it out to see if it was what I wanted. I will probably wait for the extended download functions which are going to be added to a future version of JustDaves IIP add-on. The script should work without the things I mentioned, those were just some tips to make life easier.
I tried to install it on a 6.3.2 board not using the iip. and it was harder than I thought. I never did get it right. I deleted it all and ill try again later.
SQL ERROR: Mon, Mar 01 2004 01:59:41 -0500 Unable to do_query: SELECT DL_CatOrder FROM w3t_Dlcat ORDER BY DL_CatOrder ASC Unknown column 'DL_CatOrder' in 'field list' Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /....../ubbthreads/mysql.inc.php on line 160 SQL ERROR: Mon, Mar 01 2004 01:59:41 -0500 Unable to do_query: SELECT DL_CategoryName,DL_CatOrder FROM w3t_Dlcat ORDER BY DL_CatOrder ASC Unknown column 'DL_CatOrder' in 'field list' Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /............/ubbthreads/mysql.inc.php on line 160
well the first question is what the field is? is it an INT or a VARCHAR or a.. and what length and if an INT is it autoincrement.. there is alot of questions.. before you just add a field...
okay this mod is having you create two tables did the first one w3t_Downloads get created? Is it both that are giving you problems or just the second one w3t_Dlcat? BTW the notes say that creating the second table w3t_Dlcat with balk an error.
Hrmmm really need to see what the $user is throwing out.. Generic Threw an error? Hmmm ok well thats why I have IIP... do you have phpMyAdmin loaded on your box or another front-end like CPANEL or PLESK? I would have you go in and verify that it created the table..
okay smiles here use this zip I fixed a few things that Allen had suggested on the first page in all the files. Also included the correct tables and um oh yeah when you delete the file it does delete it from the database but not off the server but I figure thats a good thing cause you don't want willy-nilly to be able to delete things off your server with this script..I would suggest using the File Atachments download on the IIP menupal and the file attachments of threads itself but this script does do a few things they don't like allow for categories...
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.