Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Real Image path please

Quote Reply
Real Image path please
Please anybody help to get the real image path

Iīve found an global from linkssql that does that

sub {
my $tags = shift;
my $file = $DB->table('Links')->file_info('banner', $tags->{ID}) or return "Link ID $tags->{ID} does not have a file attached.";
return $file->File_RelativePath();
}

Can anybody help to make this work in dbmansql

It will be very usefull for a lot of people as I see in this forum
Quote Reply
Re: [assombracao] Real Image path please In reply to
Hi

Gossamer Staff send me this global, but I canīt get this work at all but Iīm sharing it anyway




Here is template global:

sub {
my ($table, $image_col, $id) = @_;
my $file = $DB->table($table)->file_info($image_col, $id) or return "ID
$id does not have a file attached.";
return $file->File_RelativePath();
}

The tag should look like:

<%global_name('Sample', 'picture', '10')%>

Hope that helps.

Bao.


Last edited by:

TheStone: Aug 25, 2005, 9:25 AM
Quote Reply
Re: [assombracao] Real Image path please In reply to
   
Hi, itīs almost there

sub {
my ($table, $image_col, $id) = @_;
my $file = $DB->table($table)->file_info($image_col, $id) or return "ID
$id does not have a file attached.";
return $file->File_RelativePath();
}

call it

<%global_name('Sample', 'picture', '10')%>

The only problem is that I canīt get the id to be automaticaly, I need to chance the '10' to the id of the record
Quote Reply
Re: [assombracao] Real Image path please In reply to
Real Image Path Working!

sub {
my ($table, $image_col, $id) = @_;
my $file = $DB->table($table)->file_info($image_col, $id) or return "ID
$id does not have a file attached.";
return $file->File_RelativePath();
}

call it

<%global_name('Sample', 'picture', '$id')%>