Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2015-03-26 09:50:31

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Article sort by category confusion

Bloke wrote #289438:

Can it just become a feature for numeric values only

they can be equal too

Offline

#14 2015-03-26 09:54:27

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Article sort by category confusion

Bloke wrote #289438:

Can it just become a feature for numeric values only?

I suppose this would get clumsy soon.

In getNeighbour() we have $threshold as a value to compare against.

Thus you’d need to derive the the comparison operator used in the query depending on the numericalness of $threshold.

So what do you do if $threshold is “9”? It might be numeric and as well be from a [0-9A-Z] range spread across all articles.

Offline

#15 2015-03-26 10:10:06

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Article sort by category confusion

Why not to replace > by >= AND ID != current_id?

Offline

#16 2015-03-26 10:17:46

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: Article sort by category confusion

etc wrote #289443:

Why not to replace > by >= AND ID != current_id?

Because you would eventually end in an infinite loop between two articles sharing an identical sort criterion.

Offline

#17 2015-03-26 10:32:06

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Article sort by category confusion

wet wrote #289445:

Because you would eventually end in an infinite loop between two articles sharing an identical sort criterion.

Heh! could be a feature 8-) Then > OR (= AND ID>current_id), plus ORDER BY sort, ID?

Edit: then link_to_next/prev could produce the same result. ID sort type and direction should be the same as for $sortby, I guess.

Last edited by etc (2015-03-26 18:22:51)

Offline

Board footer

Powered by FluxBB