Camen Design Forum

Delete

(Leave this as-is, it’s a trap!)

To delete this post you must be either the original author or a designated moderator.
The content of the post will be removed but the name and date will remain.

  • The post will be removed completely from the thread, rather than blanked
  • Only posts on the last page of the thread can be removed completely (so as to not break permalinks)

RE[1]: News board

Martijn

Hi Ed!

I have been thinking about this problem of yours and I can only think of 2 different solutions. One will require you to change several files and make sure these changes persist when you update the forum.

The other only requires you to update one file (meaning it will be easier to keep your change around throughout updates) but needs a pretty sizeable change.

For both of these solutions you will need to know a bit about PHP. And my idea of “a bit” is relative to what I know about PHP, it might be too much for what you can do, or the following pointers might get you where you need to be. Don’t be afraid to ask for help!

The way NNF is sorting is by using the files’ internal change date. This is great as it allows the forum to sort before reading the full contents of the files. This means that threads that are filtered to be on a different page never need to be opened and the forum becomes quicker.

This could be continued if you *change the modified date to the original posting date every time something changes*. This is solution number one. In fact, this code already exists. When you append to a post NNF will reset the modification date to make sure the thread doesn’t get boosted. It does the same for other actions such as a moderator locking a thread or someone removing a post.

This is what is triggered on the current lines 150 to 153 of the development edition thread.php:

%
                        //try set the modified date of the file back to the time of the last reply
                        //(appending to a post does not push the thread back to the top of the index)
                        //note: this may fail if the file is not owned by the Apache process
                        @touch ("$FILE.rss", strtotime ($xml->channel->item[0]->pubDate));
%

You would want to go through the whole forum source and find all these `@touch` lines and change them from using the latest item (“0”, the last reply) to using the first item (the original thread). Then you also want to add this code to the replying logic so the modified time is not altered when someone replies.

Of course this will all have to be branched in an if statement, as you only want to do it for a specific sub forum.

The other solution is to *rewrite the sorting logic to read the publishing date from every file*. This is not going to be very efficient when the forum grows but might be slightly easier as it only needs you to add a block of code to the index.php.

So yes. I think that’s it. It is safe to say NNF was not build to support what you are asking for. But it definitely can adapt to do it.

If you need any specific help or would like to get someone to do these changes for you feel free to contact me either through here or through other means (see http://martijn.vanderven.se/). I have long held an interest in accessibility technology and might be able to donate some of my time to your cause.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn