* Welcome

Hello and welcome to Seiryuu!

Seiryuu is an RPG resource, directory and discussion forum focused on coding and development for RPGs running on SimpleMachines Forum software.  Our directory is not limited (please feel free to link anything you'd like!), but if you're looking for fancy skins and RP-specific mods for SMF, this is the place for you.

Childboard PHP coding

  • Talkative Member
  • 29 posts
Childboard PHP coding
« on: January 04, 2017, 11:06:24 pm »
Code: [Select]
// 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. */
                                        foreach ($board['children'] as $child)
                                        {
                                                if (!$child['is_redirect'])
                                                        $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
                                                else
                                                        $child['link'] = '<li><a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a></li>';

                                                // Has it posts awaiting approval?
                                                if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
                                                        $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

                                                $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
                                        }
                                        echo '
                                        <div id="board_', $board['id'], '_children">
                                        <div class="children">
                                        <table><tr><td>', implode('</td><td>&#9899;</td><td>', $children), '
                                                </td></tr></table></div>
                                        </div>';
                                }
                  echo '           
               <div class="lastpost">';

So I have figured out how to do the childboard links with tables, but I have no idea how to get them to start a new row after so many
.  I have looked up several codes but they all brake my board.  The issue I am  sure is that I don't know  how to plug them into what I have. Any suggestions?

  • Administrator
  • corsec sniper
  • for srs!
  • 763 posts
Re: Childboard PHP coding
« Reply #1 on: January 06, 2017, 08:44:20 am »
Why are you trying to put your child board links in a table?  Divs will automatically wrap. There also used to be a mod that did this -- Tody Child Boards, IIRC, but I have no idea what version it supports.

Tags:
 


* Plugboard

* Links and Affiliates

Distant Fantasies Total Drama Website - The Best Role-Play Sites