Camen Design Forum

News board

append delete monty

Hello all

I'm using NoNonsense Forum for http://discuss.bristolbraille.co.uk. It works well, but I have an issue with the board I use for news items. I need the items to stay in the order they were originally posted, but I do want people to be able to respond to them. So how do I stop the responses jumbling up the item order? As an example you can see the item "New Year Update:" has been bumped up to entirely the wrong position.

Cheers!

Ed

Reply RSS

Replies

append delete #1. 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.

append delete #2. Kroc

This wouldn't be difficult to support in NNF. The answer would be to add another type in locked.txt "news" and add the relevant IFs (as @Martijn says) to the post/reply code to keep the file at its original date. I've been wanting the same feature to allow NNF to be used as a very lightweight blog.

I'm just going off to file the issue now. It'll be in the next release when I get to that.

append delete #3. monty

Martijn and Kroc

Thanks for your replies. Given the low volume of traffic we get at the moment it will be better to wait until the next release and do an upgrade than to roll my own. Its wonderful to see one's self-serving requirements acted on so readily! It goes to show what most of us already know; that Open Source only works really well when it comes after --- or at least along side --- an active community.

:: @monty added on 31 Jan ’14 · 10:41

Martijn

I meant to say thanks to you for offering to help with the project. How are you with coding for drivers and so on? We're looking for people to join the Midas project, which is currently inhibited only by a lack of funds to pay for people's time upfront.

If you're interested lets take this over to a new thread on http://discuss.bristolbraille.co.uk/General%20Talk/

... It would be good to get a thread going for Midas volunteers to make themselves known.

Cheers

Ed

Reply

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

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn