Gossamer Forum
Home : Products : DBMan : Customization :

adding download links

Quote Reply
adding download links
Hi there!

I have a problem, of which I am certain it is a small one, but unfortunatley my Perl skills are not that developed yet.

I would highly appreciate if you could take a moment at http://www.fpainc.com/marinn/Index.htm and follow the link to "Keytags" at the left side. When clicking on the first image ("After Eight"), a new browser window pops up with a copyright disclaimer. So far so good. Now when clicking "I agree", download of the file should start (since it is a hi-res *.tif).

My problem is, I don't know in which way to write the variable for this action. Right now, it is a static link (same tif for all products). I figure I have to use something like: |; print qq! $href_links!;print qq|&Type=$rec{'Type'}&Style_Number=$rec{'Style_Number'}|; print qq|" onMouseOver="window.status='$rec{'Style_Number'}';return true;" onMouseOut="window.status='';return true;">|; print qq! $html_product_image!; print qq|$rec{'Style_Number'}.gif" border=1 alt="$rec{'Name'} - $rec{'Style_Number'}"></a>, but I don't want the image to be displayed (which wouldn't be possible anyway since it's a tif), rather the download should start immediately.

Also, at the very top of my modified html.pl there should be a definiton of $href_links = Can this be the images directory?

Please help, I appreciate any pointers to the right direction. Thanks a lot,

Sascha
Quote Reply
Re: adding download links In reply to
The better thing to do is add the following variable at the top of the html.pl file:

Code:
$href_links= 'http://www.fpainc.com/marinn/images';

With NO Trailing Slash.

Then replace the codes you have with the following:

Code:
print qq| <a href="$href_links/$rec{'Style_Number'}.tif">|;

BTW: You do NOT need to include all those operaters (print qq| and |;) for printing record hash variables. The only time you would include these operators is when you are calling sub-routines, like the following:

Code:
|; print &site_header; print qq|

Hope this helps.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: adding download links In reply to
Dear Eliot!

Thank you so much for your help, I'm almost there. Now the script is at least trying to pull the correct file, yet due to my ignorance of Perl, I have still an syntax error somewhere, and I suspect it is at:
print qq| <a href="$href_links/$rec{'Style_Number'}.tif">I agree</a> |;

If you could look through this one more time, I promise to continue my reading of "Learning Perl" ...

Again, thanks a lot,

Sascha

<CENTER><H3>IMC High Resolution Database</H3></CENTER>
<P> </P>
<TABLE BORDER="0" ALIGN="CENTER" WIDTH="75%">
<CENTER>
All images are protected under copyright law and <BR>
are the property of International Merchandise Concepts.
<P>
You may alter these images only for (...whatever) purposes and <BR>
only according to the specifications given on our web site.
<P>
We may want to put a link here to the spec page.
<P>
print qq| <a href="$href_links/$rec{'Style_Number'}.tif">I agree</a> |;
<P>
<A HREF="http://www.imc-miracles.com">I do not agree</A>
</TABLE>
</CENTER>

|;
}

sub html_record_marinn {
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

my $font_color = 'Font face="Verdana';
my $font = 'Font face="Verdana';

print qq|




|;
}

sub html_footer_marinn {
print qq|


</body>
</html>
|;

}

1;
Quote Reply
Re: adding download links In reply to
Again you do NOT NEED OPERATORS AROUND THE LINK CODES!

Replace the following:

Code:
print qq| <a href="$href_links/$rec{'Style_Number'}.tif">I agree</a> |;

WITH THE FOLLOWING:

Code:
<a href="$href_links/$rec{'Style_Number'}.tif">I agree</a>

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: adding download links In reply to
Thanks again, Eliot, but now ever page tries to link to:
http://www.fpainc.com/marinn/images/.tif

I have on top:

$href_links= 'http://www.fpainc.com/marinn/images';
---------------------------

and further down:
<a href="$href_links/$rec{'Style_Number'}.tif">I agree</a>

Sorry if I have missed something again?

Sascha
Quote Reply
Re: adding download links In reply to
U G H!

Copy your html.pl file as text file, upload to a publicly accessible directory in your server, and then post the URL to the text file in this Topic, SO that I can see exactly what codes you are using!!!!!!!!!!!!!!!!!!!

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: adding download links In reply to
Eliot, I'm really sorry to cause you so much trouble, here's the file:

http://www.fpainc.com/html.txt

Sascha
Quote Reply
Re: adding download links In reply to
Something else that might help:
I have just finished a site based on DBMan, which can be found at
http://www.imc-miracles.com
Here, whenever you click on a product, lets stay with "Keytags", you'll get to a script I called GenProducts.pl (an overview of general products), and from there you get to the DetProducts.pl (for each individual product); so, to stay with our example, typing in:
http://www.imc-miracles.com/cgi-bin/db.cgi?db=DetProducts&uid=default&view_records=1&Type=Keytags&Style_Number=imc-9171
will get you to the detailed info on this particular product.
What I am trying to do now, is setting up a separate database for this download function. I have used the same template (the DetProducts.pl - whch is that html.txt I have posted), but there is yet another link from this page that should allow users to download those hi-res images ...

I don't now if all that makes sense, it's been a very long day...

But I do sincerely appreciate your time and effort.

Sascha
Quote Reply
Re: adding download links In reply to
1) Delete the following line of codes:

Code:
|; print qq! $html_product_image!; print qq|logo.jpg" WIDTH="600" HEIGHT="105" ALT="Marketing Innovations International" BORDER="0"><BR>

And replace it with the following:

Code:
<$html_product_image>

2) Replace the variable definition you have for $html_product_image, with the following:

Code:
$html_product_image = 'img src="http://www.fpainc.com/marinn/images/logo.jpg" WIDTH="600" HEIGHT="105" ALT="Marketing Innovations International" BORDER="0"';

Okay...the following codes:

Code:
<body bgcolor="#FFFFFF" LINK="#FF3333" VLINK="#FF3333" ALINK="#FF3333" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
|; print qq! $html_product_image!; print qq|logo.jpg" WIDTH="600" HEIGHT="105" ALT="Marketing Innovations International" BORDER="0"><BR>
<BR>
<P>
<CENTER><H3>IMC High Resolution Database</H3></CENTER>
<P> </P>
<TABLE BORDER="0" ALIGN="CENTER" WIDTH="75%">
<CENTER>
All images are protected under copyright law and <BR>
are the property of International Merchandise Concepts.
<P>
You may alter these images only for (...whatever) purposes and <BR>
only according to the specifications given on our web site.
<P>
We may want to put a link here to the spec page.
<P>
<a href="$href_links/$rec{'Style_Number'}.tif">I agree</a>
<P>
<A HREF="http://www.imc-miracles.com">I do not agree</A>
</TABLE>
</CENTER>

NEED to go in the following sub-routine:

Code:
sub html_record_marinn

Look at your sub html_view_success....

See these codes:

Code:
&html_record_marinn (&array_to_hash($_, @hits));

It means to build records FROM the sub html_record_marinn.

The reason that the image is not showing is because the codes you have in the sub html_print_headers_marinn MUST be in the sub html_record_marinn!

Regards,

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: adding download links In reply to
Eliot, one more time: Thank you! I have a bad cold and am running quite some fever, gotta go to bed.

I will check out what you told me tomorrow morning, and will definitely let you know what happened.

Thanks, again,

Sascha
Quote Reply
Re: adding download links In reply to
You're welcome.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: adding download links In reply to
I take you got it to work...

Good!

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: adding download links In reply to
What can I say? You're the best...
:-)

Sascha