Hi there,
I'm working on a file based commenting system with in-line comments (only 1 level). Despite being a newby I've managed to create a system in which users are able to add new comments and use @[NUMBER] to add their reply below another comment.
My file and folder structure looks like this:
/threads/
1/
1.txt
2.txt
3.txt
2/
1.txt
3/
1.txt
2.txt
3.txt
4.txt
The folder in threads has the thread number (used to make a reply) for its name and 1.txt contains the contents of the "mother" post. Every post higher than 1 is a reply.
So I could show the threads in the order which they have been made or show them upside down, but they'll be stuck in that order (I'm using a loop to find folders and then increase or decrease the folder number). Does anybody have any ideas on how I can make threads which get replies to the top of the list?
I thought of an order.txt file which has the thread numbers in a certain order and when a reply gets made to thread X the script should put X at the top of that list (or bottom, easy to inverse).
Suggestions are very much appreciated!