News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Tidy Child Boards

Started by Arantor, December 09, 2009, 04:00:36 AM

Previous topic - Next topic

Wapilbn

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...

br360

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

Arantor

I really should write a new version that just installs on all 2.0 versions and doesn't make theme edits.
Holder of controversial views, all of which my own.


Wapilbn

Quote from: Arantor 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.

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..

Steve

That would be awesome if you could Arantor. :)
DO NOT pm me for support!

br360

Quote from: Wapilbn on May 12, 2016, 05:16:51 AM
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?

Arantor

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.
Holder of controversial views, all of which my own.


br360

Nice. Thank you Arantor.  :)

Steve

Freaking awesome job Arantor! ;D

Was one column not an option?
DO NOT pm me for support!

Arantor

One column was never an option ;)
Holder of controversial views, all of which my own.


Steve

DO NOT pm me for support!

Wapilbn

Super. Everything works fine :)

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

Arantor

Holder of controversial views, all of which my own.


Wapilbn


Arantor

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.
Holder of controversial views, all of which my own.


Biology Forums

Quote from: Arantor 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.

Perhaps you could add

white-space: nowrap;

into the <li>

Arantor

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.
Holder of controversial views, all of which my own.


musicus

Hi problem with the new tidychild

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

   // 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....

Kindred

you have double-installed the mod...  you will have to manually remove the duplicated code...
Слaва
Украинi

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."

musicus

I install now the old version

Advertisement: