UBB.Dev
Posted By: drkknght boards-based image upload - 01/28/2005 1:06 AM
i'm looking for a way to ease up on the ftp process i always go through.

i'd like to add a field just above the subject name field, where i could browse for an image on my hard drive to upload to my server (same server the boards share)

this would be for admin's only (me!)

is possible?
Posted By: Anno Re: boards-based image upload - 01/28/2005 1:50 AM
http://www.google.at/search?q=php+image+upload

if you add the boards authentification to this, you have what you want.
Posted By: Anno Re: boards-based image upload - 01/28/2005 2:18 AM
Or this:
http://www.blazonry.com/scripting/upload-size.phps
Posted By: drkknght Re: boards-based image upload - 01/28/2005 4:26 AM
ok!

i found this tute pretty helpful. and i even got it working already, here

some questions:

1) is it possible to set up so that the final destination is not fixed? like, sometimes i'd like an image to be placed in "/uploads/baseball/" and other times times "/uploads/hockey/". do i have to create a seperate upload for each?

2) how can i set this up so that its only viewable to admins? (i'm the only admin)
Posted By: Anno Re: boards-based image upload - 01/28/2005 11:26 AM
> /uploads/baseball/" and other times times "/uploads/hockey/

Instead of hardcoding the directory, put a variable in there and populate it using a dropdown menu.
Look at the jumpmenu at the bottom right of this page to see the concept.


2) Include this at the top of the script

// Require the library
require ("./includes/main.inc.php");
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Groups");
$html = new html;
// Make sure they should be here
if ( $user['U_Status'] != 'Administrator') {
$html -> not_right ("Only admins can use this script",$Cat);
}
© UBB.Developers