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…

  • Dodaj komentarz

kanał RSS
Szukaj
Tagi:
wordbb mysql baza danych theme styl optymalizacja php seo 1.4 wordpress config SQL Start wywiad modyfikacje Dokumentacja 1.6 aktualizacja Bezpieczeństwo style mybbsite wygląd mybboard.net Porady Aktualności ogólne