Gossamer Forum
Home : Products : DBMan : Customization :

Image Gallery

(Page 1 of 3)
> >
Quote Reply
Image Gallery
Sorry, know it has been asked for before BUT
is there a finished, working mod to turn DBMan into a gallery, with upload capability, etc.

I've looked at the Matchmake mod & upload, but I need to be able to just have:

*A thumbnail (click though to larger image)
*Description
*Author
*Ability to create different sections for different categories (one for each continent)
*Upload by user mod


Help! I presume the Matchmake mod is pretty much there, but just need a few alterations!

You can see what I use at the moment at http://www.t-e.co.uk/photos and click on the Random 100 link.


Ben
Quote Reply
Re: Image Gallery In reply to
I have no idea of how to create a thumbnail from an uploaded graphic. I think such things are possible, but require certain Perl libraries to which I have no access.

At present the file upload mod only allows one upload per record. I know that a couple of people have modified the upload mod to allow for multiple uploads per file. You might try searching the forum for "multiple upload." (I don't know exactly what you'll find because the search function seems to be having a little problem as I write this.)

I guess I should go look at the Matchmaker Mod. Hang on. I'll be back.

Well, I downloaded and unzipped it, but I'm not sure what special things it does.

I'm not sure what you mean by

Quote:
*Ability to create different sections for different categories (one for each continent)

The Description and Author would just be fields for you to define in your .cfg file.



------------------
JPD





Quote Reply
Re: Image Gallery In reply to
Thanks JPD

Basically, I just need a way that images can be shown on a page (with the ability for users to upload images themselves with their descriptions. I would like to create different pages for different continents.

I thought of two ways:
1) JUST THE IMAGES are shown on one page. By clicking through, the author, description, etc are shown with a LINK to the larger image (could just be like a URL field filled in by visitor), so the first image links to the record details

2) A collection of full records, BUT with very short descriptions etc so I can fit perhaps 20 photos per page.

I thought about using Links 2.0 but I think this is more suitable - its really a links style dbman format I want!


Cheers!
Have I confused everyone?
Quote Reply
Re: Image Gallery In reply to
Have you installed the demo DBMan files? If not, do that first.

Have you worked out the fields you want and installed your own .cfg file? That's the next thing you need to do.

After you get those things done, we can work on file uploading.


------------------
JPD





Quote Reply
Re: Image Gallery In reply to
OK,

the test db is up.
I have added fields for Country (instead of category) and Name, and removed type.

I noticed in a previous thread that by using the short&long mod, it is possible to have the search results JUST show a condensed record (in this case a THUMBNAIL and country), which will click through to the long record(s).

Should this be my next move - to install the long and short mod?


Bben
Quote Reply
Re: Image Gallery In reply to
I've just added the upload mod (JPD's)

I get the following after adding a record and pressing the upload button for an image. The upload is successful as the URL says

&upload_success=1

THE ERROR IS:
Code:
###############################################################################
# If you only want those with "admin" permission to be able to upload #
# remove the # from the beginning of the following line #

# }

&html_footer;

print qq|
</td></tr>
</table>
</center>
</body>
</html>
|;
}

The debug printout has no errors.
Cheers!

Ben


.... THE IMAGE IS UPLOADED AND IT WORKS OK. ITS ONLY THE SUCCESS PAGE THAT SEEMS TO BE BUGGY....

[This message has been edited by benseb (edited March 29, 2000).]
Quote Reply
Re: Image Gallery In reply to
Jim,

Any ideas?????




Quote Reply
Re: Image Gallery In reply to
Regarding the upload success script, did you add the following line to db.cgi:

Code:
elsif ($in{'upload_success'}) { &html_upload_success; }

If your fields are exactly as you want them to end up, then installing the short/long mod would probably be the way to go.


------------------
JPD





Quote Reply
Re: Image Gallery In reply to
I placed this here:

Code:
# If we allow users to signup, and they want to, go to the signup form.
elsif ($auth_signup and $in{'signup_form'}) {
&html_signup_form;
}
elsif ($auth_signup and $in{'signup'}) {
&signup;
}
elsif ($in{'upload_success'}) {
&html_upload_success;

Ben

Quote Reply
Re: Image Gallery In reply to
I guess I need to be clearer in my instructions. You need to put it up further in the script -- in with all the other lines that start with

Code:
elsif ($in{'....



------------------
JPD





Quote Reply
Re: Image Gallery In reply to
OK,

Cheers Smile
Works now. Instructions were a little unclear Wink

NOW........
AS far as my fields go, can you see any obvious ommisions:
ID
Name (of author)
Title (of image)
Date (of entry)
Country (huge pull down list!)
Description
URL ( **IS THIS NEEDED TO LINK TO LARGER IMAGE?**)
VALIDATED (** IS THIS NEEDED ANYWHERE BY DBMAN? IDONT NEED IT!)
UserID

If these seem logical I will try to install the Long/Short.

One Q:
Should I install the friendly_html first? What about the changes I made to html.pl for the upload mod? How will these fit in?


Ben

Quote Reply
Re: Image Gallery In reply to
You don't need the Validated field. In fact, you don't need any of the specific fields that are in the demo script. Just put in what you want.

As far as the URL field goes, it depends on what you're going to do. Will the larger picture be on a remote site? If so, you need to keep the field.

If the larger picture is going to be on your server, how will you determine the name of the graphic file? If the name will correspond to the $db_key value of the record, you won't need a field. If it will have a different name, you will need a field to enter the name of the picture file.

The short/long mod is a version of the "user-friendly" mod. No need to install "user-friendly."

I would have probably installed the short/long mod before installing the file upload, but that's probably because I know that file upload is more complicated and I like to do things in order of increasing complexity. Smile

You will need to transfer the subroutines you used for the file upload to the short/long mod. The html subroutines for file upload are not in "user-friendly" format, but they will work just fine. If you want to adjust them later, I'll be glad to help.



------------------
JPD





Quote Reply
Re: Image Gallery In reply to
Great,

Just two things,

On the UPLOAD SUCCESS page there is no clear 'next' link: The clickable link that is the TITLE just refreshes the page with the image on.

and,

On using VIEW ALL, the images are all displayed first, then the titles underneath! I know this is a simple fiddle! Could there be two columns like this:

|---------| |---------|
|---IMG---| |--IMG----|
title title

|---------| |---------|
|---IMG---| |--IMG----|
title title


will I be able to do this easily by fiddling the html? Wink


NOW FOR A BIGGER Q:
Where the long record displays (cool!) instead of the URL, is it possible to bring up the image?

What do you think? And as I pay for my webspace i think i will link to external photos (I have 20Mb, but just to be sure!) so does this make things easier??

Cheers!

Ben


[This message has been edited by benseb (edited March 29, 2000).]
Quote Reply
Re: Image Gallery In reply to
 
Code:
for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}

to

Code:
print "<table>";
for (0 .. $numhits - 1) {
unless ($_ % 2) {
print "<tr>";
}
print "<td>";
&html_record (&array_to_hash($_, @hits));
print "</td>";
if ($_ % 2) {
print "</tr>";
}
}
if (($numhits-1) % 2) {
print "<td></td></tr>";
}

Code:
<img src="$rec{'URL'}">

That should pull the file from the remote server. (Just be sure that your users know you're going to do this, as it will increase the traffic on their server rather dramatically.)

And, in keeping with good html practice, you might also want to have an ALT tag:

Code:
<img src="$rec{'URL'}" ALT="$rec{'Title'}">


------------------
JPD





Quote Reply
Re: Image Gallery In reply to
Cheers for that! I was busy replying to me!

Just been thinking Wink

If I will be displaying only the smaller version of the image (ie the uploaded version) on the short display, I will need to make this *REQUIRED* not optional. Not much point in a thumbnail gallery with no thumbnails...?

AND In addition to my previous Q, if people need to submit a thumbnail, this may mean them having to go and alter the image to make it the right size. Otherwise the short display will have different size images.

So... 1) Will defining IMG size tags for the thumbnails slow the display down too much (ie the browser resizes (ouch!) )

or 2) DOES anyone else know a way of autothumbnailing an image?

[This message has been edited by benseb (edited March 29, 2000).]
Quote Reply
Re: Image Gallery In reply to
I'm not sure you can require an upload. I wouldn't know how to do it. Since the uploaded files don't write directly to the database, I just don't know how to manage it.

I don't know how much resizing the images would slow down the browser. With any luck, someone with more expertise in that area will know.


------------------
JPD





Quote Reply
Re: Image Gallery In reply to
Might just have a friend in the know......
Quote Reply
Re: Image Gallery In reply to
Just my opinion, but it's not a good idea to have the browser resize the graphic for you, as it can really mess up the display of the graphic and may cause the page to load much slower Smile

What I would do is make sure that your users are aware of the size requirements for loading graphics. Then you could set the image to display using the set height and width tags. Plus as JPDeni stated, using the ALT tag as well.

Having a definate size set within the link will help your page load faster as it can then display the text while waiting for the graphics to load.

Just a suggestion, but I always insist that when people submit graphics that they also meet the images byte size requirements. Usually less then 5K for small graphics and 10K max. for say 300 x 300 graphics.

And then I provide a link on my help/faq pages to http://www.gifcruncher.com/ so they can optimize their graphics to load quickly.
By the way this site also optimizes .jpg files Smile
Quote Reply
Re: Image Gallery In reply to
OK,

Ive been recommended to use the following library 'ImageMigik'. Ive found the site:

http://www.wizards.dupont.com/cristy/www/perl.html

and downloaded the files, but don't really know where to start to integrate them Wink

I've applied for Telnet access from my host (might take a while!) so that I can install these...........can you pel buffs give me a hand? Smile


Ben
Quote Reply
Re: Image Gallery In reply to
You're way outside my league now! Smile

I've looked at ImageMagik, too, and wondered what the heck to do with it.

You might ask in the Perl/CGI forum. The real hardcore Perl gurus hang out there. Smile


------------------
JPD





Quote Reply
Re: Image Gallery In reply to
Ok,

Ive posting in the perl forum. Lets see what the gurus come up with Wink

I think this could be quite useful for lots of DBMan projects (classfied ads, etc.)

Ben
Quote Reply
Re: Image Gallery In reply to
Absolutely. It would be great. I just don't know anything about it myself.

Please post in here if you get a good response in the Perl/CGI forum so we'll know to go take a look.


------------------
JPD





Quote Reply
Re: Image Gallery In reply to
Just downloaded ImageMagick. For a perl file its hige (5Mb!) but now I know why....

although this prog lets you do anything you can do in 'paintshop' through perl it requires hundreds of custom modules to be installed. I don't think my hosting company will be too pleased at that Wink

So, I need an alternative. Basically:

How can a user show their photos online. I need files to be small in order for page to load fast and to show lots of entries. At the same time a larger image must be available to see. I don't want users to have to create thumbnails though, as they will not have these ready, and my database will be empty!

Any smart ideas? Is there an online thumbnail generator site that I can have pop-up (not without lots of advertising, having to logon, etc. I think!)

Anyone seen anything or have any ideas????


Ben

PS JPD: Look forward to hearing your views on the template use for long/short
Quote Reply
Re: Image Gallery In reply to
There are several sites that allow people to shrink the size of graphic files, but I don't know of any that will create thumbnails.

(I know what you mean about the size of ImageMagick. They also suggest allowing 80M of space for working with files. I didn't bother even asking my ISP to add it.)

Wait a minute! I found a site!!!

http://www.imagemagick.org/...ts/MagickStudio.cgi/

You enter the URL of an image (or browse your local hard drive), it loads the image and then you can do a whole lot of things with it.

I just chose "Resize," which then gave me a "thumnail" option. Then I clicked "Output" and it allowed me to save the file to my hard drive. It can even upload to a website, but that looks kinda complicated.

This is pretty cool stuff!

You might need to have a help file for folks who are unfamiliar with some of the terminology, but this seems completely doable.


------------------
JPD





Quote Reply
Re: Image Gallery In reply to
OK!!!!! You the 'Man' !!!!!

I like a challenge so..... Could the user:

1) Upload full size image (with a simple size restraint as set in the upload mod)

2) Using the file locations given, we could pass this to the magick script to do some work

3) Store the 'magicked' smaller version on my server and use this as the thumbnail

This way the ser would not interact with the magick site. Only prob is...do Magick have an issue with this Wink

FYI: The file to call would be for example:
Code:
http://www.imagemagick.org/cristy/MagickStudio/scripts/MagickStudio.cgi/?File=/pathos/web-docs//cristy/MagickStudio/images/rose.jpg&Ac tion=view

Ben (happy Smile )
> >