Gossamer Forum
Home : Products : DBMan : Customization :

Images and link Question

Quote Reply
Images and link Question
Hi all
I have installed the image/file upload mod.This works fine, however i want to be able to add a link to the image instead of displayng the image associated with the record. I know i can add the link manually to a field within the record. I want to be able to have the link added to a field automatically each time i upload an image/file.
Can this be done ????
How?????
Regards Andy

Quote Reply
Re: Images and link Question In reply to
Pretty easy.. just replace your exsisting test for the image with this:

Code:
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
GRAPHIC: foreach $extension (@extensions) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|<p><a href="$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">Click for an image!</a>|;
last GRAPHIC;
}
}



------------------
The Crowe crowe@charter.net
www.lit.org Links Engine for Writing on the net!