Gossamer Forum
Home : Gossamer Threads Inc. : Custom Modification Jobs :

Logo Graphic Upload / Display mod

Quote Reply
Logo Graphic Upload / Display mod
I have a pretty working Logo_Graphic upload & dsplay mod. It's plug-in compatible, meaning it's using the same plug-in config file that the larger mod will be using. It is not an automatic install yet, I'm hoping soon.

It _DOES_ require you to install Image::Size (available from CPAN).

It takes a field you specify (default is Logo_Graphic) and you add it to the add.html and add_success.html

You add a few lines to add.cgi, and copy the UploadFile.pm to the Plugins directory. You need to _CAREFULLY_ edit the Plugins.cfg file to add this as as recognized plugin. It's just a cut/paste, but you must do it carefully! (this uses no hooks, so it doesn't need to be "installed" per se -- but it's how this suite of modules will upgrade easily).

It checks the uploaded file for a Known type -- jpg, gif, png -- and if it passes, it checks the file size, to be less than the height/width you specify. (It can be set to allow any or all of those extensions).

It uploads to a temp directory you specify (use one out of the server tree, and you can erase any partial files there with impunity).

It then renames the file to ID.ext and moves it to the specified image directory.

To call the file you just use a tag <%image_directory%>/<%Logo_Graphic%>

Once you set up your templates, and fix add.cgi, the only updates to this program should be in the UploadFile.pm Just copy the new one over the old one.


Caveats:
1) I'm pretty sure this only works on unix at the moment
2) I 'mv' file, so the directories have to be on the same device.
(this will become the File::Copy command for portability)
3) It's probably got bugs, and no frills, but it's an alpha 1 release, and will go through a lot of changes.
4) This will remain a 'separate' mod, for people who just want to add a logo or small image to their links, and assign it a priority. (for now, just having a file name in the Logo_Graphic field can make it sort above others).
5) It will upgrade into the larger mods -- ie: upload any file, photo-gallery, etc.
6) It will allow your links to look like the http://postcardsportal.com in the featured supporters area.

Because most of the calls are hard coded, it only does one file at a time, and only allows one file per link, and is pretty much totally stripped of all the good features of the larger mods <G>, I'm going to put an "easy" price on this sucker of $25 with free upgrades. That means buy once, and you can download forever (as long as I keep working on the stuff). Figure, once it's finished, the only real changes will be if subsequent versions of Links require them.

In the future:
1) hopefully it will be a plug-in
2) it will allow user-modify and full managment solutions to the images.

Summary:

Module: UploadGraphic.pm
Price : $25 USD
Upgrades: Free
Features:
1) Upload a file to a specified upload directory, and attach it to the link via ID number.
2) Checks for a valid, known file type -- gif, jpg, or png -- and reads this information from the file itself _not_ the file extension.
3) Checks for file size, and can reject files that are too wide or too high.
4) unix only at this time
5) Will upgrade into the more robust packages


Coming Soon to this mod:
1) modify and delete the attached graphic file
2) install or upgrade as a plug-in
3) non-unix platforms to be supported


The larger mods will also add:
1) thumbnailing (resizing uploaded images)
2) gallery management
3) postcards script
4) non-graphics file uploads (text, sounds, pdf, etc)
5) multiple file uploads to each link
6) Files viewable by user (not only by link)
7) much more.


[Note: The upload puts the file into the images directory when the link is added, not validated. If you delete the validation, you'll have to delete the file manually for now (next version should get that). But, if you don't report the LinkID to the user until their link has been validated, there is no way for them to know the file name of the image to let people download it, so it's reasonably secure -- and how bad could an invisible small file be?]

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Subject Author Views Date
Thread Logo Graphic Upload / Display mod pugdog 4641 Jan 12, 2001, 10:16 PM
Post Re: Logo Graphic Upload / Display mod
padders 4465 Jan 13, 2001, 12:42 AM
Post Re: Logo Graphic Upload / Display mod
pugdog 4474 Jan 13, 2001, 5:39 AM