WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

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

Version: 3.3.8
printPrint


Adding a custom attach url field
RedstoneMG
Member
Avatar

Usergroup: Customer
Joined: Jun 15, 2005
Location: Ontario, Canada
Total Topics: 8
Total Posts: 35
Posted 03/18/06 - 09:27 AM:
quote post
#1
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="http://www.webmastersite.net/forums/download.php?id={LINKID}&attachid={ATTACHID}&field={ATTACHFILEURL}" target="_blank"><img src="http://www.webmastersite.net/forums/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: http://www.mysite.com/dir/links/detail/download.p...

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
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6312
Posted 03/18/06 - 07:44 PM:
quote post
#2
If you're trying to link to {ATTACHFILEURL}, why do you have a link to download.php there instead? <a href={ATTACHFILEURL}>

Edited by Paul on 03/18/06 - 07:46 PM

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
RedstoneMG
Member
Avatar

Usergroup: Customer
Joined: Jun 15, 2005
Location: Ontario, Canada
Total Topics: 8
Total Posts: 35
Posted 03/19/06 - 12:39 PM:
quote post
#3
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
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6312
Posted 03/21/06 - 05:33 PM:
quote post
#4
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.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.