Webmastersite.net
Register Log In

controlling attachments display....

Comments on controlling attachments display....

capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted May 17, 2006 - 5:35 PM:

Hi Paul, this code is from my displaylinks.tpl


<!-- BEGIN LINK ATTACHMENTS -->
<a href="download.php?id={LINKID}&amp;amp;amp;attachid={ATTACHID}">{ATTACHFILETITLE}</a> ({ATTACHKB} {LANG_GENERAL_KB}, {ATTACHDOWNLOADS} {LANG_DETAILS_DOWNLOADS})<br>
<IF {ATTACHISIMAGE}>
<a href="link.php?action=detail&amp;amp;amp;amp;id={LINKID}"><img src="thumbnail.php?id={LINKID}&amp;amp;amp;attachid={ATTACHID}"></a>
</IF>
<!-- END LINK ATTACHMENTS -->


  1. Is there some sort of conditional which will allow me to not display the ({ATTACHKB} {LANG_GENERAL_KB}, {ATTACHDOWNLOADS} {LANG_DETAILS_DOWNLOADS}) for image filetypes? That is, I don't mind it for .doc files, but I don't want it for .jpg...

  2. If a user uploads 7 images. I only want to display 3 thumbnails, with a message saying 'more images available...'. I know you can limit the display of attachments by using <!-- BEGIN 3 LINK ATTACHMENTS --> to show just 3 but how to output a message saying 'more..'
Thanks!
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted May 18, 2006 - 9:37 AM:

1. <IF not {ATTACHISIMAGE}>html here</IF> doesn't seem to work...?
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted May 18, 2006 - 1:18 PM:

It works, that's just not what you want unless you want to show the stuff only for non-images. To show something only when it's an image attachment, the code is already there in what you quoted:
<IF {ATTACHISIMAGE}> <a href="link.php?action=detail&id={LINKID}"><img src="thumbnail.php?id={LINKID}&attachid={ATTACHID}"></a> </IF> 


2. I don't see one presently, so for 3.3.18 I'll add a {LINKNUMATTACHMENTS} which gives you the number of attachments so you can do an <IF {LINKNUMATTACHMENTS} is greater than 3>
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
Posted May 18, 2006 - 5:10 PM:

It works, that's just not what you want unless you want to show the stuff only for non-images.

cool, that is exactly what I wanted and in fact, it was working... grin

2. You do have it: see the Misc section here: http://scripts.webmastersite.net/wsnlinks/wsnmanu...
but I tried it and not sure it works... it doesn't limit it to just three attachments...
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted May 20, 2006 - 7:16 AM:

capitaine wrote:
2. You do have it:


I added that to the manual entry at the time of my post. It's not in 3.3.17.

1. <IF not {ATTACHISIMAGE}>html here</IF> doesn't seem to work...?

Perhaps you're editing the wrong spot.
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted May 21, 2006 - 6:49 AM:

Had to change this to {LINKNUMBEROFATTACHMENTS} in order to fix a conflict on the suggest link page.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



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