News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Statistics report on Board count

Started by Burke ♞ Knight, August 10, 2013, 09:05:20 PM

Previous topic - Next topic

Burke ♞ Knight

It seems that when delete boards, the statistics do not drop the board count, as seen on the site here.

QuoteGeneral Statistics

Total Members:     321,019
Total Posts:     3,387,130
Total Topics:     414,020
Total Categories:     13
Users Online:     989
Most Online:     3,726 - January 18, 2008, 10:00:17 PM
Online Today:     1,305

Average registrations per day:     102.65
Average posts per day:     975.97
Average topics per day:     124.37

Total Boards:     205

Latest Member:     MiltonMYN
Average online per day:     1,070.49
Male to Female Ratio:     7.7:1

The forum should deduct the deleted board from the count.

Arantor

Well, the highest board id I can find is 244. But there's still an ambiguity there because there's no way there are 205 boards visible to me. The figure should take into account the boards visible to users.

(That also indicates there are a significant number of boards on this site that aren't in use which seems very unnecessary.)

Burke ♞ Knight

True. The display is set for total, but I agree, it should "hide" the number of boards that the user cannot see.

However, the downside to that is the extra coding that would take.

Arantor

The method used is wrong.

$result = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}boards AS b
WHERE b.redirect = {string:blank_redirect}',
array(
'blank_redirect' => '',
)
);
list ($context['num_boards']) = $smcFunc['db_fetch_row']($result);


This means all the non redirect boards. Thing is, they're boards. And board access isn't counted. First thing I'd do would be:

$result = $smcFunc['db_query']('', '
SELECT COUNT(*)
FROM {db_prefix}boards AS b
WHERE b.redirect = {string:blank_redirect}
AND {query_see_board}',
array(
'blank_redirect' => '',
)
);
list ($context['num_boards']) = $smcFunc['db_fetch_row']($result);

emanuele

I think it is done that way on purpose.

Post count is the total of all the messages posted including those in board you cannot see.
The same is true for categories, and also for the "forum history" (as far as I can see).

I think it make sense: those are the general statistics of the entire forum, not of the part a certain user can see...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Burke ♞ Knight

What about the original question?

Are there really 205 boards, or were some deleted that have not been removed from the count?

emanuele

#6
I have no idea, also I'm not an admin so I may not have access to at least...5/6/10 boards, don't know, but more importantly: I have no intention to go around on all the boards, child board, child of child, child of child of child, etc. of the crazy setup that is sm.org. :P
But, considering that just looking at the board index I can count 140+ boards (a couple or three may be redirects), 205 is very likely to be correct.

ETA: and anyway, it's an SQL count, so if it is wrong, it means something is there and if something is in the table it is showed somewhere...so it cannot be wrong... I think.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

serval

Quote from: emanuele on August 11, 2013, 05:47:42 AM
ETA: and anyway, it's an SQL count, so if it is wrong, it means something is there and if something is in the table it is showed somewhere...so it cannot be wrong... I think.

If you click on "More stats", are the figures recalculated on the fly, or are you shown the historic recorded count? My guess is that the figures are not re-calculated every time you click. I'll tell you why: on our quiet little forum, if I make a test post, 10 seconds after midnight, the daily post count shows as 1. If I then delete that post, the count STILL shows as one - even though I can easily see, at that quiet time, that nobody else has made a post in the meantime. So the post total is not decremented when a post is deleted; the same may be true for a board. But then you here also have your 'visibility' issues, etc., for your boards.

Anyway, that's just my 2 ha'p'orth / 2 cents' worth as an outsider.  ;)

emanuele

The statistics are calculated live, but are not based on {db_prefix}messages, but rather on {db_prefix}log_activity, so they are the messages created independently from the ones deleted. That's why the message you deleted is still recorded as a message *posted* during that day.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

serval


Advertisement: