Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

How to show a pic for cat

Quote Reply
How to show a pic for cat
Hi all, to improve the handling of the site, i try to have a field for uploading a pic for every cat.
The problem now is to show it.

For links i use this:

Code:
sub {
my ($rec) = @_;
my $id = $rec->{ID};

if ($rec->{File1}) {
my $links_db = $DB->table('Links');
my $fh = $links_db->file_info( 'File1', $id );
my $location = $fh->File_RelativePath;
if ($fh->File_Name =~ /\.(jpg|gif)$/) {
return qq~ <img src="/imgup$location"> ~;
}
else {
return "Invalid file name.";
}
}
else {return "";}
}


So i have to change the db and the name of the column.
But what´s with

my ($rec) = @_;
my $id = $rec->{ID};


is it $rec ?
then $rec->{what} ?

Robert
Subject Author Views Date
Thread How to show a pic for cat Robert 2955 May 7, 2002, 9:48 AM
Thread Re: [Robert] How to show a pic for cat
Paul 2844 May 7, 2002, 9:51 AM
Thread Re: [Paul] How to show a pic for cat
Robert 2827 May 7, 2002, 10:11 AM
Thread Re: [Robert] How to show a pic for cat
minesite 2829 May 7, 2002, 2:14 PM
Post Re: [minesite] How to show a pic for cat
Robert 2806 May 8, 2002, 2:43 AM