Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Image column with php possible?

Quote Reply
Image column with php possible?
Hi!


I successfully created the table for images and in globals -> default_php I added "file_name"

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

and in links.html

<img src="http://www.domain.com/...umbs/<%file_name%>"

The images in the sites are shown as broken images. <%file_name%> isn't converted to the

real file name. I guess <%file_name%> is only working when using cgi? What can I do to get

it working with php?



sun
Quote Reply
Re: [sun112] Image column with php possible? In reply to
If you right click on the broken image and choose 'properties' what does it say for the url?

You may have more luck asking this in the php forum. I can't see why this global wouldn't work.
Quote Reply
Re: [afinlr] Image column with php possible? In reply to
Hiya!



It puts out <%file_name%>.gif



sun
Quote Reply
Re: [sun112] Image column with php possible? In reply to
Well, knowing absolutely nothing about php Wink, having had a quick look at the default php templates, perhaps you need to change that to something like

<?echo $file_name?>
Quote Reply
Re: [afinlr] Image column with php possible? In reply to
i tried that, but it puts out

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


as the image :/
Quote Reply
Re: [sun112] Image column with php possible? In reply to
I *really* think this would have been better in the php forum. The global looks right but you need to write it in the php format using create_function and I don't know how to do that.
Quote Reply
Re: [sun112] Image column with php possible? In reply to
The problem I think, is that you need to use GT::SQL to grab the File_RelativeURL, which obviously isn't available in the PHP side (as it is written in Perl). Its an interesting problem though, and certainly one that would need to really be looked into, as its quite a major feature of LSQL.

Any comments Alex/GT?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!