Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2012-07-14 07:33:34

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

Re: r3847: link_to_prev and link_to_next adhere to a custom sort order

Els, I cannot reproduce this here.

I’d need your whole page template and the details of the affected articles to dig deeper. Please use this SQL query to produce the article details:

SELECT ID, Posted, unix_timestamp(Posted) as uPosted FROM textpattern ORDER BY Posted DESC

Offline

#14 2012-07-14 13:01:42

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

Thanks Robert, I will check again. Probably something stupid I did.

Offline

#15 2012-07-15 22:10:43

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

wet wrote:

SELECT ID, Posted, unix_timestamp(Posted) as uPosted FROM textpattern ORDER BY Posted DESC

Probably a dumb question, but do I just place this in <txp:php> tags and put it in the article form?

Offline

#16 2012-07-15 22:37:34

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#18 2012-07-15 22:48:56

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

#20 2012-07-16 09:54:09

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

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

#24 2012-10-05 07:09:41

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

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

Board footer

Powered by FluxBB