MyBB Community Forums

Full Version: Custom Forum Icons - Custom Template Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Problem:
I've been trying to edit my template based on Yaldaram's tutorial (His Tutorial). to create an area for custom forum icons. I've got the jist of it, but have failed to get 100% results. So I'm going to supply the code, and if anyone can help with the correct edits that would be great.

Other Information:
Template: INS (Inspired by 2.0)
URL: realmoneytrades.com

The Code:
This code is not altered, and is in it's original state.
ACP > Templates > Your theme's templates > Forumbit templates > forumbit_depth1_cat
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead" colspan="2"><strong><a href="{$forum_url}">{$forum['name']}</a></strong> ยป <span style="font-size: 11px;"> {$forum['description']}
<td class="thead" width="85" align="center" style="white-space: nowrap" colspan="1"><span class="smalltext"><strong>{$lang->forumbit_threads}</strong></span>
</td>

<td class="thead" width="85" align="center" style="white-space: nowrap" colspan="1"><span class="smalltext"><strong>{$lang->forumbit_posts}</strong></span>
</td>

<td class="thead" width="200" align="center" colspan="1"><span class="smalltext" ><strong>{$lang->forumbit_lastpost}</strong></span><span style="float: right;"><img src="{$theme['imgdir']}/{$expcolimage}" id="cat_{$forum['fid']}_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></span>
</td>
</td>
</tr>
</thead>
<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">
{$sub_forums}
</tbody>
</table>
<div class="table_footer"></div>
<br />

ACP > Templates > Your theme's templates > Forumbit templates > forumbit_depth2_forum
<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="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="left" style="white-space: nowrap">{$lastpost}</td>
</tr>

ACP > Templates > Your theme's templates > Forumdisplay templates > forumdisplay_subforums
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="5" align="center"><strong>{$lang->sub_forums_in}</strong></td>
</tr>
<tr>
<td class="tcat" width="2%">&nbsp;</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>
<div class="table_footer"></div>
<br />

Additional Code (Clarkie's Ref.)
<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="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>
Not entirely sure what I'm looking for but it does appear that you should be editing another template: forumbit_depth2_cat

The template is the same as forumbit_depth2_forum except it does not have {$modlist} in the template.

If you're trying to add a new column for icons then you don't appear to have added one.

Are you trying to replace the on/off/offlock icons with custom on/off/offlock icons for each forum or are you trying to add icons next to these?
(2012-02-20, 09:50 PM)Clarkie Wrote: [ -> ]Not entirely sure what I'm looking for but it does appear that you should be editing another template: forumbit_depth2_cat

The template is the same as forumbit_depth2_forum except it does not have {$modlist} in the template.

If you're trying to add a new column for icons then you don't appear to have added one.

Are you trying to replace the on/off/offlock icons with custom on/off/offlock icons for each forum or are you trying to add icons next to these?

Hey Clarkie,

I've edited my original post to have forumbit_depth2_cat in case it's needed. I've not made any edits yet, because I reverted them all back to their originals. I would like to replace the on/off/offlock icons themselves with custom on/off/offlock icons unique to each forum.
In forumbit_depth2_forum, find

<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>

Replace with
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir']}/icons/{$forum['fid']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" /></td>

Now inside your theme folder, make a folder called "icons". Now for every Forum, find its forum ID. Rename your image file to that forum ID (if forum id is 1 then the name of image should be 1.gif). Upload the icons to the 'icons' folder you created.
(2012-02-21, 01:49 PM)kavin Wrote: [ -> ]In forumbit_depth2_forum, find

<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>

Replace with
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir']}/icons/{$forum['fid']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" /></td>

Now inside your theme folder, make a folder called "icons". Now for every Forum, find its forum ID. Rename your image file to that forum ID (if forum id is 1 then the name of image should be 1.gif). Upload the icons to the 'icons' folder you created.

This didn't work, it 'worked' in the sense of:

Some forums state in text, "Forum Contains No New Posts". Instead of the on/off/offlock pictures.
(2012-02-21, 09:53 PM)Captivate Wrote: [ -> ]This didn't work, it 'worked' in the sense of:

Some forums state in text, "Forum Contains No New Posts". Instead of the on/off/offlock pictures.

Make sure that all images are with .gif extension, and you have named them properly to name of the forum ID.


P.S:-
You should put Yuvapix's theme copyright back.
In forumbit_depth2_forum, find

<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />

replace with

<img src="{$theme['imgdir']}/{$lightbulb['folder']}{$forum['fid']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />

Then add as many on/off/offlock icons to your forum's image folder as you have forums. Name them onX, offX and offlockX (with X standing for the id number of the forum you want to use said on and off images for. Make sure they are .gif