Ikony działów i poddziałów.

21 sierpnia 2009 | Łukasz | Tagi: , , ,

Widok działów i poddziałów można trochę ubogacić dodając ikonkę, która odpowiada tematyce danego działu.

Ikony działów

Ikony działów

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%">&nbsp;</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&amp;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&amp;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.

Dodaj do:
wykop Dodaj do Google Dodaj do blip dodaj do Del.icio.us dodaj do Facebook dodaj do flakera Dodaj jako nius na OSnews.pl!
Komentarze: »
  • gostek ( 29 grudnia 2009 | 0:56) #

    a gdzie jest ten images/icons?

  • Łukasz ( 29 grudnia 2009 | 1:50) #

    Nigdzie :) Stwórz taki folder.

    Przypominam, że od rozwiązywania problemów jest forum http://forum.mybbsite.pl

  • lolec ( 7 marca 2010 | 23:00) #

    ehhh… po użyciu tego nazwy działów nakładają się na obrazki w operze…

  • xxxx ( 12 marca 2010 | 1:39) #

    Witam, zrobiłem według instrukcji jednak nadal wyświetlają się ikonki on.gif / off.gif . Czy do tego potrzebny jest jakiś plugin ?

  • Łukasz ( 12 marca 2010 | 13:03) #

    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

  • xxxxxxxxxxxxxxxxxxxxxxx ( 3 czerwca 2010 | 20:53) #

    Ja nie mogę otworzyć tego pliku :admin/modules/forum/management.php wyskakuje :D irect initialization of this file is not allowed.

    Please make sure IN_MYBB is defined.

  • Dodaj komentarz

    Prosimy nie zgłaszać swoich problemów poprzez komentarze! W przypadku problemów zapraszamy nasza forum.

kanał RSS
Szukaj
Tagi:
theme optymalizacja styl wordbb baza danych mysql hosting seo Matt Rogowski mybboard.pl trick szablony mstg mikroblogi php SQL beta config łatka wordpress 1.4 mybb.com domeny konkurs Start modyfikacje wywiad Dokumentacja Bezpieczeństwo style aktualizacja 1.6 wygląd mybbsite mybboard.net Porady Aktualności ogólne