FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Caterogies may be hidden
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Caterogies may be hidden [message #165242] Mon, 16 May 2011 06:12 Go to next message
syl20a is currently offline  syl20a   France
Messages: 2
Registered: May 2011
Karma: 0
Junior Member
Hello,

include/cat.inc use an array with a numeric key to sort categories and forums in cache

the numeric key is computed like this :
$c += pow(10, 2 + $ml - $lvl[0]]) * $v[4];

in rare circumstances the $c overrides a previous used index and the previous forums "disappear".

I had to change pow(10) to pow(15) to have enough indices without overrides.

Regards,
Re: Caterogies may be hidden [message #165243 is a reply to message #165242] Mon, 16 May 2011 09:05 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
This is unusual. Do you have a lot of categories and forums?
Re : Re: Caterogies may be hidden [message #165244 is a reply to message #165243] Mon, 16 May 2011 09:27 Go to previous messageGo to next message
syl20a is currently offline  syl20a   France
Messages: 2
Registered: May 2011
Karma: 0
Junior Member
I've got 211 forums in 82 categories
Re: Re : Re: Caterogies may be hidden [message #165247 is a reply to message #165244] Mon, 16 May 2011 13:14 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
To be honest, I don't understand that code and I'm not sure if 15 would be the best value. Shouldn't we, for example, rather make it 20 (or even higher). Or would that we too much?
Re: Caterogies may be hidden [message #165476 is a reply to message #165242] Sun, 26 June 2011 06:25 Go to previous messageGo to next message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma: 0
Member
Den Mon, 16 May 2011 08:12 skrev syl20a:
Hello,

include/cat.inc use an array with a numeric key to sort categories and forums in cache

the numeric key is computed like this :
$c += pow(10, 2 + $ml - $lvl[0]]) * $v[4];


!?!?!
What is this about !?
Could it be that the text of a category shall be converted into a numeric for identification purposes?

Or do you want to make the numerics correlate, so if you show in numerical $c order, the forum come up in a logical order?
Please kindly, kill the POW before you figure out what it do!

number pow( number $base, number $exp)
Returns base raised to the power of exp.

NEVER NEVER enter into the floating point unless you do science calculations or similar work. Always set the BUG flag to all such code. I once removed the floating points from a point-of-sales terminal.

Floating point have (... they are called the Ureal Numbers!) have the nasty habit of working only somtimes or mostly.

I am willing to help to change this into something else.
Re: Caterogies may be hidden [message #165477 is a reply to message #165476] Sun, 26 June 2011 08:12 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Yea, this is a nasty piece of code.
It would be fantastic if you can re-write it or simply add comments to make to understandable.
My guess is that it creates gaps between categories for forums so that it can be sorted as a hierarchy (for display on the index page).
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Error During Consistency Checking
Next Topic: Permissions to Edit Messages on 3.0.2
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 27 22:20:37 GMT 2024

Total time taken to generate the page: 0.02250 seconds