Gossamer Forum
Home : Products : DBMan : Customization :

Image Gallery

(Page 2 of 3)
> > > >
Quote Reply
Re: Image Gallery In reply to
I'm not sure if that would work or not. You could give it a try.

You might try contacting the site owner of the other site for both permission to do what you want and information about how to do it.


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





Quote Reply
Re: Image Gallery In reply to
I don't want to sound negative here, but my thoughts would be unless you have permission from the site owner you should not even consider automatically using the functions of their script from your site.

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

As stated in the faq it uses alot of virtual memory to store the graphic while it is being manipulated. So when you state that:

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

The interaction comes with their server resources being used to store the image (mega-bytes) while it's doing the work of making the thumbnails. It would have to interact to work with the image Smile And the image is stored on their server until the time set for automatic deletion.

I also believe by using a link to this site within your script may be a copyright violation. They may also have the script setup to only allow it to be run from their server (or hopefully they do) using referrers or some other means.

If say you had a form processing script, would you want anyone in need of such a function to link into your script to have it run 100's of forms using your server resources? Just an example of course.

I would think your best bet would be to provide a link to this site so that you can direct your users to a location where THEY can create their own thumbnail image and then upload it to your server.

The same way you would direct people to an online service that will optimize their graphics.

This way credit is given where it is due, you wouldn't be violating copyright, avoid a possible law suit, etc.

I really hope this didn't come off as being negative but you should always think carefully before using the work of others in any means.
Quote Reply
Re: Image Gallery In reply to
I really think the best thing to do would be to contact the owner of the site. There is an "Email" button at the bottom of the page which sends you to an online form. Ask him or her if it is possible and if it would be all right for you do it it. The worst he or she can say is "No."


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





Quote Reply
Re: Image Gallery In reply to
I'll emsil them tomorrow, Lets see what they say!!
Quote Reply
Re: Image Gallery In reply to
 Smile No, I think I followed that.

I'm glad you asked. And I'm pleased at the response you got, even if it didn't work out for you.

Okay. Regarding uploading to one directory and displaying from another one. No problemo.

You're using the file-upload mod, right? Set the $SAVE_DIRECTORY to your big_pic_temp directory.

Add four more variables to your .cfg file:

$BIG_PIC_DIR = the path to your big_pic directory;
$BIG_PIC_URL = the url to your big_pic directory;
$SML_PIC_DIR = the path to your small_pic directory;
$SML_PIC_URL = the url to your small_pic directory;

In sub html_record (short display), use

Code:
if (-e "$SML_PIC_DIR/$rec{$db_key}.$extension") {
print qq|<img src= "$SML_PIC_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}

In sub html_record_long (your long display), use

Code:
if (-e "$BIG_PIC_DIR/$rec{$db_key}.$extension") {
print qq|<img src= "$BIG_PIC_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}

I think that should work. (Famous last words!! Smile )


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





Quote Reply
Re: Image Gallery In reply to
Cheers!

Before I try this, and get myself confused I think i need to do/ask two things:

1) I want to use the DBMan templates mod, as I said in a previous post, alongside the long&short mod. Did you take a look at this to see if there are likely to be any probs? If not I will add the templates then copy the short&mod changes over to the template version of html.pl.....

2)

>>UNVALIDATED record links to image in big_pic_temp (so I can check it) but once VALIDATED record will show the image in sml_pic of the short view and links to the big_pic via a URL in long view?

e.g: for short view

UNVALIDATED(hidden)
|--------------------------|
|--link to big_pic_temp----|
|--rest of details---------|


VALIDATED
|--shows sml_pic---|
|--and rest of info---|
|-and link to big pic-|


Smile


[This message has been edited by benseb (edited April 04, 2000).]

[This message has been edited by benseb (edited April 04, 2000).]
Quote Reply
Re: Image Gallery In reply to
Heeeelo?

Carol, Eliot, Whoever.... any Ideas??! Cheers Wink


[This message has been edited by benseb (edited April 04, 2000).]
Quote Reply
Re: Image Gallery In reply to
The outcome is.... they did agree to me using their site, but I found they only have a 56Kb connection to the internet from their server!!

So that Idea was scrapped!!

What do you think about this:
1) User adds record, and uploads large image

2) Large image stored in 'big_pic_temp' directory, and record suspended for validation.

3)The record will have one link -pointing to to the image in big_pic, and a thumbnail picture which shows on the short display.

3) I download the new pics in the big_pic_temp directory and *offline* simply run a batch conversion (works in about 3 secs!) to create thumbnails.

4)Thumbnails in snall_pic, others in big_pic

Would not be a hassle, as once a week I simply run the batch conversion for any new records at the same time as validation Shame I can;t do this online though!

Whats the best way to go about implementing this? Obviously the 'big_pic' would have to be uploaded to the big_pic_temp directory, but the link created for the record pointing to the big_pic directory.


Cheers!

Ben (I've confused everyone now have'nt I Wink )
Quote Reply
Re: Image Gallery In reply to
Sorry. I was up until almost 6am last night (this morning) and I gotta sleep sometime! Smile

I'm afraid I can't help you with templates. It's all Greek to me.

Regarding the unvalidated records and pictures:

In sub html_record_long, change

Code:
if (-e "$BIG_PIC_DIR/$rec{$db_key}.$extension") {
print qq|<img src= "$BIG_PIC_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}

to

Code:
if ($per_admin & ($rec{'Validated'} eq "No")) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}
}
else {
if (-e "$BIG_PIC_DIR/$rec{$db_key}.$extension") {
print qq|<img src= "$BIG_PIC_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}
}

This is assuming that your validation field is called "Validated" and that non-validated records have "No" in that field.


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





Quote Reply
Re: Image Gallery In reply to
I'll give it a go!
Cheers!



------------------
Ben

-------------------------
http:/www.t-e.co.uk
Quote Reply
Re: Image Gallery In reply to
JPD,

Can you clarify this bit, as I did not add anything to my html_record_long (only short!)
Code:
if (-e "$BIG_PIC_DIR/$rec{$db_key}.$extension") { print qq|<img src= "$BIG_PIC_URL/$rec{$db_key}.$extension">|; last GRAPHIC;}
<HR></BLOCKQUOTE>

Should this be in html_record or _html_record_long

and where! I would like the image to appear in the top row of the record table

Cheers!


[This message has been edited by benseb (edited April 05, 2000).]
Quote Reply
Re: Image Gallery In reply to
The last bit of code I gave you is to display the "big picture," which I think you want in your sub html_record_long.

You have, I'm sure, something like this:

Code:
print qq|
<table>
<tr><td>Some label</td>
<td>$rec{'Some field'}</td>
...
</table>
|;

Yes?

If so, change it to:

Code:
print qq|
<table>|;
if ($per_admin & ($rec{'Validated'} eq "No")) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<tr><td colspan=2><img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension"></td></tr>|;
last GRAPHIC;
}
}
else {
if (-e "$BIG_PIC_DIR/$rec{$db_key}.$extension") {
print qq|<tr><td colspan=2><img src= "$BIG_PIC_URL/$rec{$db_key}.$extension"></td></tr>|;
last GRAPHIC;
}
}
print qq|
<tr><td>Some label</td>
<td>$rec{'Some field'}</td>
...
</table>
|;

I added the table cell tags in with the display of the photos. I'm assuming that your table is mostly two columns wide, which is why I used "colspan=2" for the cells. If your table is only one cell wide, delete that part in the cell tags.


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





Quote Reply
Re: Image Gallery In reply to
Carol...
I know you're there! Any ideas? Sorry to push, but I have about 10 mins left of my connection!... i'm off soon!
Quote Reply
Re: Image Gallery In reply to
Hi!

I can't seem to get the last bit of code you gave me to work. Rather than post my html.pl here (forum is slow already!) Ive put it at http://www.travel-experiences.com/db/html.txt

Ive changed it slightly to give the LINK to the image. I have record 3 as VALIDATED, with an image in big_pic and one one in big_pic_temp also. If you need to look, default.txt is also available at the above url.


Ben
Quote Reply
Re: Image Gallery In reply to
I'm sorry, but I was not online at the time you posted your message. I had a lot of errands to run today and I didn't get online until much later than usual. (BTW, I'm not usually on until after noon anyway. I tend to stay up pretty late.)

Try adding

$rec{$db_key} =~ s/<.?B>//g;

to sub html_record_long, just after

my (%rec) = @_;

That could fix things.


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






Quote Reply
Re: Image Gallery In reply to
hi JPDeni,
Could you tell me where to get the "Matchmake mod"?? or any other mod that works the same...??


Thanks
Quote Reply
Re: Image Gallery In reply to
JPD:
Hmmm...

Didn't seem to work!

Any other ideas? I went through the process from scratch with a new user and new record. The small file is OK, just not the large one!

johnsonny:
Resource centre...search for 'Match maker' in DBMan mods
------------------
Ben

-------------------------
http:/www.t-e.co.uk



[This message has been edited by benseb (edited April 07, 2000).]
Quote Reply
Re: Image Gallery In reply to
If the small picture shows up, then we know that the syntax for displaying the graphic is okay, since the syntax is the same for the large picture.

Question: Does the link show up in the long display when you are logged in as admin and the record has not been validated?


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






Quote Reply
Re: Image Gallery In reply to
No, I only see an image in short dispaly (ie the sml_pic.) I have never seen anything in long display.

------------------
Ben

-------------------------
http:/www.t-e.co.uk

Quote Reply
Re: Image Gallery In reply to
OK,
I removed
Code:
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension")
and got a step closer. The link appeared, followed by an error saying "last GRAPHIC was undefined."

When I clicked on the link produced (good!), it took me to www.blah.com/big_pic/6. <--note no extension!!! This is the problem! It can't validate the file because the extension in not working! I checked the syntax against the sml_pic, and it seems the same?

[This message has been edited by benseb (edited April 07, 2000).]
Quote Reply
Re: Image Gallery In reply to
I finally figured it out. I guess I was unclear about the code you need to add. Use this:

Code:
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
GRAPHIC: foreach $extension (@extensions) {
if ($per_admin & ($rec{'Validated'} eq "No")) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<a href="$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">Click here to see large image</a> |;
last GRAPHIC;
}
}
else {
if (-e "$BIG_PIC_DIR/$rec{$db_key}.$extension") {
print qq|<a href="$BIG_PIC_URL/$rec{$db_key}.$extension">Click here to see large image</a>|;
last GRAPHIC;
}
}
}

A bit of miscommunication here. Smile


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






Quote Reply
Re: Image Gallery In reply to
I too had been looking for a library like this forever and could not find it. So I hired a perl developer that I have worked with before and I think he has turned out generally what you are looking for. His next step is to turn his changes into a package that can be distributed for dbman that does not break the copyrights, meaning does not include their code. In any case look at this and see if this is what you require and I could probably turn you on to him if you still need assistance. http://www.darkarena.com/imagelibrary.html

He did have a time with the thumbnails and now we have to workout a backout routine for the two step process of adding the record, then upping the image, so that if it fails after adding the record then everything is removed.

MoTives
motives@darkarena.com
Quote Reply
Re: Image Gallery In reply to
Any chance he could create a freely available mod for this? The whole file-upload thing has been a nightmare for me since the beginning.


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






Quote Reply
Re: Image Gallery In reply to
Hey!!

It works Wink

I'll start customising everything now, but all the grunt work is over!

Thanks again!




------------------
Ben

-------------------------
http:/www.t-e.co.uk

Quote Reply
Re: Image Gallery In reply to
Actually I'm sorry, he doesn't work for free, this mod has cost me quite a bit, kinda makes me wonder why I do this...lol I never stand to make any money off this but I had to have it done right. If you are intersted in customization I would be glad to give you his contact info, he's busy as hell but he does an awesome job! He's got a few things to finish up on mine but it's just about complete, it's in a fully functional state now. So basically, it seems, if you know what you are doing anything is possible, this task was just over my head...
> > > >