Advertisement:

Posts per day returning wierd numbers

Aloittaja deathshadow, elokuu 23, 2006, 09:16:47 AP

« edellinen - seuraava »

deathshadow

in RC3 - to the tune of about 1000 times what it should...

$context['member']['posts_per_day'] specifically.

and yes, I tried recounting forum totals.

Oh, and for some reason the stats page in people's profiles ends up rendering about 2000 pixels wide regardless of the user's browser or screen (in the default theme, has OTHER issues in my custom theme)

"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies." – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
http://www.cutcodedown.com

deathshadow

#1
Ok, whatever the problem was with the posts per day (and most every other number on my forums), it was related to the changes to the comma_format function in subs.php. Specifically this line:

function comma_format($number, $override_decimal_count = false)

completely screws things up. get rid of the ", $override_decimal_count = false" and it works fine.

I have to ask though, what the devil are you trying to do here?

return number_format($number, is_float($number) ? ($override_decimal_count === false ? $decimal_count : $override_decimal_count) : 0, $decimal_separator, $thousands_separator);

Being your new version always sets it to false, and it doesn't even EXIST in the RC2 version, wouldn't it be simpler to strip out that if statement while in there?

Oh, and why, might I, ask.... are the, comments in that, section, written like dialog for, William Shatner?
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies." – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
http://www.cutcodedown.com

Grudge

I don't understand why this is happening TBH. Could you please answer me two questions:
1) Are you using UTF8 charset or not?
2) What does this result in when run in phpMyAdmin:

SELECT value FROM smf_settings WHERE variable = 'number_format'


Thanks,

Grudge
I'm only a half geek really...

Mr. Jinx

#3
Hello, I have exactly the same behavior on my forum after the RC3 upgrade.
For example, in the users profile the number of post are correct, but the posts per day are way to high.

1) I did not convert to UTF8
2) The result of the query gives "1234.00"

I changed the number format to "1.234,00" and now everything is fine.

ediww

same here, temporary solution as jinx's.

is it safe to use deathshadow's approach?

do this have something to do with the loadavg "fuse" integrated in 1.1?

edi
Beep-beep-beep. Beep-woop-woo. Beep-boop.

Advertisement: