Support Forum

Sub-Forums not showing in correct order

FO foxy7
foxy7
Member

Any idea why the Sub-Forums does not show in the correct order?:

http://s150.photobucket.com/user/Shadowzzzzzz/media/problem-with-post-edit-button1.png.html

This feature works perfect:

http://s150.photobucket.com/user/Shadowzzzzzz/media/problem-with-post-edit-button2.png.html

What I have done:

http://s150.photobucket.com/user/Shadowzzzzzz/media/problem-with-post-edit-button3.png.html

Thanks.

42 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Apologies for taking so long to respond.

The answer is no – I have no idea why you are seeing this and we have not had it reported before and I do know we have many users with some heavy usage of sub-forums.

But clearly it does look like a sorting issue so I think the first thing I have to do is open a bug report and then look closely at the code to see if i can see a reason for it.

So rest assured  – that will happen and hopefully I will find the reason and be able to correct it.

YS Yellow Swordfish
Yellow Swordfish
Member

Sadly – assuming we find something – it will not get into our 5.4.0 release which will probably go out today. But if it is something simple I can probably give you a code fix to save waiting for 5.4.1…

Although funding the cause is clearly the first thing on the agenda.

FO foxy7
foxy7
Member

If you manage to find a solution and it’s a simple fix, I would very much appreciate if you could post the new code here. 

MP Mr Papa
Mr Papa
Member

we will…  but needs research first since thus far, its a one off report…  Assume you are running sp 5.4 or at least 5.3.4 since 5.4 was just released??

MP Mr Papa
Mr Papa
Member

well, that page is slightly dated… still good info, but since we put up that page we added a detailed list of changes per version to help keep updated if needed… generally, very little is needed…

the change pages are at:  http://codex.simple-press.com/codex/installation/changes/

nothing in your theme will have affected the subforum ordering…  but there were some changes that would but I believe you have them in 5.3.4…  of course, wouldnt hurt to move to 5.4 (but needs wp 3.8) either…

as said earlier, research needed as its still a singular report…

YS Yellow Swordfish
Yellow Swordfish
Member

At the moment I can see no reason for this display behaviour. The ordering looks correctly structured in the code so I am a little stumped.

Is it possible – and if so would you be willing – to let me have a copy of your sfforums database table so that I can take a close look at the actual data which might be the only way I can replicate this?

FO foxy7
foxy7
Member

Okay. Yes for sure, could you please set up a quick “how to” guide, so I will provide you with the right info.

There is something totally wrong hmm…If I choose “Edit forum” and “Position after xxxxx”, it will just show up at some random position. I am totally lost, it worked so well in the beginning and I really can’t think of why this is happening now :/

MP Mr Papa
Mr Papa
Member

sorry, what does pm mean?  did you send a pm?  just to yellow swordfish?

to get the db table, you will want to use phpmyadmin or db tool of your choice… and then extract the wp_sfforums table…  your wp db prefix might be other than wp_

YS Yellow Swordfish
Yellow Swordfish
Member

OK – database table received thanks. You have a fringe case here but there is an easy fix and we will include this in the next update (which will be 5.4.1). If you want to apply it now then (using the current 5.4.0 file):

The code file needed is /simple-press/forum/content/classes/sp-forum-view-class.php

The function that contains the code to be edited is sp_forumview_query()

You need to locate the line of code that is literally:

foreach($topSubs as $topSub) {

Note that this code appears twice and BOTH instances require the following change. Before editing these lines should be found at line numbers 404 and 499.

Immediately BEFORE the above line of code – add the new line:

sort($topSubs);

and that should resolve things.

 

FO foxy7
foxy7
Member

Amazing, that did it!! :D

However it’s not possible to move the subforums, they will either move to some random position or not move at all. Also as mentioned in #10, the main forums will move to random positions. Any easy fix available for these too? 

EDIT: Actually, the subforums does show “in order” now on the website. But when I try change the ordering, it will not show on the website, as the previous one is frozen.

YS Yellow Swordfish
Yellow Swordfish
Member

To be honest I rather suspect that the main problem here is the sheer number of forums and subforums you have defined. We have a task already planned to rewrite the positioning code and I think it is probably being overwhelmed. Which makes it difficult for me to offer a quick and simple solution. And I do apologise for that.

One quick and dirty way of doing this is to go into the database and edit the data direct but it’s not really a very satisfactory way of changing things.

Let me talk it over with colleagues here. But – meanwhile – I am not sure I fully understand your last sentence. What do you mean by ‘frozen’ please? Can you expand on that?