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>
It's pulling the right url from the field I created, unfortunately I'm trying to get it to go to www.msn.com... and it's not seeing this as an external link. Possibly download.php isn't really set up for this extra feature?
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.
Comments on Adding a custom attach url field
Member
Usergroup: Customer
Joined: Jun 15, 2005
Location: Ontario, Canada
Total Topics: 7
Total Comments: 33
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... and it's not seeing this as an external link. Possibly download.php isn't really set up for this extra feature?
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
If you're trying to link to {ATTACHFILEURL}, why do you have a link to download.php there instead? <a href={ATTACHFILEURL}>
Member
Usergroup: Customer
Joined: Jun 15, 2005
Location: Ontario, Canada
Total Topics: 7
Total Comments: 33
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!
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
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.