Gossamer Forum
Home : Products : DBMan : Installation :

How do you display the graphic?

Quote Reply
How do you display the graphic?
I went to http://www.jpdeni.com/dbman/Mods/file-upload.txt to allow users to upload their photos along with their profile. Everything works well (the graphic gets put to the directory, etc), except I don't understand where to put this:

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

|; # to close off a previous print qq| statement
$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|<img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">|;
last GRAPHIC;
}
}
print qq|

You can run the script at http://www.andrews.edu/...man/db.cgi?db=alumni and you can see my html.pl file at http://www.andrews.edu/AIM/alumni.txt . Where would I add that perl code to the html.pl file for the graphic to appear above the right record? Thanks for your help.

Nelson
Quote Reply
Re: How do you display the graphic? In reply to
First you would need to add a field for the image within your .cfg file.

Then in your sub html_record_form you would also need to add the field name.

Then to view the image you would insert the code provided by JPDeni into sub html_record.

The actual placement would depend on your layout, but you would add it where you want the graphic to appear.

For example if it will just be on a line by itself after the description and the field is called "graphic":

<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Description:</FONT></TD><TD> <$font>$rec{'Description'}</Font></TD& gt;</TR>
|;
$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|<TR><TD colspan=2><img src= "$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension"></TD></TR>|;
last GRAPHIC;
}
}
print qq|

<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Validated:</FONT></TD><TD> <$font>$rec{'Validated'}</Font></TD>& lt;/TR>


Hope this helps Smile
Quote Reply
Re: How do you display the graphic? In reply to
This is an accidental duplicate thread. The discussion is going on at http://www.gossamer-threads.com/...um5/HTML/002114.html .


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