0 Membros e 3 Visitantes estão a ver este tópico.
//For tidying boards; examine the children and realign into groups for tidyingfunction tidyBoards(&$board) { global $modSettings, $context, $settings; $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++; } $board['tidy_children'] = $children; // We don't need the original children (plus this means way less mess in templates) unset($board['children']);}
// Do not let search engines index anything if there is a random thing in $_GET.
if(empty($context['added_tidy_header']) && !empty($modSettings['tidy_child_boards']) && $modSettings['tidy_child_boards'] > 1) { if(empty($context['html_headers'])) $context['html_headers'] = ''; $context['html_headers'] .= ' <link rel="stylesheet" type="text/css" href="' . $settings['default_theme_url'] . '/css/tidyboards.css?rc2" /> <style type="text/css">.tidy_child { width:' . floor(100/$modSettings['tidy_child_boards']) . '%; }</style>'; $context['added_tidy_header'] = 1; }
// If we can view unapproved
array('check', 'enableVBStyleLogin'),
'', array('select', 'tidy_child_boards', array(1 => $txt['tidy_child_boards_no'], 2 => $txt['tidy_child_boards_2col'], 3 => $txt['tidy_child_boards_3col'], 4 => $txt['tidy_child_boards_4col'])), array('check', 'tidy_child_boards_bold'), array('check', 'tidy_child_boards_icon'), array('check', 'tidy_child_boards_new'),
foreach ($category['boards'] as $board) {
if(!empty($board['children']) && !empty($modSettings['tidy_child_boards']) && $modSettings['tidy_child_boards'] > 1) tidyBoards($board);
// Show some basic
if(!empty($board['tidy_children'])) { $context['tidy_board'] = $board; template_tidy_children(); }
function template_tidy_children() { global $context, $settings, $txt, $modSettings; echo ' <div class="board_children">'; foreach($context['tidy_board']['tidy_children'] as $key => $child_block) { echo ' <div class="tidy_child"> <ul>'; foreach($child_block as $child) { echo ' <li>'; if(!empty($modSettings['tidy_child_boards_icon'])) echo '<img src="', $settings['images_url'], '/', ($child['new'] ? 'on' : 'off'), '.png" width="12" height="12" 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>'; echo $child['link'], '</li>'; } echo ' </ul> </div>'; } echo ' </div>';}
foreach ($context['boards'] as $board) {
function template_tidy_children() { global $context, $settings, $txt, $modSettings; echo ' <div class="board_children">'; foreach($context['tidy_board']['tidy_children'] as $key => $child_block) { echo ' <div class="tidy_child"> <ul>'; foreach($child_block as $child) { echo ' <li>'; if(!empty($modSettings['tidy_child_boards_icon'])) echo '<img src="', $settings['images_url'], '/', ($child['new'] ? 'on' : 'off'), '.gif" width="12" height="12" 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>'; echo $child['link'], '</li>'; } echo ' </ul> </div>'; } echo ' </div>';}
// Smfpt Suporte translate candidosa2$txt['tidy_child_boards'] = 'Organizar os Sub-quadros em colunas';$txt['tidy_child_boards_no'] = 'Não coloque nas colunas';$txt['tidy_child_boards_2col'] = 'Duas colunas';$txt['tidy_child_boards_3col'] = 'Três colunas';$txt['tidy_child_boards_4col'] = 'Quatro coluna';$txt['tidy_child_boards_icon'] = 'Exibe o ícone de pequena do quadro ao lado do Sub-quadro';$txt['tidy_child_boards_bold'] = 'Mostrar os sub-quadro não lidas em negrito';$txt['tidy_child_boards_new'] = 'Mostrar imagem [novo] ao lado de sub-quadro não lida.';