Previous Thread
Next Thread
Print Thread
Rate Thread
#224833 09/20/2002 2:31 AM
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Mod Name / Version - File Download Page v1.0

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.

Example - http://www.newoutriders.org/downloads/index.php

Pre-requisites - none

Author - Aglavalin, aka Steve Stout

Files Altered - config.inc.php

Database Altered - Only two tables are created, thus, very removable.

New Files - doeditcategories.php, doeditmyuploads.php, douploadfile.php, download.php, editcategories.php, editdownloads.php, editmyuploads.php, getdownload.php, index.php, updatedownload.php, updateupload.php, uploadfile.php

Credits: Dslam for suggesting this addon.

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.


Here is what I believe to be a good working copy.
Attachments
56942-FileDownloadPage_v1.0.zip (0 Bytes, 114 downloads)

Sponsored Links
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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..

Thanks for the good mods lately!

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Nice one! I'll definitely try this one out as soon as I've updated my own mods.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Very cool.
I might check this out this weekend, as I'm thinking about a use for this for Video Files on my site.
Thanks.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Yes, very nice

I agree with Jeremy, categories would be a very nice next step


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
Cool deal thanks

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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.

Last edited by Aglavalin; 09/20/2002 3:15 PM.
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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)
);


Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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.
Attachments
56968-FileDownloadPage_v1.1.txt (0 Bytes, 200 downloads)

Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
she's a working great
thanks
if your runing ipp5 the pal menu does not work .
so remove it or find a way to fix it .

Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Aug 2002
Posts: 37
User
User
Offline
Joined: Aug 2002
Posts: 37
I am trying out this mod but not sure I understand this line:

$palspath = "c:/inetpub/wwwroot/YOURDOMAIN.COM/pals/";

"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?

I havent even gotten to that issue yet

Thanks in advance

Lerosia




[:"red}Ifyouwanttomakeyourcomputergoreally,reallyfast,thowitoutthewindow[/color"]
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Here are some answers for you:
  1. 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.
  2. 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".
  3. 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.
  4. 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
  5. 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.

Joined: Aug 2002
Posts: 37
User
User
Offline
Joined: Aug 2002
Posts: 37
AHHHH..no wonder I couldnt figure it out.

This should teach me a valuable lesson about *BETA*



Thank you Gardener..I will check out the IIP as well


Lerosia


[:"red}Ifyouwanttomakeyourcomputergoreally,reallyfast,thowitoutthewindow[/color"]
Joined: Jun 2001
Posts: 176
Member
Member
Offline
Joined: Jun 2001
Posts: 176
this download addon works fine .
if you don't have ipp then you have to open each page & edit out the calls to the menupal


Joined: Oct 2001
Posts: 157
Member
Member
Offline
Joined: Oct 2001
Posts: 157
OK Josh, saw you online right after I posted the suggestion, reading this. So am here too. Silly me

Reading it too...


Yors Truly

Who? Me? Worry?
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
he he

That's OK - this is an old one - took me a bit to dig it up, but I thought I remembered it.

Joined: Apr 2002
Posts: 474
Enthusiast
Enthusiast
Offline
Joined: Apr 2002
Posts: 474
Ok I added this and it doesn't work So now I want to get rid of it and undo the database changes... How do i do this?

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Delete those tables in your database

You can use phpmyadmin http://www.phpmyadmin.net or any other brand you use

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Anybody running this on 6.4?

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
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.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
getting errors myself

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

Kelly #224855 03/01/2004 5:20 PM
Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
sql idiot here but it looks like

DL_CatOrder isn't in the w3t_Dlcat

I browsed the database and don't see that hiding in there. Is that right?

Last edited by Smilesforu; 03/01/2004 5:21 PM.
Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
That's what it looks like to me. If you add that field it should get rid of that error.

Then you can troubleshoot the next error that pops up.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
How do I add it? I am sql stupid

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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...

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
its for this mod beyond that I am clueless

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
According to this command

CREATE TABLE w3t_Dlcat ( DL_CategoryName varchar(30) NOT NULL, DL_CatOrder tinyint(3) Default '0' NOT NULL, KEY DL_CategoryName (DL_CategoryName));

I used that command but it didn't work properly?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
I ran both.. page comes up but it generates errors on the page. So far the only error I get is the one I posted above

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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..

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
yup I have cpanel phpMyAdmin and IIp (but the newer version)

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
ok then use phpMyAdmin and see if the w3t_Dlcat was created

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
ok I just added this to my test board and I will have to say the instructions are wropng.. you need to sql this table not the opne in the instructions

CREATE TABLE w3t_Dlcat (
DL_CategoryName varchar(30) NOT NULL,
DL_CatOrder tinyint(3) Default '0' NOT NULL,
KEY DL_CategoryName (DL_CategoryName)
);

secondly I would use Allen's code check

change

if (!strpos($user['U_Groups'],$dlgroup)) {

to this, in all pages:

if (strpos($user['U_Groups'],$dlgroup) === false) {


lastly it's Beta and thus needs some work...

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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...
Attachments
109169-downloaddirectory.zip (0 Bytes, 48 downloads)

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Appreciate the help.. I gave it a whirl tonight and got the same errors hmm.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
I deleted and am going to just use the iip and private forums.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)