Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
You can run it via SSH (which you can skip if it’s not a remote server) and MySQL CMD interface. E.g.
$ ssh domain.tld
$ mysql --user="yourUsername" --password="yourPassword" yourDatabasename
mysql> $ SELECT ID, Posted, unix_timestamp(Posted) as uPosted FROM textpattern ORDER BY Posted DESC;
This would give you:
+-----+---------------------+------------+
| ID | Posted | uPosted |
+-----+---------------------+------------+
| 523 | 2012-06-10 00:03:01 | 1339275781 |
| 2 | 2012-06-09 23:36:43 | 1339274203 |
| 1 | 2012-06-08 02:18:23 | 1339111103 |
| 406 | 2012-04-25 20:11:50 | 1335373910 |
You could also use tools like phpMyAdmin or rah_terminal.
Last edited by Gocom (2012-07-15 22:45:27)
Offline
#17 2012-07-15 22:44:10
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
Ah thank you, Jukka. I don’t quite get why Robert needs all articles’ details for this? I found that actually link_to_prev/next are not linking to the current article like I said before, but in fact don’t output anything at all. Tried it again with today’s nightly (well, yesterday’s) but it didn’t change.
Offline
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
Els wrote:
I don’t quite get why Robert needs all articles’ details for this?
To reproduce the behavior and to see if there is potential issue with sorting. I would be asking for the same thing. What Robert asks doesn’t reveal anything confidential about your site if are worried about that, just timestamps and IDs.
Last edited by Gocom (2012-07-15 22:49:54)
Offline
#19 2012-07-15 23:06:23
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
Got it :) Thanks again.
Offline
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
Els, please try r3966. It might fix this bug.
Offline
#21 2012-07-16 14:33:07
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
That was quick :) I’m at work now, but will try as soon as I get home. Thanks!
Offline
#22 2012-07-16 17:53:41
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
Yes, fixed :) Thanks again!
Offline
#23 2012-10-04 17:03:05
- feragnoli
- Member
- From: the hague
- Registered: 2005-02-10
- Posts: 150
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
hello,
is it possible to restrict the sorting to only articles in the same category, ordered by date?
something like:
<txp:article sort=“This article’s Category1, Posted desc” />
<txp:if_individual_article>
<txp:link_to_next><txp:next_title/></txp:link_to_next>
<txp:link_to_prev><txp:prev_title/></txp:link_to_prev>
</txp:if_individual_article>
thank you
what was that again…?
Offline
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
No.
The sort category is taken from the page URL, as are section and author. The pros and cons of this decision were discussed here.
Offline
#25 2012-10-05 07:32:09
- feragnoli
- Member
- From: the hague
- Registered: 2005-02-10
- Posts: 150
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
I see.
but, wouldn’t you agree that that’s somewhat inconsistent. and a limitation too?
the whole section/categories classification is still pretty unclear (it is clear what they ARE but not why).
in my experience, for instance, it is often desirable not to have clients mess with sections.
example:
the content of the site might be organized in two main sections: News and About us
The section ‘News’ will in turn include a number of categories (sport, whatever, …) and it is reasonable to foresee that paging through articles (from an individual article page), in such a case, will happen also by category.
That very simple task is, at the moment, a very tricky one..!
Thank you
what was that again…?
Offline
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
feragnoli wrote:
but, wouldn’t you agree that that’s somewhat inconsistent. and a limitation too?
It is. Alas, the alternate solution has its own deficiencies. We’re in a “rock vs. hard place” situation.
Offline
#27 2012-10-05 08:18:09
- feragnoli
- Member
- From: the hague
- Registered: 2005-02-10
- Posts: 150
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
I am not aware of the way link_to_prev and _next work at the moment (I have indeed read the post about the sorting defined by the <txp:article /> tag).
Ideally, one would want an attribute like restrict=“category1” or the such on those tags.
The option I can think of right now, otherwise, is to call the database and ask:
select rows where timestamp is immediately above or immediately below the timestamp of current article (in case of a sorting by date).
I guess that’s a whole different way than the one link_to_prev and _next work at the moment, is it?
thank you
what was that again…?
Offline
Re: r3847: link_to_prev and link_to_next adhere to a custom sort order
feragnoli wrote:
select rows where timestamp is immediately above or immediately below the timestamp of current article (in case of a sorting by date).
I guess that’s a whole different way than the one link_to_prev and _next work at the moment, is it?
Basically it works like that. Look at getNeighbour for details.
Offline