Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Logo on links

Quote Reply
Logo on links
On Links2 there was a mod that allowed you to attach an image to a link - from the admin area ONLY. Is there a mod like this for SQL?

I have some affiliate links that track the impressions of their link using a 1x1 pixel image. So it would be basically invisible.

Again, I just need to figure out how to add the URL of an image to the link when it is printed out, and it only needs to be from the admin page.

Thanks for any help,

Chad

Quote Reply
Re: Logo on links In reply to
1) Add a new field to your Links table.
2) Add the field config in your Links.def file...should look similar to the URL field.
3) Then add the IMAGE URL in the admin.cgi script in the Links Add and Modify options.
4) Put the following codes in the link.html template file:

Code:

<%if Image%>
<a href="<%URL%>"><img src="<%Image%>"></a>
<%endif%>


That's it...a lot easier than Links 2.0 where you have to upgrade your current existing database file with the new column you add in the links.def file.

Regards,

Eliot Lee

Quote Reply
Re: Logo on links In reply to
Elliot,

Thanks for the reply. But I am new to configuring this stuff. So I have questions about your steps 1,2, and 3.

1. What are all of the variables for the new field?
I'll assume that it would be: IMAGE, CHAR, 40(length), 150(MAX length), not null YES?(Needs to be optional).

2. The Links.def file will be:
Image => ['20', 'CHAR', '40', '200', '0', '', ''],
What should these values be? (for the .def file)

3. I am totally lost on this one...


Thanks again for your help

Chad


Quote Reply
Re: Logo on links In reply to
Actually, I think I got it. Here is what I did. Could you let me know if it is flawed anywhere?

1. Image, 20, CHAR, 40, 200, Not null 'NO'
2. (Links.def)
Image => ['20', 'CHAR', '40', '200', '0', '', '']
3. Duh, Nevermind this one, I thought you wanted me to somehow alter the .cgi script.

4. <%if Image%>
<img src="<%Image%>" width="1" height="1">
<%endif%>

Look ok to you? I don't want to get too far and learn that something is missing.

Thanks,

Chad

Quote Reply
Re: Logo on links In reply to
1) Look at your URL field type and configuration.
2) Right...same as the URL field, except you should not use the http:// stuff for the valid expression column (like Links 2.0).
3) What do you mean you are lost? AFTER you do steps 1 and 2, you do the following:

a) Open the admin.cgi script via your web browser.
b) Click on Modify UNDER the Links title in the left frame window of admin.cgi.
c) Then type in the URL to the Image in the Image field as you would any other field in the forms in the admin.cgi file.

Regards,

Eliot Lee