Webmastersite.net
Register Log In

Sort Saved Links
Is it possible to sort saved links by title in a top list?

Comments on Sort Saved Links

sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted 10/28/19 - 6:14 PM:
Subject: Sort Saved Links
Is it possible to sort saved links by title in a top list?

Currently, the choices are:

<option value="id">id</option><option value="ownerid">owning member id</option><option value="sortorder">sortorder</option><option value="time">submission time</option><option value="guestuuid">guestuuid</option><option value="rand()">random</option>


Also: how does sortorder work from the user's point of view? Where would they sort their saved links so that the toplist for savedlinks shows the same order? I've tried sorting my sample saved links and that is not reflected in the toplist that I have set to auto refresh every so often.

Thanks!

Paul
developer

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

Total Topics: 61
Total Comments: 7854
Paul
Posted 10/29/19 - 5:14 PM:

If you're doing a toplist of saved links that's supposed to be showing the currently viewing member's saved links and not everybody's, then make sure you use a filtering condition ownerid={THISMEMBERID}... but if you're trying to display guest toplists there too then I'd have to look up how to query the right guestuuid.

The link title isn't a field in the _savedlinks database table, so it's not possible to sort by it in a toplist directly. But that brings me to:

sparkalina wrote:
Also: how does sortorder work from the user's point of view? Where would they sort their saved links so that the toplist for savedlinks shows the same order?


Users have no control over it, only admins. The sortorder field for saved links is something I added to work around the problem of wanting to sort by link fields that aren't in that table. It's an automatically calculated order based on the sort selection you've made at Admin -> Settings -> General -> Default Ordering -> "Member Link Lists / Saved Links".

If you happen to have selected to have the normal saved links page sort by title, then you can simply sort your toplist by sortorder to have it sorted by title. But you can't sort the toplist by a different link field than you sort the normal saved links page (only by a different _savedlinks table field if desired).

The only ways I can think of to allow toplists to sort by a different listing field than the one selected as the general sort are (a) a joined query that could be really slow on any significantly sized database (and would be a ~$90 project) or (b) adding updating caching and regenerating a new field for saved links, which would probably be about a 3 hour / $180 project... and which would only handle one new field, so if you wanted a third saved links toplist with a third different link field sort order then I'd have to do it all over again.
sparkalina
Forum Regular

Usergroup: Customer
Joined: Nov 26, 2003

Total Topics: 70
Total Comments: 211
Posted 10/29/19 - 5:36 PM:

Thank you, Paul. That clears up a lot.
I'll try the admin sort setting first, and then if people request more choices, then we'll go for custom.

Still have to ramp up the audience/money first.

Hope you're well and away from fire areas on the West Coast.
Paul
developer

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

Total Topics: 61
Total Comments: 7854
Paul
Posted 10/31/19 - 5:00 PM:

Fortunately the fires are far and I'm one of the few people in my area not affected by public safety power outages.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



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