Webmastersite.net
Register Log In

Adding a custom attach url field
linking an image on a detail page

Comments on Adding a custom attach url field

RedstoneMG
Member

Usergroup: Customer
Joined: Jun 15, 2005
Location: Ontario, Canada

Total Topics: 7
Total Comments: 33
Posted Mar 18, 2006 - 9:27 AM:

My premium link posters are going to have a custom image on their detail page. Works great. But suppose they would like to promote a coupon with a url to their promotion page, instead of a static picture.

I created a new field in the attachments table called 'fileurl'

Here is my code on the detail page:

<IF {LINKFILEFIELD}>
<!-- BEGIN LINK ATTACHMENTS -->
<IF {ATTACHISIMAGE}><a href="download.php?id={LINKID}&attachid={ATTACHID}&field={ATTACHFILEURL}" target="_blank"><img src="download.php?id={LINKID}&attachid={ATTACHID}&width=300&height=250" alt="{ATTACHFILETITLE}" border="0"></a>
</IF>
<!-- END LINK ATTACHMENTS -->
</IF>

The url when clicked on is: www.mysite.com/dir/links/de...6&field=www.msn.com

It's pulling the right url from the field I created, unfortunately I'm trying to get it to go to www.msn.com... smiling face and it's not seeing this as an external link. Possibly download.php isn't really set up for this extra feature?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 18, 2006 - 7:44 PM:

If you're trying to link to {ATTACHFILEURL}, why do you have a link to download.php there instead? <a href={ATTACHFILEURL}>
RedstoneMG
Member

Usergroup: Customer
Joined: Jun 15, 2005
Location: Ontario, Canada

Total Topics: 7
Total Comments: 33
Posted Mar 19, 2006 - 12:39 PM:

I didn't figure that the {ATTACHFILEURL} had become a global variable - I assumed it would need the same structure as the image file to link it to the correct listing id... apparently not.

Thanks!
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 21, 2006 - 5:33 PM:

It isn't a global variable, it will only work inside the scope of attachments. Since you've placed <!-- BEGIN LINK ATTACHMENTS --> there it works.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.