Advertisement:

Author Topic: Tidy Child Boards  (Read 137851 times)

Offline Wapilbn

  • Semi-Newbie
  • *
  • Posts: 10
Re: Tidy Child Boards
« Reply #440 on: May 12, 2016, 03:28:57 AM »
i install this mod on 2.0.5 or 2.06 version of SMF and do updates do 2.0.xx (11).... thats why i'm afraid this isnt work...

Offline br360

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,398
    • GenXcommunity
Re: Tidy Child Boards
« Reply #441 on: May 12, 2016, 03:38:08 AM »
You said on another post that you are using 2.0.11, is that correct?

If you go into your package manager and emulate the version to 2.0.5 or 2.0.6 (or whatever earlier version is needed to uninstall this), your forum itself isn't actually going to that version, you are only emulating your version for the sole purpose of installing/uninstalling that specific mod.

Read the link that was posted earlier as it does explain in much better detail what actually happens when you emulate your version- http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn%27t_work_in_my_SMF_version

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Tidy Child Boards
« Reply #442 on: May 12, 2016, 04:24:01 AM »
I really should write a new version that just installs on all 2.0 versions and doesn't make theme edits.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Wapilbn

  • Semi-Newbie
  • *
  • Posts: 10
Re: Tidy Child Boards
« Reply #443 on: May 12, 2016, 05:16:51 AM »
I really should write a new version that just installs on all 2.0 versions and doesn't make theme edits.

Oh yes yes yes :) Please do that !:)


Ps. Ok, a reinstall this mod ( emulated 2.0.4 ) and... and nothing :( Not work....  only in REDSY :/   In other themes ( like premium CITIEZ by dzinerstrudio ) it work, everything is ok. In REDSY not... i don't know what is going on..

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,991
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Tidy Child Boards
« Reply #444 on: May 12, 2016, 07:04:20 AM »
That would be awesome if you could Arantor. :)
Please do not PM me for support.

Offline br360

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,398
    • GenXcommunity
Re: Tidy Child Boards
« Reply #445 on: May 12, 2016, 02:35:04 PM »
In other themes ( like premium CITIEZ by dzinerstrudio ) it work, everything is ok. In REDSY not... i don't know what is going on..

I did double check by following the uninstall/reinstall steps above, and it will work on redsy without having to do any manual edits on that theme. Did you make sure to check the redsy theme as well when you scrolled to the Install in Other Themes option?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Tidy Child Boards
« Reply #446 on: May 12, 2016, 05:18:05 PM »
OH HAI THAR

I just added a new version of the mod, (almost) complete rewrite done this evening. Only this time, NO THEME EDITS REQUIRED, and it only makes two file edits this time.
No good deed goes unpunished
All helpful urges should be circumvented

Offline br360

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,398
    • GenXcommunity
Re: Tidy Child Boards
« Reply #447 on: May 12, 2016, 05:27:53 PM »
Nice. Thank you Arantor.  :)

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,991
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Tidy Child Boards
« Reply #448 on: May 12, 2016, 08:10:47 PM »
Freaking awesome job Arantor! ;D

Was one column not an option?
Please do not PM me for support.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Tidy Child Boards
« Reply #449 on: May 13, 2016, 12:38:08 AM »
One column was never an option ;)
No good deed goes unpunished
All helpful urges should be circumvented

Offline Steve

  • Freak
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,991
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Tidy Child Boards
« Reply #450 on: May 13, 2016, 08:50:07 AM »
Works for me then. ;D
Please do not PM me for support.

Offline Wapilbn

  • Semi-Newbie
  • *
  • Posts: 10
Re: Tidy Child Boards
« Reply #451 on: May 13, 2016, 11:16:27 AM »
Super. Everything works fine :)

Btw... how to increase distance between columns ? ( in two colums configuration )

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Tidy Child Boards
« Reply #452 on: May 13, 2016, 11:17:16 AM »
Screenshot please?
No good deed goes unpunished
All helpful urges should be circumvented

Offline Wapilbn

  • Semi-Newbie
  • *
  • Posts: 10
Re: Tidy Child Boards
« Reply #453 on: May 13, 2016, 03:11:16 PM »

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Tidy Child Boards
« Reply #454 on: May 13, 2016, 03:30:19 PM »
There isn't the room to make it wide enough. Even if the spacing is adjusted, it's going to put the long name up against the other column.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Biology Forums

  • SMF Hero
  • ******
  • Posts: 3,781
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: Tidy Child Boards
« Reply #455 on: May 16, 2016, 02:01:12 AM »
There isn't the room to make it wide enough. Even if the spacing is adjusted, it's going to put the long name up against the other column.

Perhaps you could add

Code: [Select]
white-space: nowrap;
into the
Code: [Select]
<li>

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Tidy Child Boards
« Reply #456 on: May 16, 2016, 02:37:01 AM »
That would force it onto one line, sure, but the resultant combined width would make the containers flow oddly and force the lists to partially attempt to flow outside of the container since they're floated.
No good deed goes unpunished
All helpful urges should be circumvented

Offline musicus

  • Jr. Member
  • **
  • Posts: 179
  • Gender: Male
    • @net_mu on Twitter
    • Mucic for open ears
Re: Tidy Child Boards
« Reply #457 on: October 25, 2016, 05:16:22 PM »
Hi problem with the new tidychild

Code: [Select]
Fatal error:  Cannot redeclare tidyChildBoards() (previously declared in /homepages/14/d562938237/htdocs/musociety/Sources/Subs-BoardIndex.php:345) in /homepages/14/d562938237/htdocs/musociety/Sources/Subs-BoardIndex.php on line 345
Here from line 345
What is wrong? My PHP-knowing is very small

Code: [Select]
   // Now we tidy the child boards. As if by magic.
   function tidyChildBoards(&$board)
   {
      global $modSettings, $context, $settings, $scripturl, $txt;

      $limit = ceil(count($board['children']) / $modSettings['tidy_child_boards']);
      $children = array();
      $this_count = $limit + 1;
      $this_division = 0;
      foreach ($board['children'] as $child)
      {
         if ($this_count >= $limit)
         {
            $this_division++;
            $this_count = 0;
         }
         $children[$this_division][] = $child;
         $this_count++;
      }

      // Having split the board into columns, dump the original children
      // and build the new layout
      unset ($board['children']);
      $board['description'] .= '<div class="board_children">';
      foreach ($children as $child_block)
      {
         $board['description'] .= '<div class="tidy_child"><ul>';
         foreach ($child_block as $child)
         {
            $board['description'] .= '<li>';
            if(!empty($modSettings['tidy_child_boards_icon']))
               $board['description'] .=  '<img src="' . $settings['images_url'] . '/' . ($child['new'] ? 'on' : 'off') . '.png" class="tidyboardimg" alt="" /> ';

            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'] . '</a>';
            else
               $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';

            if (!empty($modSettings['tidy_child_boards_new']) && $child['new'])
               $child['link'] .= ' <a href="' . $child['href'] . '" 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>';

            // 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'] > $child['unapproved_posts'] ? '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>';

            if(!empty($modSettings['tidy_child_boards_bold']) && $child['new'])
               $child['link'] = '<strong>' . $child['link'] . '</strong>';

            $board['description'] .= $child['link'];

            $board['description'] .= '</li>';
         }
         $board['description'] .= '</ul></div>';
      }
      $board['description'] .= '</div>';
   }

   $add_header = false;
   if (!empty($modSettings['tidy_child_boards']) && $modSettings['tidy_child_boards'] > 1)
   {
      if (!empty($boardIndexOptions['include_categories']))
      {
         // Doing the full listing
         foreach ($categories as $cat_id => $cat)
         {
            foreach ($cat['boards'] as $board_id => $this_board)
            {
               if (!empty($this_board['children']))
               {
                  tidyChildBoards($this_board);
                  $categories[$cat_id]['boards'][$board_id] = $this_board;
                  $add_header = true;
               }
            }
         }
      }
      else
      {
         // Doing a single board
         foreach ($this_category as $board_id => $this_board)
         {
            if (!empty($this_board['children']))
            {
               tidyChildBoards($this_board);
               $this_category[$board_id] = $this_board;
               $add_header = true;
            }
         }
      }
   }

   if (empty($context['html_headers']))
      $context['html_headers'] = '';

   if ($add_header)
   {
      $context['html_headers'] .= '
   <link rel="stylesheet" type="text/css" href="' . $settings['default_theme_url'] . '/css/tidychildboards2.css?fin20" />
   <style type="text/css">.tidy_child { width:' . floor(90/$modSettings['tidy_child_boards']) . '%; }</style>';
   }

   // By now we should know the most recent post...if we wanna know it that is.
   if (!empty($boardIndexOptions['set_latest_post']) && !empty($latest_post['ref']))
      $context['latest_post'] = $latest_post['ref'];

   return $boardIndexOptions['include_categories'] ? $categories : $this_category;
}

at first I deinstall it....

Offline Kindred

  • The Mean One
  • Lead Support Specialist
  • SMF Legend
  • *
  • Posts: 60,423
  • Gender: Male
    • Kindred-999 on GitHub
Re: Tidy Child Boards
« Reply #458 on: October 25, 2016, 06:28:22 PM »
you have double-installed the mod...  you will have to manually remove the duplicated code...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Offline musicus

  • Jr. Member
  • **
  • Posts: 179
  • Gender: Male
    • @net_mu on Twitter
    • Mucic for open ears
Re: Tidy Child Boards
« Reply #459 on: November 23, 2016, 09:45:33 PM »
I install now the old version