grandchild new posts did not add into parent board after 2 lelvels

Started by julia_yl, February 14, 2010, 05:36:19 PM

Previous topic - Next topic

julia_yl

SMF 2.0 RC2
as the title it could not count new posts from grandchild to grandparent?
only child add to parent?

Arantor

It does that for performance reasons - it is intentional, not a bug.

To change it is a change to the code.

julia_yl

Ince install, never changed a cold, should I install again?
I am bothered by the total calculate to be lost from grandchild. :'(

Arantor

Reinstalling won't change a thing. It is how the code is deliberately and intentionally written for performance reasons. IT IS NOT A BUG.

That said, it is possible to change if you want to slow your forum down by editing Subs-BoardIndex.php.

julia_yl

well, how can I fix it? any resolvent?
or show any board of grandchild in here that be counted upto grandparent , more than 3 generation?
:'(

Arantor

There probably is, by untangling the logic in Subs-BoardIndex, but seriously the extra overhead of doing it is surprisingly large, and is to be AVOIDED IF AT ALL POSSIBLE.

It may be possible - though FIRMLY UNTESTED - to simply remove the skip rule:
// Found a child of a child - skip.
else
continue;

julia_yl

Thanks ,but does not work  :'(
// Found a child of a child - skip.
      //else  //by julia because of board total could not count more than 3 generation
         //continue; by julia

Arantor


Caltan

Hi, I  know this thread is a little old, but it's the most recent I can find on this topic.

By "doesn't work," in my case commenting out those lines changes nothing, even after clearing forum cache and recounting all forum totals.  The main board index only shows 2 posts in a forum, when there are 3 -- two in child forums and one in a grandchild forum. 

I understand that changing this is a significant performance hit; regardless, I would like to evaluate the performance stresses for myself (since infinite subforum nesting is one of the draws of the software), so I just need to know what code to change.  I'm totally comfortable doing so, I just need to know what and where. :)

Arantor

Well the real stress depends on how many boards you have; it's relatively predictable because instead of natural subselect of boards, and associated joins to the topic, messages and members tables, you do a table scan.

So how many boards do you have total? And how many do you have that are affected by this?

Caltan

Twenty top-level forums, twenty-one child forums, and a dozen grandchild forums spread over the board (no more than three grandchildren per child; several have only one).  It's a directory system with strict lines of delineation for sorting purposes, and once there are a certain percentage of posts I'm not sure that counting grandchildren will be necessary; however, as it's just opening and activity breeds activity, it's important to show all the posts extant at first glance right now.

Arantor

That's 2 levels, not > 2 levels, which should work provided all boards have 'count posts' marked on them.

Caltan

Except that I do and it does not.  "Count posts" is checked for every forum, and "Count child's posts in parent's totals" is also checked globally.

The structure goes like so:  Forum --> Subforum (2 topics) --> Sub-Subforum (1 topic, 2 posts).
Forum, on the main index, shows 2 topics only, and the most recent post listed is from Subforum, not the more recent reply within Sub-Subforum.

Arantor



Arantor

Looks like you also need to modify:
WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),


to
WHERE {query_see_board}',


Mods: please move this to 2.0 support; it is not a bug in SMF.

Caltan

Awesome.  This doesn't affect the last post display, unfortunately, so I stuck with just changing ['base_level'] + 1 to  ['base_level'] + 2 to fix the global post count, which was all I really had to have.  Thanks!

sene1983

Quote from: Arantor on April 08, 2010, 10:00:43 AM
Looks like you also need to modify:
WHERE {query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
AND b.child_level >= {int:child_level}') : '
AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),


to
WHERE {query_see_board}',


Mods: please move this to 2.0 support; it is not a bug in SMF.

its really very good. exactly i was looking for this code. thank you very much Arantor.

but, at the right (unread posts), if last post is in sub of sub forum, notting shown. how can i change this?
for example:



as u see, no last post at my board.
could u help me?


devoetbalkantine

I have also tried this but like I figured out earlier this week I am not capable of making this work. I would like to know (Maybe Arantor knows) how to make topics in 3rd layer sections (grandchild boards) visible on the index page.

I want to test it on a test forum first, just to see how it works but I don't know which scipts to edit and where.

Advertisement: