ordering of files retrieved from /content #7

Closed
opened 2023-05-18 09:05:00 +00:00 by mmelon · 1 comment
mmelon commented 2023-05-18 09:05:00 +00:00 (Migrated from github.com)

Hi,

I am using a modified older version. It always pulled the posts out in the right order before my site moved server. Now the posts come out in a consistent but not newest descending order. Do you have any idea why the directoryIterator loop would change the order of the files retrieved? I am using YYYY-MM-DD

Hi, I am using a modified older version. It always pulled the posts out in the right order before my site moved server. Now the posts come out in a consistent but not newest descending order. Do you have any idea why the directoryIterator loop would change the order of the files retrieved? I am using YYYY-MM-DD
paintedsky commented 2023-07-18 16:10:52 +00:00 (Migrated from github.com)

Hey, sorry for the late reply! I read the email notification and then completely forgot about it, until I had occasion to look at the repo again today (hashtag adhd).

It definitely sounds like there's some weird difference between your old server and new server, but diagnosing what that difference is might be annoying.

Since you said you're on a modified older version, perhaps you could just modify it a bit more to add part of the latest update, the bit that manually sorts posts to avoid these sorts of issues?

There's only two little bits of code you'd need to add:

Would that be a workable solution for you?

Hey, sorry for the late reply! I read the email notification and then completely forgot about it, until I had occasion to look at the repo again today (hashtag adhd). It definitely sounds like there's some weird difference between your old server and new server, but diagnosing what that difference is might be annoying. Since you said you're on a modified older version, perhaps you could just modify it a bit more to add part of the latest update, the bit that manually sorts posts to avoid these sorts of issues? There's only two little bits of code you'd need to add: - [The `sortPosts` function on lines 17-21](https://github.com/paintedsky/dead-simple-blog/blob/c532dd6dc51a63de885c681dba439e554240bc67/index.php#L17C1-L21C2) - [The bit on line 49 that calls the `sortPosts` function](https://github.com/paintedsky/dead-simple-blog/blob/c532dd6dc51a63de885c681dba439e554240bc67/index.php#L49) Would that be a workable solution for you?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: paintedsky/dead-simple-blog#7
No description provided.