News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Recent Posts/Total Posts

Started by SWATORNOT, February 03, 2006, 01:59:58 AM

Previous topic - Next topic

SWATORNOT

First off let me say that I am very happy with this forum software and style.

I seem to be having some problems with my current SMF instalation, I have upgraded to the latest version of 1.0.6

I have several child boards within certain parts of the forum, the totals from each of the child boards does not appear, or add into the Post or Replies count on the main forum index.

Also when there is a new post in one of the child boards it does not show what that recent post was on the index. It only indicates that that specific board has a new post.

Before I upgraded to the latest version there was an update I was to install...which I did and it seemed to have fixed these issues. Though now with the new update it seems to be back again.

What, if anything can I do to solve this issue?

The forum is here: http://mnrat.com/boards/index.php [nofollow]


Be kind, I am still learning a bit of this website stuff but I have some knowledge of the basics...or so I think :-\

SWATORNOT

bump...

Do any of you have an idea of what a guy can do to solve this?

opschf

I was having problems with the child boards not incrementing the counts in the parent or main forum pages.  I went into the the BoardIndex.Template.php script (../themes/default/ directory).  I added/changed the following portion of the module:

            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            if (!empty($board['children']))
            {
               // Sort the links into an array with new boards bold so it can be imploded.
               $children = array();
               /* Each child in each board's children has:
                  id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
                  $tmp_child_posts = 0;
                  $tmp_child_topics = 0;

               foreach ($board['children'] as $child) {
                  $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                  $children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
                   $tmp_child_posts = $tmp_child_posts + $child['posts'];
                   $tmp_child_topics = $tmp_child_topics + $child['topics'];
               }
               //  modification:
                echo '<div style="padding-top: 1px;" class="smalltext"><i>', $txt['parent_boards'], ': ', implode(', ', $children), '</i></div>';
            }

                echo '<div style="padding-top: 1px;" class="smalltext"><i>', $txt['parent_boards'], ': ', implode(', ', $children), '</i></div>';
            }

            // Show some basic information about the number of posts, etc.
            echo '
      </td>
      <td class="windowbg" valign="middle" align="center" style="width: 12ex;"><span class="smalltext">
         ', $board['posts'] + $tmp_child_posts , ' ', $txt[21], ' ', $txt['smf88'], '<br />
         ', $board['topics'] + $tmp_child_topics,' ', $txt[330], '
      </span></td>

I am running one level of child boards. I could not figure out why they were not counting.  After adding the above code in red, the board started updating.  I have not checked it with any sub child board (grand child) for validity.

Hope this helps...

SWATORNOT

Ok, I have checked out my script and I cant find anything with the source you have posted...

I would copy the script and paste it here but I am not sure that is appropriate being how lengthy it is, if somebody is willing to look it over for me and wants me to do that i will...

Just not understanding...or finding where that above input needs to go now..


Advertisement: