SMF 1.1.x (Móbulos Manual) > Categoria
Tidy Child Boards - SubQuadros
(1/1)
candidosa2:
/Sources/BoardIndex.php
--- Código: ---?>
--- Fim de Código ---
--- Código: ---//For tidying boards; examine the children and realign into groups for tidying
function 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']);
}
--- Fim de Código ---
--- Código: ---// Find all boards
--- Fim de Código ---
--- Código: ---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'] . '/tidyboards.css?1110" />
<style type="text/css">.tidy_child { width:' . floor(100/$modSettings['tidy_child_boards']) . '%; }</style>';
$context['added_tidy_header'] = 1;
}
--- Fim de Código ---
/Sources/MessageIndex.php
--- Código: ---?>
--- Fim de Código ---
--- Código: ---//For tidying boards; examine the children and realign into groups for tidying
function 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']);
}
--- Fim de Código ---
--- Código: ---// Aren't children
--- Fim de Código ---
--- Código: ---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'] . '/tidyboards.css?1110" />
<style type="text/css">.tidy_child { width:' . floor(100/$modSettings['tidy_child_boards']) . '%; }</style>';
$context['added_tidy_header'] = 1;
}
--- Fim de Código ---
/Sources/ModSettings.php
--- Código: ---array('check', 'enableVBStyleLogin'),
--- Fim de Código ---
--- Código: --- '',
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'),
--- Fim de Código ---
BoardIndex.template.php
--- Código: ---foreach ($category['boards'] as $board)
{
--- Fim de Código ---
--- Código: ---if(!empty($board['children']) && !empty($modSettings['tidy_child_boards']) && $modSettings['tidy_child_boards'] > 1)
tidyBoards($board);
--- Fim de Código ---
--- Código: --- // Show some basic
--- Fim de Código ---
--- Código: ---if(!empty($board['tidy_children'])) {
$context['tidy_board'] = $board;
template_tidy_children();
}
--- Fim de Código ---
--- Código: ---?>
--- Fim de Código ---
--- Código: ---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=""> ';
$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . comma_format($child['topics']) . ', ' . $txt[21] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
if (!empty($modSettings['tidy_child_boards_new']) && $child['new'])
$child['link'] .= ' <a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . comma_format($child['topics']) . ', ' . $txt[21] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" class="new_posts" alt="" /></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>';
}
--- Fim de Código ---
MessageIndex.template.php
--- Código: ---foreach ($context['boards'] as $board)
{
--- Fim de Código ---
--- Código: ---if(!empty($board['children']) && !empty($modSettings['tidy_child_boards']) && $modSettings['tidy_child_boards'] > 1)
tidyBoards($board);
--- Fim de Código ---
--- Código: ---// Show some basic
--- Fim de Código ---
--- Código: ---if(!empty($board['tidy_children'])) {
$context['tidy_board'] = $board;
template_tidy_children();
}
--- Fim de Código ---
--- Código: ---?>
--- Fim de Código ---
--- Código: ---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=""> ';
$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . comma_format($child['topics']) . ', ' . $txt[21] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>';
if (!empty($modSettings['tidy_child_boards_new']) && $child['new'])
$child['link'] .= ' <a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . comma_format($child['topics']) . ', ' . $txt[21] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/new.gif" class="new_posts" alt="" /></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>';
}
--- Fim de Código ---
Modifications.teuidioma.php
--- Código: ---?>
--- Fim de Código ---
--- Código: ---// 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.';
--- Fim de Código ---
Navegação
Ir para versão completa