21
sie
2009
Widok działów i poddziałów można trochę ubogacić dodając ikonkę, która odpowiada tematyce danego działu.
Ikony działów powodują, że korzystanie z forum jest bardziej intuicyjne. Należy poświęcić trochę czasu aby dobrać odpowiednie ikony.
Zaloguj się do panelu administratora, z menu wybierz style i szablony, następnie szablony i wybierz swój styl. Rozwiń paczkę opis działu – szablony. Teraz będziesz musiał pozmieniać kod w szablonach.
Otwórz szablon forumbit_depth1_cat, usuń zawartość i wklej poniższy kod
<table class="tborder" border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}"> <thead> <tr> <td class="thead" colspan="6"> <div class="expcolimage"><img id="cat_{$forum['fid']}_img" class="expander" title="{$expaltext}" src="{$theme['imgdir']}/{$expcolimage}" alt="{$expaltext}" /></div> <div><strong><a href="{$forum_url}">{$forum['name']}</a></strong> <div class="smalltext">{$forum['description']}</div> </div></td> </tr> </thead> <tbody id="cat_{$forum['fid']}_e" style="{$expdisplay}"> <tr> <td class="tcat" colspan="2"></td> <td class="tcat"><span class="smalltext"><strong>{$lang->forumbit_forum}</strong></span></td> <td class="tcat" style="white-space: nowrap" width="85" align="center"><span class="smalltext"><strong>{$lang->forumbit_threads}</strong></span></td> <td class="tcat" style="white-space: nowrap" width="85" align="center"><span class="smalltext"><strong>{$lang->forumbit_posts}</strong></span></td> <td class="tcat" width="200" align="center"><span class="smalltext"><strong>{$lang->forumbit_lastpost}</strong></span></td> </tr> {$sub_forums}</tbody></table><br />
Otwórz szablon forumbit_depth2_cat, usuń zawartość i wklej poniższy kod
<tr> <td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" /></td> <td class="{$bgcolor}" valign="center"><img src="{$theme['imgdir']}/icons/{$forum['fid']}.png" /></td> <td class="{$bgcolor}" valign="top"> <strong><a href="{$forum_url}">{$forum['name']}</a></strong>{$forum_viewers_text}<div class="smalltext">{$forum['description']}{$subforums}</div> </td> <td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$threads}{$unapproved['unapproved_threads']}</td> <td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$posts}{$unapproved['unapproved_posts']}</td> <td class="{$bgcolor}" valign="top" align="right" style="white-space: nowrap">{$lastpost}</td> </tr>
Otwórz szablon forumbit_depth2_forum, usuń zawartość i wklej poniższy kod
<tr> <td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" /></td> <td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir']}/icons/{$forum['fid']}.png" /></td> <td class="{$bgcolor}" valign="top"> <strong><a href="{$forum_url}">{$forum['name']}</a></strong>{$forum_viewers_text}<div class="smalltext">{$forum['description']}{$modlist}{$subforums}</div> </td> <td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$threads}{$unapproved['unapproved_threads']}</td> <td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$posts}{$unapproved['unapproved_posts']}</td> <td class="{$bgcolor}" valign="top" align="right" style="white-space: nowrap">{$lastpost}</td> </tr>
Teraz rozwiń paczkę widok działu – szablony, otwórz szablon forumdisplay_subforums, usuń całą zawartość tego szablonu i wklej poniższy kod
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder"> <tr> <td class="thead" colspan="6" align="center"><strong>{$lang->sub_forums_in}</strong></td> </tr> <tr> <td class="tcat" width="2%"> </td> <td class="tcat"></td> <td class="tcat" width="59%"><span class="smalltext"><strong>{$lang->forumbit_forum}</strong></span></td> <td class="tcat" width="7%" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_threads}</strong></span></td> <td class="tcat" width="7%" align="center" style="white-space: nowrap"><span class="smalltext"><strong>{$lang->forumbit_posts}</strong></span></td> <td class="tcat" width="15%" align="center"><span class="smalltext"><strong>{$lang->forumbit_lastpost}</strong></span></td> </tr> {$forums} </table> <br />
Teraz musisz przygotować ikony(wszystkie jako pliki PNG), pliki umieść w katalogu images/icons. Ikony muszą jako nazwę mieć ID danego działu/poddziału. Aby łatwiej sprawdzić ID poszczególnych działów/poddziałów otwórz plik admin/modules/forum/management.php i znajdź kod
2129 | $form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum/management&fid={$forum['fid']}\">{$forum['name']}</a>{$forum['description']}{$sub_forums}</div>"); |
i powyższy kod zamień na
$form_container->output_cell("<div style=\"padding-left: ".(40*($depth-1))."px;\"><a href=\"index.php?module=forum/management&fid={$forum['fid']}\">{$forum['name']}</a> ({$forum['fid']}) {$forum['description']}{$sub_forums}</div>");
Teraz w w zakładce działy i posty w nawiasie będzie pokazywało się ID działu/poddziału. Jeżeli np. dział „test” ma ID=3, to ikona musi mieć nazwę 3.png.
Jesteś tutaj: Strona główna > Dokumentacja i porady > Porady > Ikony działów i poddziałów.

Znajdź nas
Dołącz do

a gdzie jest ten images/icons?
Nigdzie
Stwórz taki folder.
Przypominam, że od rozwiązywania problemów jest forum http://forum.mybbsite.pl
ehhh… po użyciu tego nazwy działów nakładają się na obrazki w operze…
Witam, zrobiłem według instrukcji jednak nadal wyświetlają się ikonki on.gif / off.gif . Czy do tego potrzebny jest jakiś plugin ?
Ale ten poradnik nie ma na celu usunięcia ikon sygnalizujących nowe posty, tylko ma na celu dodanie dodatkowych ikon. W przypadku dodatkowych pytań zapraszam na forum
Ja nie mogę otworzyć tego pliku :admin/modules/forum/management.php wyskakuje
irect initialization of this file is not allowed.
Please make sure IN_MYBB is defined.
Czemu na innych stylach to nie dziala?
[...] typu, i chciałbym przywrócić poprzednie ustawienia, jak to zrobić, modyfikacje wziąłem stąd: http://mybbsite.pl/ikony-dzialow-i-poddzialow/ Kategorie: Bez kategorii. Autor: . Dodaj zakładkę do bezpośredniego [...]