Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

[UPDATE] Logo upload rewrite

Quote Reply
[UPDATE] Logo upload rewrite
I'm in the process of finishing up a rewrite of the logo upload system.

It's using the new "default" template set for a cleaner look, it addresses some problems in naming conventions, and a host of other issues including better admin/validation features.

This will be updated again when the new links "file" type is added, although it might not be necessary. Almost certainly, the extra step here will still give you more features and control.

Most are going to be transparent to the users, but as a webmaster you might have to make some changes if you are running a previous version. I'll have better install instructions with the next release, but I would caution anyone looking to upgrade, to contact me first. The major change would be the "Logo_Graphic" and "image_url" fields have been changed to "Logo_Image" and "Logo_image_url", and I really would suggest renaming your existing database fields and template fields to the new names for compatibility. There are fairly painless ways to do it, but it will lead to less problems in the future.

Right now, the only templates that should need changing are the add_ and modif_ templates, depending on your situation, and the form.txt file if you are using it. If you are using form.txt, you might only need to modify the modify.html templates. This might only be as much as changing <%includ link.html%> to <%include modify_link.html%>

The rest of the system uses it's own templates.

There are two fully working tags <%Logo_Validated%> and <%Logo_Show%> that will allow you to set up a system to show or not show logos based on a number of different parameters.

The <%Logo_Validated%> tag means you've approved the logo for public display. It's not offensive, or against the rules of your site. This only needs to be done once per logo.

The <%Logo_Show%> tag will allow you to use any other system -- including an automated system -- to show or not show the logo -- if it's been validated. This allows you to use an advertising, banner, or ther system to charge for placement on a time limited or # of impressions bases in an automated way.

This plugin doesn't do any of that, but by adding this flag field, it allows for this capability. The admin can manually set or unset this flag, and can set the default values for it.

Once this is finished, the Graphic UPload will follow in a day or two, since it will mostly be replacing the "Logo" with "Graphic" in all the files.

The multiple file upload is almost done, and once these templates are finished, it is just a matter of debugging the system before release.

Took a lot longer, but it's almost done. :) Then on to the reviews.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
That sounds great. Love the program BTW, it works flawlessly for our site.

I do have one minor problem though, in my current installation I get the LinkID number in the "Logo_Graphic" field every time a person adds a link to my site. I'm not sure if my field is set right, or if this is the add.cgi program. I just have to remember to delete this number from the field when I add the link to my database, so it's not a big deal.

Will that be fixed in this version?

Bryan

Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
I'll check it, and make sure, but that is not a problem I've had. It might have been a template problem, which is why I renamed certain fields, and switched to the new set.

With this set, you can just cut out the "content" area, and paste it into your own templates.

There were other problems, which have been fixed, and the replace feature has been updated to work a bit more intelligently for static sites.




PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
Any chance I could get the latest version of this pugdog?

I'm still using the first release. Have I been added to your mailing list yet?

Cheers
R.

Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
If I send this out, you'd have a heck of a time integrating it. Because of the changes that had to be made, until I get all the tweaks working, it will proabably just drive you mad. Seriously.

I'm on my second site install, getting the FAQ site to work. I also changed the template sets there, and will probably offer a bunch of different formats.

I'll try to install the plug-in 2 or 3 more times on other sites. If I can get a site working with no "bugs" the first time around, then I'll release this. This last install was only about a half dozen template tweaks. With any luck, the next install will be bug free (at least major bug free) and then I can distribute it.

The admin features are still being updated, but that is only annoying, not maddening :)

There were 5 completely different "starts" on this program. If you follow the threads here for the past 6 months, there have been some major changes, changes to links, etc, that caused the program to be re-thought several times. Loads of legacy code is still in there, and while I've cut out about 30% of it, there is still more to get cut. Actually, adding features will result in a smalle code footprint :)

Because of that, I had lots of variables and template tags that did nothing but cause confusion with each other.

The main assumption change now is, that a link _must_ be added before you can attach a logo or image to it. Rather than try to play games with getting the ID from links, allowing links to just add the link, then request the ID, is the easiest way, and most portable. Loads of bugs and problems went away with this simple assumption.

That means loads of code got cut out, and things got much simpler.

This will fit nicely with the new links "Filetype" since links will be able to upload/handle a file on initial upload, then pass it to the plug-in for post processing. Or, you can use the plugin to upload the files.

To allow users to edit "un validated" links (Which should really be a part of links) all you do is change one line in modify.cgi.

The included templates also provide a lot more information on the status of the link -- validated/not validated, graphic show, graphic none, graphic validted, etc.

I think people will like this upgrade :)

Give me another 24 hours or so before release. It will be worth the wait --- you'll probably save that much in frustration :)

If you just absolutely can't wait, try the FAQ.... it is 98% working, I'm making final tweaks on it now, and hopefully it will finished by the AM.


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
re: ID in graphics field.

This is definitely fixed.

If you disable the "add_link" pre and post hooks, which I dont' think are used any more, you can avoid it.

Actually, if you are using the very first version, that is probably the main problem. I made a major logic change 2x since then, and by moving everything into UploadLogo.cgi (attach.cgi in the previous version) all these problems went away :)

I forgot to cut those out. The only hooks needed are modify and site_html (display) hooks, since everything else goes through the UploadLogo.cgi script.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
Ah ok - no problem, I'll wait.

Cheers
R.


Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
Once we get this new plug-in, how would you recommend that we install it?

My instinct would be to delete all of the old files, including attach.cgi and all the old attach_ templates and just let the new plug-in install what it needs.

I would leave the fields as they are, since they contain filenames that are in use. Renaming them if necesarry as per your instructions.

Does that sound like a good plan?

Bryan

Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
I'll have full instructions, but essentially, that is the best way to do it.

If you've customized your added-in templates make a backup up, but in general, uninstall the plug in, delete the attach.cgi and attach*.html files (if your copy installed a backup directory you can leave it or delete it).

What will happen is it will install new fields. Depending on your situation, the fields may be different.

But, issuing a command:

update prefix_Links
set Logo_Image = Logo_Graphic

Will do the biggest update, then delete the Logo_Graphic column.
Same for the xTsize/yTsize which are now Logo_xTsize and Logo_yTsize.
Logo_Size is used, but Show_Logo or Show_Graphic is now Logo_Show,
and Graphic_Validated is now Logo_Validated.

In reality, you could avoid all this by changing the defaults, but
then you'd have to edit all the templates. It's easier to make 6 changes
to the database, then 100's of changes to the templates.

While the software doesn't care what the columns and fields are called, there is a hash-mapping of that, the Templates _do_ care. They need to know the VALUES of the KEY fields (a hard-coded sort of thing), so they need to know the names of the database fields. No way around this in the current implementations, or really would it be worth trying to get around it.

I'm compiling a list of changes that need to be made, and after the next install or two, I should have the complete list. All are minor.

link.html needs to have <%image_url%> changed to <%Logo_image_url%>, and <%Logo_Graphic%> changed to <%Logo_Image%> stuff like that.

I'll make a few changes to the Install program to add the modified templates to the backup directory (modify_link.html, modify.html, etc) that way you can chose to copy them to your new directory, or just edit the changes into your existing templates.

The thing that has kept tripping me up is the change from Logo_Graphic to Logo_Image -- and I really do suggest moving the image fields in your database, then deletly the Logo_Graphic field (This wil catch about 90% of the template errors!!).

Once I deleted that field from the Links table, I caught all the errors immediately.

I should have this out later tonight. It's going well :)

Check out the FAQ site, try adding al ink with a small logo, then going to Modify to see how it works.

Any errors, let me know.

I consider that site "working" (although the admin features are missing a few connections still to be made -- you won't see those <G>).



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: [UPDATE] Logo upload rewrite In reply to
Ok, I'm ready to release UploadLogo.tar Version 01.03.03, as a test version. It's installed for me without problems, and the template changes seem pretty straight forward. There are problably small bugs that will turn up, and the admin features are still not 100% connected.

Still to do: set defaults for Logo_Show and Logo_Validated, and improve the Admin control

Other than that, I think it's finished.

The UploadGraphic.tar 02.03.0x will be out shortly. That one is designed to allow uploads to the body of the link (and has the template set for that).


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum