php forum
php mysql forum
php mysql smarty
 
Page 1 of 2 1 2 >
Topic Options
#224833 - 09/20/02 02:31 AM File Download Page v1.0
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Mod Name / Version - File Download Page v1.0<br /><br />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.<br /><br />Example - http://www.newoutriders.org/downloads/index.php<br /><br />Pre-requisites - none<br /><br />Author - Aglavalin, aka Steve Stout<br /><br />Files Altered - config.inc.php<br /><br />Database Altered - Only two tables are created, thus, very removable.<br /><br />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<br /><br />Credits: Dslam for suggesting this addon.<br /><br />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.<br /><br /><br />Here is what I believe to be a good working copy.


Attachments
56942-FileDownloadPage_v1.0.zip (102 downloads)


Top
#224834 - 09/20/02 09:29 AM Re: File Download Page v1.0 [Re: neuron]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
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.. <br /><br />Thanks for the good mods lately!

Top
#224835 - 09/20/02 09:41 AM Re: File Download Page v1.0 [Re: neuron]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1954
Loc: Sweden, Uppsala
Nice one! I'll definitely try this one out as soon as I've updated my own mods.
_________________________
/Gardener | Complete list of my mods

Top
#224836 - 09/20/02 10:37 AM Re: File Download Page v1.0 [Re: c0bra]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Very cool.<br />I might check this out this weekend, as I'm thinking about a use for this for Video Files on my site. <img src="/forum/images/icons/smile.gif" alt="" /><br />Thanks.
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#224837 - 09/20/02 11:56 AM Re: File Download Page v1.0 [Re: Daine]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25365
Loc: Texas
Yes, very nice <img src="/forum/images/icons/laugh.gif" alt="" /><br /><br />I agree with Jeremy, categories would be a very nice next step <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#224838 - 09/20/02 02:38 PM Re: File Download Page v1.0 [Re: SurfMinister]
Dslam Offline
Member

Registered: 06/05/01
Posts: 246
Loc: USA
Cool deal thanks <img src="/forum/images/icons/smile.gif" alt="" />

Top
#224839 - 09/20/02 03:03 PM Re: File Download Page v1.0 [Re: interforos]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
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. <br /> <br />This addon ended up being quite massive, so I had to set some limits to get it done! LOL <br /> <br />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. <br /> <br />Please let me know what else this addon could use, maybe I'll add it next version.


Edited by Aglavalin (09/20/02 03:15 PM)

Top
#224840 - 09/20/02 03:44 PM Re: File Download Page v1.0 [Re: neuron]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
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!<br /><br />The second table creation syntax should be:<br /><br /><pre><font class="small">code:</font><hr><br />CREATE TABLE w3t_Dlcat (<br /> DL_CategoryName varchar(30) NOT NULL,<br /> DL_CatOrder tinyint(3) Default '0' NOT NULL,<br /> KEY DL_CategoryName (DL_CategoryName)<br />);<br /></pre><hr>

Top
#224841 - 09/20/02 04:00 PM Re: File Download Page v1.0 [Re: neuron]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Updated directions with a fix to the second table creation syntax.<br /><br />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.<br /><br />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 (96 downloads)


Top
#224842 - 09/20/02 06:06 PM Re: File Download Page v1.0 [Re: neuron]
Dslam Offline
Member

Registered: 06/05/01
Posts: 246
Loc: USA
she's a working great <img src="/forum/images/icons/grin.gif" alt="" /> <br />thanks <br />if your runing ipp5 the pal menu does not work .<br />so remove it or find a way to fix it .<br />

Top
#224843 - 11/17/02 08:50 PM Re: File Download Page v1.0 [Re: neuron]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1954
Loc: Sweden, Uppsala
I just made a trial installation of this, finally, and found some minor caveats.<br /><br />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?<br /><br />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:<br /><br /> if (!strpos($user['U_Groups'],$dlgroup)) {<br /><br />to this, in all pages:<br /><br /> if (strpos($user['U_Groups'],$dlgroup) === false) {<br /><br /><br />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. =]<br /><br /><br />I think it might be a good idea to add the updated instructions to the main package in the first post of this thread.
_________________________
/Gardener | Complete list of my mods

Top
#224844 - 12/03/02 09:46 AM Re: File Download Page v1.0 [Re: c0bra]
Lerosia Offline
User

Registered: 08/20/02
Posts: 37
Loc: Vancouver
I am trying out this mod but not sure I understand this line:<br /><br /> $palspath = "c:/inetpub/wwwroot/YOURDOMAIN.COM/pals/";<br /><br />"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."<br /><br /><br />Question 1 What is IIP 4.3?<br /><br />Question 2 What is a palspath?<br /><br /> 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? <br /><br />What would I be using for menu/page layout in UBBT?<br /><br />Question 4 In the line: $config['dlgroup'] = "5";<br /><br />What the heck does 5 represent?<br /><br />So, before I complete this one, is the a new version with Gardener's minor caveat suggestions above?<br /><br />I havent even gotten to that issue yet <img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />Thanks in advance<br /><br />Lerosia<br /><br /><br />
_________________________
[:"red}Ifyouwanttomakeyourcomputergoreally,reallyfast,thowitoutthewindow[/color"]

Top
#224845 - 12/03/02 10:22 AM Re: File Download Page v1.0 [Re: Calis]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1954
Loc: Sweden, Uppsala
Here are some answers for you:<br />
  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.<br />
  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".<br />
  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.<br />
  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:<br />select * from w3t_Groups<br />
  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.<br />
_________________________
/Gardener | Complete list of my mods

Top
#224846 - 12/03/02 05:44 PM Re: File Download Page v1.0 [Re: c0bra]
Lerosia Offline
User

Registered: 08/20/02
Posts: 37
Loc: Vancouver
AHHHH..no wonder I couldnt figure it out.<br /><br />This should teach me a valuable lesson about *BETA*<br /><br /><img src="/forum/images/graemlins/smile.gif" alt="" /><br /><br />Thank you Gardener..I will check out the IIP as well<br /><br /><br />Lerosia
_________________________
[:"red}Ifyouwanttomakeyourcomputergoreally,reallyfast,thowitoutthewindow[/color"]

Top
#224847 - 12/03/02 08:36 PM Re: File Download Page v1.0 [Re: Calis]
Dslam Offline
Member

Registered: 06/05/01
Posts: 246
Loc: USA
this download addon works fine .<br />if you don't have ipp then you have to open each page & edit out the calls to the menupal <br /><br />

Top
#224848 - 06/21/03 01:28 AM Re: File Download Page v1.0 [Re: neuron]
yors Offline
Member

Registered: 10/09/01
Posts: 152
OK Josh, saw you online right after I posted the suggestion, reading this. So am here too. Silly me <img src="/forum/images/graemlins/tongue.gif" alt="" /><br /><br />Reading it too...
_________________________
Yors Truly

Who? Me? Worry?

Top
#224849 - 06/21/03 01:28 AM Re: File Download Page v1.0 [Re: phill]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
he he<br /><br />That's OK - this is an old one - took me a bit to dig it up, but I thought I remembered it. <img src="/forum/images/graemlins/wink.gif" alt="" />
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top
#224850 - 07/04/03 02:05 PM Re: File Download Page v1.0 [Re: Daine]
oceanwest Offline
Enthusiast

Registered: 04/25/02
Posts: 490
Loc: Escondido, CA
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?
_________________________
FM Forums
Largest Online FileMaker Community
http://www.fmforums.com

Top
#224851 - 07/04/03 04:44 PM Re: File Download Page v1.0 [Re: sdf123]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Delete those tables in your database <img src="/forum/images/graemlins/wink.gif" alt="" /><br /><br />You can use phpmyadmin http://www.phpmyadmin.net or any other brand you use
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#224852 - 02/16/04 01:50 AM Re: File Download Page v1.0 [Re: sf49rminer]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
Anybody running this on 6.4?

Top
#224853 - 02/26/04 07:52 PM Re: File Download Page v1.0 [Re: Kelly]
DrChaos Offline
Coder

Registered: 09/12/03
Posts: 816
Loc: Hollywood Florida.
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.
_________________________
DrChaos
LeetGamers

Top
#224854 - 03/01/04 01:05 AM Re: File Download Page v1.0 [Re: Duck]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
getting errors myself<br /><br />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 <br />Unknown column 'DL_CatOrder' in 'field list'<br />Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /....../ubbthreads/mysql.inc.php on line 160<br />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 <br />Unknown column 'DL_CatOrder' in 'field list'<br />Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /............/ubbthreads/mysql.inc.php on line 160

Top
#224855 - 03/01/04 04:20 PM help with mysql error? [Re: Kelly]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
sql idiot here but it looks like <br /> <br />DL_CatOrder isn't in the w3t_Dlcat <br /> <br />I browsed the database and don't see that hiding in there. Is that right?


Edited by Smilesforu (03/01/04 04:21 PM)

Top
#224856 - 03/01/04 04:55 PM Re: help with mysql error? [Re: Kelly]
slayer60 Offline
Junior Member

Registered: 06/14/03
Posts: 1185
Loc: New Boston, NH
That's what it looks like to me. If you add that field it should get rid of that error.<br /><br />Then you can troubleshoot the next error that pops up. <img src="http://www.ubbdev.com/forum/images/graemlins/evil.gif" alt="" />

Top
#224857 - 03/01/04 05:01 PM Re: help with mysql error? [Re: BrokenToy]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
How do I add it? I am sql stupid

Top
#224858 - 03/01/04 05:03 PM Re: help with mysql error? [Re: Kelly]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
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...
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#224859 - 03/01/04 05:19 PM Re: help with mysql error? [Re: 234234]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
its for this mod beyond that I am clueless

Top
#224860 - 03/01/04 05:21 PM Re: help with mysql error? [Re: Kelly]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
According to this command<br /><br />CREATE TABLE w3t_Dlcat ( DL_CategoryName varchar(30) NOT NULL, DL_CatOrder tinyint(3) Default '0' NOT NULL, KEY DL_CategoryName (DL_CategoryName));<br /><br />I used that command but it didn't work properly?

Top
#224861 - 03/01/04 05:37 PM Re: help with mysql error? [Re: Kelly]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
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.
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#224862 - 03/02/04 03:05 AM Re: help with mysql error? [Re: 234234]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
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

Top
#224863 - 03/02/04 07:43 AM Re: help with mysql error? [Re: Kelly]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
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..
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#224864 - 03/02/04 02:53 PM Re: help with mysql error? [Re: 234234]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
yup I have cpanel phpMyAdmin and IIp (but the newer version)

Top
#224865 - 03/02/04 03:10 PM Re: help with mysql error? [Re: Kelly]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
ok then use phpMyAdmin and see if the w3t_Dlcat was created <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#224866 - 03/02/04 04:47 PM Re: help with mysql error? [Re: 234234]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
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<br /><br />CREATE TABLE w3t_Dlcat (<br /> DL_CategoryName varchar(30) NOT NULL,<br /> DL_CatOrder tinyint(3) Default '0' NOT NULL,<br /> KEY DL_CategoryName (DL_CategoryName)<br />);<br /><br />secondly I would use Allen's code check<br /><br />change <br /><br /> if (!strpos($user['U_Groups'],$dlgroup)) {<br /><br />to this, in all pages:<br /><br />if (strpos($user['U_Groups'],$dlgroup) === false) {<br /><br /><br />lastly it's Beta and thus needs some work...
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#224867 - 03/02/04 06:11 PM Re: help with mysql error? [Re: 234234]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
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 (42 downloads)

_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#224868 - 03/03/04 02:39 AM Re: help with mysql error? [Re: 234234]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
Appreciate the help.. I gave it a whirl tonight and got the same errors hmm. <img src="http://www.ubbdev.com/forum/images/graemlins/confused.gif" alt="" />

Top
#224869 - 03/03/04 04:05 AM Re: help with mysql error? [Re: Kelly]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
I deleted and am going to just use the iip and private forums.

Top
Page 1 of 2 1 2 >