Autor Tópico: View Single Category  (Lida 6356 vezes)

0 Membros e 2 Visitantes estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5073
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
View Single Category
« em: 27 de Janeiro de 2008, 10:52 »

sourcedir/BoardIndex.php

Pesquisar por
Código: [Seleccione]
WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : ''), __FILE__, __LINE__);

Alterar por
Código: [Seleccione]
WHERE $user_info[query_see_board]" . (empty($modSettings['countChildPosts']) ? "
AND b.childLevel <= 1" : '')
. (isset($_REQUEST['f']) ? "
AND c.ID_CAT = ".$_REQUEST['f']."
ORDER BY boardOrder ASC" : ''), __FILE__, __LINE__);


Código: [Seleccione]
$context['categories'][$row_board['ID_CAT']]['link'] = '<a name="' . $row_board['ID_CAT'] . '" href="' . (isset($row_board['canCollapse']) ? $context['categories'][$row_board['ID_CAT']]['collapse_href'] : $context['categories'][$row_board['ID_CAT']]['href']) . '">' . $row_board['catName'] . '</a>';
Código: [Seleccione]
// Single Category Mod Edited This.
$context['categories'][$row_board['ID_CAT']]['link'] = '<a name="' . $row_board['ID_CAT'] . '" href="' . $context['categories'][$row_board['ID_CAT']]['href'] . '">' . $row_board['catName'] . '</a>';
 
// Single Category Mod
if(isset($_REQUEST['f']))
$context['linktree'][] = array(
'url' => $scripturl . '?' . (!empty($context['TPortal']) ? 'action=forum;' : '') . 'f=' . $row_board['ID_CAT'],
'name' => $row_board['catName']);


Código: [Seleccione]
// [color=orange]Find all boards and categories, as well as related information.  This will be sorted by the natural order of boards and categories, which we control[/color].
Código: [Seleccione]
// Single Category Mod
if (isset($_REQUEST['f']) && (is_array($_REQUEST['f']) || !is_numeric($_REQUEST['f'])))
unset($_REQUEST['f']);
elseif(isset($_REQUEST['f']))
$_REQUEST['f'] = (int) $_REQUEST['f'];
 
// Single Category Mod Needs This to Load the JumpTo on BoardIndex
loadJumpTo();


Código: [Seleccione]
'href' => $scripturl . '#' . $row_board['ID_CAT'],
Código: [Seleccione]
'href' => $scripturl . '?' . (!empty($context['TPortal']) ? 'action=forum;' : '') . 'f=' . $row_board['ID_CAT'],


$sourcedir/Load.php

Código: [Seleccione]
if (count(array_intersect($user_info['groups'], $board_info['groups'])) == 0 && !$user_info['is_admin'])
$board_info['error'] = 'access';

Código: [Seleccione]
/*
// Comment this out

Código: [Seleccione]
array_reverse($board_info['parent_boards']),
Código: [Seleccione]
*/
 
// This is cheating but TinyPortal Modifies this as well.
                // Build up the linktree
$context['linktree'] = array_merge(
$context['linktree'],
array(array(
'url' => $scripturl . '?' . (!empty($context['linktree'][0]['name']) && $context['linktree'][0]['name'] == 'Forum' ? 'action=forum;' : '') . 'f=' . $board_info['cat']['id'],
                                'name' => $board_info['cat']['name']
                        )),



thema/BoardIndex.template.php

Código: [Seleccione]
// Show the mark all as read button?
if ($settings['show_mark_read'] && !empty($context['categories']))
echo '
<table cellpadding="0" cellspacing="0" border="0" style="position: relative; top: -5px;">
<tr>
', template_button_strip($mark_read_button, 'top'), '
</tr>
</table>';
echo '
</td>
</tr>
</table>';
}
 

Colocar por baixo
Código: [Seleccione]
if(isset($_GET['f']))
{
echo '
<div style="float:right;">
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto">' . $txt[160] . '</label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt[251] . ':</option>';
 
// Show each category - they all have an id, name, and the boards in them.
foreach ($context['jump_to'] as $category)
{
// Show the category name with a link to the category. (index.php#id)
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="?', (!empty($context['TPortal']) ? 'action=forum;' : ''), 'f=', $category['id'], '">', $category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>';
 
/* Now go through each board - they all have:
id, name, child_level (how many parents they have, basically...), and is_current. (is this the current board?) */
foreach ($category['boards'] as $board)
{
// Show some more =='s if this is a child, so as to make it look nice.
echo '
<option value="?board=', $board['id'], '.0"', $board['is_current'] ? ' selected="selected"' : '', '> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>';
}
}
echo '
</select>&nbsp;
<input type="button" value="', $txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \'', $scripturl, '\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
</form></div><br/>';
}
 


$thema/MessageIndex.template.php

Pesquisar por
Código: [Seleccione]
<option value="" disabled="disabled">-----------------------------</option>
<option value="#', $category['id'], '">', $category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>';

Alterar por
Código: [Seleccione]
<option value="" disabled="disabled">-----------------------------</option>
<option value="?', (!empty($context['TPortal']) ? 'action=forum;' : ''), 'f=', $category['id'], '">', $category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>';


$thema/Display.template.php

Código: [Seleccione]
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="#', $category['id'], '">', $category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>';

Alterar por
Código: [Seleccione]
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="?', (!empty($context['TPortal']) ? 'action=forum;' : ''), 'f=', $category['id'], '">', $category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>';


No BoardIndex.php os primeiros codigos e pra pesquisar e outro e pra alterar o que pesquisou