Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Image Gallery/Picture Post 2 (demo)

Quote Reply
Image Gallery/Picture Post 2 (demo)
I have worked out enough bugs (and secured the demo site) to release this page.

DO NOT expect it to work all the time. This is a _pre_alpha_ site in many ways, and I might be debugging, transferring, or otherwise working on files that will cause the site to not work, or to spit out copicious amounts of annoying data.

If you get an error, wait a few minutes, and try again. You might have to hold down the shift key and hit refresh. Please don't abuse it, since it writes _major_ amounts of log data.

http://postcards.com/...bin/DP_Test/page.cgi

This site rotates the various template sets and options randomly.

Suggestions and features are welcome. Please see the other thread with the same name, for more information and how to help.

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


Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
BTW... Close inspection of what was really going on my system, shows that I am most likely _not_ using ImageMagick for anything <sigh>

And I spent literally days trying to get that installed.

None of the programs I am running I thought was using it, are. They are all using internal routines, or helper utilities from the various standards orgs.

That makes installation of this even easier.

Good news for you, bummer reality check for me.

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


Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
that is good news for me :) i don't want to have to install it, but i am guessing you are not going to be able to do automatical thumbnails (for uploading to the database) without imagemagik... imagefolio never found away so there is a challenge pugdog :) hehe.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
The challenge has been met. That's not the problem :)

I'm doing it now, i just _thought_ I was doing it through IM, and I'm not.

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


Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
arr. that is excellent news.. (maybe not for you!) means far more likely i can get it to work!

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
Wauw Pugdog
thats exactly something I want
this also with more images in each link, and this option for registered users, and it's complete




Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
Just a couple of errors for you....

There seems to be a "1" at the top of category pages and a few unknown tag errors too.

ooops.....and this:

A fatal error has occured:

Invalid method: site_html_step4 (step4.html)

Please enable debugging in setup for more details.




I know you are only in pre-alpha stage but it is helpful for you to debug!

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
Same thing I told eliot....

Lot's of debugging code. I don't have duplicate postcards machinery, for a number of really good reasons. But if it makes it to step2, which is the step before step 4, it will work when moved to the live site.

FWIW the '1' is a random number that is either 0 or 1 and let's me know which template set it's using.

The missing tags are site-specific, and are not specific to that site.

It will be cleaned up once I get the upload code working. Right now, things are still too early to do anything with.


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


Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
Sorry...as I said...I realise you are in the early stages but was just letting you know!

Only trying to be helpful ;)

Paul Wilson. Shocked
(Dont blame me if I'm wrong!)
Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
Uploads are working!

Not working well, but they are working! With a little luck, I might have it all smoothed out tonight or by monday.

Uploads need to be:

1) uploaded with all the necessary information
2) moved from the temp directory to the pre-view directory
3) properly entered into the database/link record such that all info is there.
4) properly "deleted" when/if the link is deleted.

Multiple image attachments, or file attachments, per link are on the "to do" list, but probably will wait until Alex/GT decides what the format for the Links SQL program will be. For the image-post-gallery mod here, each image _is_ a link, so multiple images per link doesn't really make any sense -- except in the context I proposed previously -- different formats of the same image, using alphabetic extensions on the numeric ID.

This is going faster than I thought. (I guess two years of planning paid off <G>). I should have a reasonably final alpha in a week. What I might do is offer that to anyone who wants to get in on it for half the anticipated release cost, plus free lifetime upgrades (where we'll probably do the 1 year/same version upgrades free, new major version is additional cost for the release).

It looks like it will be some code changes, a few additional scripts and templates, and some "understanding" of what is going on to make this version work. The 2.0 version will _hopefully_ be able to be done as a plug-in, requiring minimal code changes (most likely just the "hook").

I'm actually very excited about this :) It's also a chunk of code that will go with the auction/shopping software to thumbnail the products. Cool, huh? <G>




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


Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
In case anyone is wondering:

Code:
open (OUTFILE, ">$tempdir/$filename");
while (my $bytesread = read($file, my $buffer, 1024)) {
print OUTFILE $buffer;
}
close (OUTFILE);
Is the minimum code necessary to successfully upload a file.

Currently, the upload script is over 250 lines (not all code, of course) and the upload subroutine is over 100 lines. 90% of that is error checking and other "good housekeeping" functions, but I'm not done yet -- and haven't really added in _any_ LinkSQL code (ie:database reading, writing, saving, or anything else). I'd hate to see where I'd be if this was going 'slow' <G>



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


Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
BTW... I'm adding in the old BBS functions of keeping track of the number of files uploaded, and the total bytes uploaded. I'll also keep track of bytes/files deleted and bytes/files rejected. (But not right away). After all, what fun is an SQL database if you can't really stress it <G>

I know some people are going to ask for that stuff eventually.

Also, I may add in code for limiting uploads... but remember, the first version is only going to be a picture post/image gallery program, so "attachments" are not really going to be supported in the logic (but the hooks are there).



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


Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
In Reply To:
Also, I may add in code for limiting uploads
Depending on how you have structured the "Postcard" table, if you have a USERID field, you should be able to check the number of postcards uploaded via COUNTING the total number of records by the USERID field, couldn't you?

Regards,

Eliot Lee
Quote Reply
Re: Image Gallery/Picture Post 2 (demo) In reply to
That's sort of backwards of how the postcards table works, but the idea is right.

The postcards table is really a database of "sent" cards. It's all the information to create a "postcard" but not a "postcard" itself.

The Links database is where all the postcards (images & keywords, etc) are stored, in the current version. That may change, depending on if it's easier to add a table, and join it, or just increase the size of the database record.

This is really expanding into a "database" as I've started to track/link all sorts of data on the sending/getting of cards. And now, I have to track the uploading as well -- before only the system admins were uploading.

To track the number of uploads, you'd look again at Links database, and check the "owner" field. If that gets pulled out, it will still be the same idea... but in order to have a functioning postcards.cgi service, the "postcards" database (table) is only tracking cards sent (and the statistics surrounding them). (Minimal changes to the functioning of links.)

To build something with these complex relations, you've got to define your objects, and what attributes are attached to those objects.

For example:

A "postcard" is not an image, it's a collection of data that includes an image -- such as to, from, names, emails, text, colors, etc.

An "image" can be incorporated into a postcard, but it can also be incorporated into the gallery. An image has to have an 'owner' - which is the uploader, or in the case of the admin upload, whomever they set it to. It has other information such as copyright, keywords, descriptions, perhaps the # of times it was sent or viewed, etc. The owner links it to the users table.

The user table has all the user information, but doesn't need any of the data that can be linked to via the Username field.

For speed, the user record should contain the users statistics, but those can be re-generated from the log (for deleted files) or from the current database for current standings. With careful programming, this 'rebuild' ability shouldn't really even be needed in disaster recovery. In essence, that means it's data-redundant, but it allows for a significant speed boost to show user stats, already calculated rather than calcuated on the fly each time.

right now I've got multiple uploads working. I'm starting to integrate it all into the LinkSQL system now.

As I do that, I'll probably find more data relations that need some sort of rules applied to them.

Right now, the data relations are by Username and LinkID.

A file is attached to a LinkID, which is in turn a "record" in the database, and that is linked to the User-data via the "owner" field.

This allows a Linkowner to find all their links, a link to find the link owner, and a link to find the image, and an image to find a link and thus the owner.

I need to build in some sort of 'expunge' system to get rid of aborted or cancelled uploads. This is somewhat trickier that it would seem, since if you want a well-rounded data system, the uploaded files should be able to be linked back to the uploading user, even if the user is disconnected before finishing. They should be prompted to "finsh adding" their files on the next log-in.

This means the temporary/upload filename has to point to the user in some way. This is important too, because the LinkID is not assigned until the record is inserted in to the Links database.

Even though this should happen quickly, on loaded systems, or with a interupt called, this can be a several seconds process.

upload -> validate file name -> validate file -> put info into hash -> enter hash into database -> rename file to ID -> move file to 'preview'.

You don't want to upload directly to your preview area, since you'd like to fairly safely be able to delete your 'temp' directory without affecting successfully entered files.

If the record is succesfully entered into the "validate" or "pending" database, and the file doesn't get moved (due to an error, crash, or whatever) you have a 'broken' record, but the data _should_ be available to correct it. That means storing the temporary filename in the "pending" record, until the record is approved.

Lot's of little things :)

As I pointed out -- file upload is about 4 or 5 lines of code. Right now I've got multiple file uploads working, but all it does is take the files from the local machine, and upload them to the 'temp' directory. All the data manipulation and SQL insertions have yet to be coded.

Fortunately, that should be straight forward ... the GT modules make it easy :) But it's a lot of code and processes to keep an eye on.


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