Webmastersite.net
Register Log In

random toplist duplicates links shown

Comments on random toplist duplicates links shown

babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Jul 12, 2008 - 2:26 AM:

I have a toplist that shows ok BUT now and again it will show a link twice within the selection. This is the first time I have had this happen, albeit it is the first time I have generated a toplist for attachments.

Anyway we can have it so that it shows 5 DIFFERENT links?

<!-- BEGIN TOPLIST 17 -->
<CONFIG>attachments,rand(),5,ascending,,,,0,0,0,0,0,0,,0</CONFIG>
<!-- BEGIN 1 LINK ATTACHMENTS -->
<a href="{LINKDETAILSURL}"><img src="{ATTACHTHUMBURL}" ></a>
<!-- END LINK ATTACHMENTS -->
<!-- END TOPLIST 17 -->
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 13, 2008 - 3:09 AM:

You don't want an attachments toplist, you want a links toplist. Use {LINKTHUMBURL} to get a random thumbnail url from amongst the attachments of a link.

<!-- BEGIN TOPLIST 17 --> 
<CONFIG>links,rand(),5,ascending,,,,0,0,0,0,0, 0,,0</CONFIG>
<a href="{LINKDETAILSURL}"><img src="{LINKTHUMBURL}" ></a>
<!-- END TOPLIST 17 -->


For anyone who does have a reason to be doing an attachments toplist though, find "Optional: Would you like to show only distinct values?" and supply "objectid".
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Jul 14, 2008 - 12:49 AM:

That doesn't work for what I want for a number of reasons:

--Many of the links have more than 1 attachment, but I only want 1 displayed in this toplist.

--When I tried yours above if a link had more than one image attached it showed the first one but then just showed the "No Thumbnail" for the others.

--It includes links that do not have an attachment, so instead of 5 I may only get, say, 3 images displayed.

So, I redid it as an attachment and added objectid to distinct values.

This seems to work ok, except in the random images "No Thumbnail" will crop up now and again. This does not have a correct link to it either, just goes to "//-.html"
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 15, 2008 - 6:33 AM:

If you have links without an attachment, you probably also have attachments that aren't images and therefore can't show thumbnails. If you use {LINK variables and the attachment is actually attached to a category, comment, member, PM or the like then that will also fail... a type='link' toplist condition takes care of that.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.