[CHANGE IN LOGIC] Upload Graphic/Logo plug-in
pugdog
After struggling for far too long to make this work as a "plugin" using the "hooks", I'm giving up, and will create a stand-alone script that manages the attachments.
You will still be able to upload a graphic with the initial submission, but all validation, maintennance, and further work will go through the external "attach.cgi".
This script will use your links-user rights to determine what you are allowed to do, as well as an additional set of rights.
In your templates, two new fields will be added to the Link record - "ShowGraphic" and "ValidGraphic". These are flags, such that "ShowGraphic" means the user is a _allowed_ to attach a graphic to their record, and to have it displayed _IF_ the "ValidGraphic" flag is also set. This gives the admin the ability to either "auto approve" if they want the user to have that ability, or to delay approval until they review it. All other fields, existing images, etc will stay the same. This should be completely compatible with previous versions, and finally add all the features people have requested.
You use <%if%> tags to display the graphics with the links. You can sort on the "ValidGraphic" field, or you can set separate priority fields -- that is up to you.
You can use an <%if%> tag to recognize admins, and let them validate or manage graphics from the site, or allow a link owner to modify their own graphics.
If you don't use dynamic site generation, you'll need to modify the "modify" forms, to show "add/delete/modify" graphics options to the user when they see a list of their links.
Anyway, after two months of fighting the plug-in system, it just can't be done reliably with the limited number of hooks. This program needs to use Admin hooks, and they just aren't there. In order to work by the plug-in system, it needs to make too many changes to "links" that just are not possible. By taking the whole process "out" of the links chain of command, into a separate script and set of functions, it's much easier to do, to make work, and to add in all sorts of features reliably.
It will be sort of a mini-version of the Browser commands, and sort of a baby step towards the Review system.
Because there will be one script in control, there won't be any collisions, and because the fields will be part of the links record, Links will handle them "normally" once they are properly added/managed.
This is best all around, and with luck, this version will be out any day for beta1 testing. The mangement features will improve as I get feedback and as time goes on, but all the upload/add/change/delete features will be there.
I've had them written, I just could not make them work with the current logic. I started ending up in 2 and 3 levels of template nesting, and that was absurd! This is clean, simple, and while not what I had planned, it's probably the best course of action to take.
Look for this no later than mid week.
Price remains the same.... The multiple-attachment version will follow shortly there-after, since this new logic will make it much easier to do. The only "hooks" will be adding the attach-list to the display hash. Hopefully, that is an easy trick!
Sorry for the delays, but there have been problems with the logic of trying to make it work as a set of "hooks" and I had some disruptions in "the real world" here. Over all, I think this will be the best solution, and it leads nicely into the other programs.
The "plugin" feature is more of a way of installing, and setting Links variables, than adding code. Maybe that is the way to look at it for now.
PUGDOG� Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum