News:

Wondering if this will always be free?  See why free is better.

Main Menu

Child Board Count - Help with Code

Started by SanSite.Info, May 03, 2005, 10:54:00 AM

Previous topic - Next topic

SanSite.Info

Hey GUys

I want the child board post to be counted in the total post displayed in the forum.

I want my help in this.


After tweakin the code as suggested in the forum, I am gettin this problem.

"" Total Post n Topics Gets displayed in TOPICS Column "" and the "" POST Column gets filled with the LAST Post ""

And the Last post Column is empty.





Now here is the Code
Quote
   // 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. */
$myPostcount = 0;
                                        $myTopiccount = 0;
                                        foreach ($board['children'] as $child)
{
$myPostcount = $myPostcount + $child['posts'];
                                                $myTopiccount = $myTopiccount + $child['topics'];
$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'];
}

      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"><span class="smalltext">
', $board['posts'] +$myPostcount, ' ', $txt[21], ' ', $txt['smf88'], '<br />
', $board['topics'] +$myTopiccount,' ', $txt[330], '
</span></td>

Now As we know, I want the Topics and Post and Last Post to be displayed in the correct n perfect way.

[/color]




P.S
I am using SMF v 1.02, isnt there a way in this to enable coutin child board post, I saw UNKNOWN sayin tht from 1.01 it will be there.



Shadow's Pawn

Where did you edit this?  I'm not sure what you did.

I followed Grudge's advice here:
http://www.simplemachines.org/community/index.php?topic=26487.msg205816#msg205816

And it worked perfectly for me.

Owdy

Quote from: Shadow's Pawn on May 03, 2005, 11:42:36 AM
Where did you edit this?  I'm not sure what you did.

I followed Grudge's advice here:
http://www.simplemachines.org/community/index.php?topic=26487.msg205816#msg205816

And it worked perfectly for me.
Thats what i sayd to him. http://www.simplemachines.org/community/index.php?topic=34883.msg257852#msg257852

SanSite.Info, do you have good reason to open multiple topics about this issue?
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

SanSite.Info

#3
I thgt I opened only one topic

Anwyyz Coming back to the topic

Grudge has mentioned this code and asked people to find it in Board Index and it isnt present there.
Quote
// A valid child!
$isChild = true;


Can any1 can give me the correct Replacement.



I am using Element Theme

Owdy

#4
Quote from: SanSite.Info on May 03, 2005, 11:54:07 AM
I thgt I opened only one topic
Quick reminder: http://www.simplemachines.org/community/index.php?topic=34883.0

Quote from: SanSite.Info on May 03, 2005, 11:54:07 AM

Grudge has mentioned this code and asked people to find it in Board Index and it isnt present there.



Yes it is. Sources/Boardindex.php , line 154
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

SanSite.Info

C here m8

I tried and I got only half the output.

So i thgt its better i post it here and get the other half myself.
as it jus involves some code changin stuff

Owdy

Quote from: Owdy on May 03, 2005, 11:55:49 AM
Quote from: SanSite.Info on May 03, 2005, 11:54:07 AM

Grudge has mentioned this code and asked people to find it in Board Index and it isnt present there.



Yes it is. Sources/Boardindex.php , line 154
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

SanSite.Info

Quote from: Owdy on May 03, 2005, 12:00:37 PM
Quote from: Owdy on May 03, 2005, 11:55:49 AM
Quote from: SanSite.Info on May 03, 2005, 11:54:07 AM

Grudge has mentioned this code and asked people to find it in Board Index and it isnt present there.



Yes it is. Sources/Boardindex.php , line 154


NO

I have Element theme and this isnt present here, plz help asap.

SanSite.Info


Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Advertisement: