Gossamer Forum
Home : Products : DBMan : Customization :

Upload mod

Quote Reply
Upload mod
I have installed the upload mod. but the problem however is that when a user doesn't upload a picture, there's an empty space (broken picture icon). I want to have a default picture showing if none is uploaded.

Is that possible?



Regards
Trond-R. BÝ
Quote Reply
Re: Upload mod In reply to
The solution is within the mod:

# If you *DO NOT* require users to upload a graphic and would like a default graphic to appear if no graphic has been uploaded, after the lines you added above, add
#
#|;
#unless ($graphic_found) {
# print qq|<img src="http://full/url/to/default_graphic.gif">|;
#}
#print qq|

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Upload mod In reply to
Thankyou. I'll try it out and get back to you if I get more complications :)


Regards
Trond-R. BÝ
Quote Reply
Re: Upload mod In reply to
Um - I'm not sure about where to put that in...

Could you please clear it up a little?


Regards
Trond-R. BÝ
Quote Reply
Re: Upload mod In reply to
It goes after

Code:

### Wherever you want your graphic to print out, use the following:

|; # to close off a previous print qq| statement
opendir (GRAPHIC, "$SAVE_DIRECTORY") or &cgierr("unable to open directory in delete records: $SAVE_DIRECTORY. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
$file_test = $rec{$db_key};
foreach $file (@files) {
if ($file =~ /^$file_test\./) {
print qq|<img src= "$SAVE_DIRECTORY_URL/$file">|;
$graphic_found=1;
}
}
JPD
http://www.jpdeni.com/dbman/