SMF Support > SMF 2.0.x Support

SMF 2.0RC1 with SQLite and board_order (sorting of the unsorted boards)

(1/2) > >>

stomic:
Hi!

I have upgraded from SMF 1.1.8 to 2.0RC1 with MySQL and then ported the database to SQLite. This wasn't an easy task, and I still hope it all went well.

Anyway, what I noted is that my boards are not sorted according to the order that is setup in the configuration (admin section). This sorting order is preserved in the database but wasn't respected when the board index is shown.

I found a solution, which I hope is good enough. I'm writing here to share the solution with you, in case that somebody else encounters the same problem.

So, I edited the file Sources/Subs-BoardIndex.php and on line 74-77 I replaced:

--- Code: --- AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
array(

--- End code ---

with

--- Code: --- AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)) . ' ORDER BY b.board_order',
array(

--- End code ---

stomic:
Do you think the solution is good enough?

And I haven't tested it with other database engines...

karlbenson:
That would work.

Usually smf re-orders the boards inside the db so that the order by is not required.
Your porting to sqlite (which won't do it) from mysql (which will do it)

It might be caused by your porting or it could be an sqlite bug.
I will check this out.

karlbenson:
Added to the bug tracker.
http://dev.simplemachines.org/mantis/view.php?id=3221

stomic:
thanks!

Navigation

[0] Message Index

[#] Next page

Go to full version