Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Hardcode image URL into template?

Quote Reply
Hardcode image URL into template?
Hi,

I'm currently redeveloping a vehicle database and have small problem with images not caching for a javascript rollover. Here's the site:

http://www.wcsauto.com/...Y;sb=Datereg;so=DESC

(Click on a vehicle to view the images)

The basic idea is to use javascript mouse rollovers to load/display the additional larger images without having to load a different DBMSQL URL. When a user hovers over the thumbnail images arranged across the bottom I want them to see the larger picture.

The problem with the roll-over is that I can't pre-load / cache the images into the browser with the existing IMG SRC=URL; every time you hover over a thumbnail it makes a fresh call to the DB and reloads the image (with the obvious time lag).

Is there a way to directly link to the image source so that I can put the actual real filenames into the HTML and preload them?

The images are stored in /img/dbm/salvage/0 .. 1 .. 2 .. 3 .. etc

Any ideas or thoughts would be appreciated Smile

All the best
Shaun
Quote Reply
Re: [qango] Hardcode image URL into template? In reply to
Very good your site

Iīm developing an vehicle site too, and Iīm very interested in this manner to use the real path to the images

I saw linkssql has an plugin that thumbnails the images and get the real file path

I use in my site an javascript to enlarge and view the images without load another dbman url

see it

www.guaruveiculos.com.br

but the images are all large format only resized by image tags

Fabio
Quote Reply
Re: [assombracao] Hardcode image URL into template? In reply to
Fabio,

Thanks for the info. I've had a look at your site - very well done - and I like the java wipe effect, so if I may I'll think about applying that to our site as a temporary measure - maybe even permanent.

In the meantime, can anyone advise on how to extract the actual real image URL?

Many thanks,
Shaun
Quote Reply
Re: [qango] Hardcode image URL into template? In reply to
Thanks for info

And if anyone has an auto thumbnail as linkssql have it would be great too

Fabio
Quote Reply
Re: [assombracao] Hardcode image URL into template? In reply to
Did You get an way to get the hardcode image URL?
Quote Reply
Re: [assombracao] Hardcode image URL into template? In reply to
Hi

thereīs a global here and 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
Post deleted by qango In reply to
Quote Reply
Re: [assombracao] Hardcode image URL into template? In reply to
Hi assombracao,

Thanks to the sub you posted, I've managed to crack this one Smile

Instead of using the ID in the template, call it from the existing tags, e.g.;

Quote:

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


Then, call the sub from the template without the ID, e.g.;

Quote:

<%picpath('table_name','image_column_name')%>


Hope this helps others too!

All the best
Shaun
Quote Reply
Re: [qango] Hardcode image URL into template? In reply to
Hello,

I have just looked at your site (http://www.wcsauto.com). It is very well made.

You developed the form of contact (Enquiry Form) or it is a plugin proposed by GT ?

The inscription with the neswletter (Mailing List), it is you also who developed it ?

Why you did not use LinkQSL? DBMan is better for this project ?


Thank you for your answer.

Mick
PS: Excuse my English.
Quote Reply
Re: [mick31] Hardcode image URL into template? In reply to
Mick,

Sorry for the long delay in replying, I don't get to visit the forums as often as I'd like nowadays.

I use Subscribe Me Pro for the mailing list and csMailto for the contact form.

I simply added the HTML code for the forms to the DBMan template and used the database fields to pre-fill the contact form.

I specifically used DBMan, as opposed to linksSQL, because of the need for lots of photo's and the reliance of LSQL on a category structure - which didn't suit the type of display I wanted for this project.

Hope this helps.

All the best
Shaun