Gossamer Forum
Home : Products : DBMan : Customization :

Image Gallery

(Page 3 of 3)
> >
Quote Reply
Re: Image Gallery In reply to
Well,

I looked at your site and as far as the user side goes it works nearly exactly the same as my version. I think the differences may come on the back end. Do you have a way of automatically creating the thumbnails from larger images or do you do this offline?

If you want, you can see mine. Its very ugly at the moment. I'll let you have the url if you are interested once ive changed the admin password!



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

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

Quote Reply
Re: Image Gallery In reply to
Ok...

Ive now added the Validate & date translator mods which work great!

One small Q though. On the upload_success screen, the record is usually displayed to confirm upload success. However, as we have now told the db not to show unvalidated entries, nothing is shown.

I would like it to be unvalidated, yet still show a confirmation of the record.

Is this poss?

Thanks for your help Carol, I do realy appreciate it!


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

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

Quote Reply
Re: Image Gallery In reply to
Ain't that the way it goes? You fix one problem and come up with another one. Smile

Try changing

Code:
if ($per_admin & ($rec{'Validated'} eq "No")) {

to

Code:
if (($per_admin & ($rec{'Validated'} eq "No") or ($in{$db_cols[$auth_user_field]} eq $db_userid)) {

That might do it.


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






Quote Reply
Re: Image Gallery In reply to
My developer used :

'HTMLThumbnail', written by Benjamin Franz, snowhare@nihongo.org

to do the thumbnail routine and used:

# File Upload Script Version 6.00
# Created by Jeff Carnahan jeffc@terminalp.com
# Created on: 4/8/95 Last Modified on: 01/23/98 23:06
# Scripts Archive: http://www.terminalp.com/scripts/
#
# Modified to be compatible with DBMan by Carol Thatcher Hall
# Last modified date: 29 Jun 1999

for the uploads, he modified the fileupload.cgi so that it builds the thumbnails after success.

I'll be glad to get you the thumbnail script if you like, just email me at motives@darkarena.com

MoTives

------------------
Everyone has a Dark Side
Quote Reply
Re: Image Gallery In reply to
I found the script at http://www.nihongo.org/...il/htmlthumbnail.txt . It says there are a couple of other things that must be present. He gives the ftp url for them, but I haven't looked into them as yet.



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






Quote Reply
Re: Image Gallery In reply to
Thanks!

Unfortunately, because I dont have my own server, and this prog requires an install into the server root, I won't get very far! Its the same principle as ImageMagick.

It might help someone else who has their own server though!


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

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

Quote Reply
Re: Image Gallery In reply to
I just trie to add the 'OR is user' statement above, which should have been quite easy!

Unfortunately I get
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") or ($in{$db_cols[$auth_user_field]} eq $db_userid)) {
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;
}
}
}


can you spot the error? Wink



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

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



[This message has been edited by benseb (edited April 11, 2000).]
Quote Reply
Re: Image Gallery In reply to
I missed a parenthesis.

It should be

Code:
if (($per_admin & ($rec{'Validated'} eq "No")) or ($in{$db_cols[$auth_user_field]} eq $db_userid)) {



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






Quote Reply
Re: Image Gallery In reply to
Hi Again!
Just had a thought Wink . When the record is deleted, I will need to delete the associated images. There will be one in BIG_PIC and one in SML_PIC. Any ideas?

Cheers!!!!


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

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

Quote Reply
Re: Image Gallery In reply to
Boy, I wish you folks would quit thinking!! (This is a joke!!!!)

You would have changed sub delete_records in the db.cgi script when you installed the file upload mod. You should have the following:

Code:
if ($delete_list{$data[$db_key_pos]}) { # if this id is one we want to delete
$delete_list{$data[$db_key_pos]} = 0; # then mark it deleted and don't print it to the new database.
if ($db_upload) {
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
foreach $extension (@extensions) {
(-e "$SAVE_DIRECTORY/$data[$db_key_pos].$extension") && (unlink "$SAVE_DIRECTORY/$data[$db_key_pos].$extension")
}
}
}
else { $output .= $line . "\n"; }

You need to change it to

Code:
if ($delete_list{$data[$db_key_pos]}) { # if this id is one we want to delete
$delete_list{$data[$db_key_pos]} = 0; # then mark it deleted and don't print it to the new database.
if ($db_upload) {
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
foreach $extension (@extensions) {
(-e "$SAVE_DIRECTORY/$data[$db_key_pos].$extension") && (unlink "$SAVE_DIRECTORY/$data[$db_key_pos].$extension")
}
foreach $extension (@extensions) {
(-e "$SML_PIC_DIR/$data[$db_key_pos].$extension") && (unlink "$SML_PIC_DIR/$data[$db_key_pos].$extension")
}
foreach $extension (@extensions) {
(-e "$BIG_PIC_DIR/$data[$db_key_pos].$extension") && (unlink "$BIG_PIC_DIR/$data[$db_key_pos].$extension")
}

}
}
else { $output .= $line . "\n"; }

That'll delete the corresponding file from all three directories, if it exists.


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






Quote Reply
Re: Image Gallery In reply to
I get the feelign I should have hired JPDeni to do mine..LOL maybe would have been cheaper... Smile

MoTives

------------------
Everyone has a Dark Side
Quote Reply
Re: Image Gallery In reply to
Works a treat! Smile

Cheers!
Quote Reply
Re: Image Gallery In reply to
JPD,

Going back to the uploaded image if OWNER or ADMIN, it doesn't seem to work - thought it was workingm byt obviously not!

I'm on the upload_success screen. the record shows, but not the image

Ideas?




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

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

Quote Reply
Re: Image Gallery In reply to
Does it not show when you are logged in as admin, as owner or both?


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






Quote Reply
Re: Image Gallery In reply to
Wow....just had a major Syntax error and I couldn't find it anywhere! In the end it was a stray |; !

Anyway, I can view the image as ADMIN but not the user who added the image.

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

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

Quote Reply
Re: Image Gallery In reply to
Okay. Time for a little debugging.

In sub html_upload_success, add the following:

Code:
print qq|
\$db_userid = $db_userid<BR>
\$auth_user_field =$auth_user_field<BR>
Userid field name = $db_cols[$auth_user_field]<BR>
Userid for record = $in{$db_cols[$auth_user_field]}
|;

What you should get is as follows:
the login name of the current user
the number of the userid field
the name of the userid field
the login name of the current user

Let me know what you get.


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






Quote Reply
Re: Image Gallery In reply to
I get:

$db_userid = testuser1
$auth_user_field =9
Userid field name = Userid
Userid for record =

Cheers


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

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

Quote Reply
Re: Image Gallery In reply to
Ah-ha! That tells me a lot. Smile

It tells me that the userid field is not being passed. So we need to pass it.

In file_upload.cgi, after

$newfilename = param('newfilename');

add

Code:
$db_userid) = $db_uid =~ /([A-Za-z0-9]+)\.\d+/;

and change

Code:
$SUCCESS_LOCATION = "$db_script_link_url&$db_key=$rec{$db_key}&upload_success=1";

to

Code:
$SUCCESS_LOCATION = "$db_script_link_url&$db_key=$rec{$db_key}&upload_success=1&Userid=$db_userid";

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






Quote Reply
Re: Image Gallery In reply to
Cheers! Works Great!

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

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

> >