MyBB Community Forums

Full Version: forum icon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Yello guys.

I have been trying to add custom images for my forums like in /gif/ folder the images which will be for read forums and

in /.png/ this will be for unread forums.

and here is my

forumbit_depth2_cat

<tr>
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="images/forum_icons/f-{$forum['fid']}.png" 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>

and forumbit_depth2_forum

<tr>
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="images/forum_icons/gif/f-{$forum['fid']}.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="right" style="white-space: nowrap">{$lastpost}</td>
</tr>

if any1 may help me please?.


Regards,
Furqan.

somebody help?
i tried that only but its not the right thing what i want i want something like. http://www.elitearmy.eu/forumz/ and there was some plugin for that i found on internet but i always getting some weird errors so i decided to edit it manually after seeing some good tutorials but they all are showing something different then what i want so maybe check the site i wrote above and tell me how can i do that please.
You'll need to install and activate a plugin that allows the use of conditions (if/else) and check to see if all posts in a forum (section) has been read or not in order to use GIF for read and PNG for the unread. I don't remember the name off the top of my head though and I'm not finding it in the official MyBB Mods database, but I think it's call PHP in Templates (someone else able to confirm?). Otherwise, just make them the same image extension (either use PNG or GIF instead of both) and skip over the use of a plugin that supports if/else conditions in the templates.
ACP > Templates > Your theme's templates > Forumbit templates > forumbit_depth2_forum

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

With:
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="images/ficons/{$forum['fid']}.png" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read {$lightbulb['folder']}" id="mark_read_{$forum['fid']}" /></td>


Then add this to your CSS:
.off { opacity: 0.7 }

And of course upload your icons to images/ficons, should work just fine.
(2014-05-27, 11:20 AM)Eric J. Wrote: [ -> ]ACP > Templates > Your theme's templates > Forumbit templates > forumbit_depth2_forum

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

With:
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="images/ficons/{$forum['fid']}.png" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read {$lightbulb['folder']}" id="mark_read_{$forum['fid']}" /></td>


Then add this to your CSS:
.off { opacity: 0.7 }

And of course upload your icons to images/ficons, should work just fine.

Thanks a lot sir. it really works. but what i want is to use different image for "off" its in white and black color and the unread is colourful.
.off { 
-webkit-filter: grayscale(1); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%);
filter: gray; filter: grayscale(100%);
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
}

You can use that, it doesn't work in every browser but I'm afraid there's no other easy option.
Working perfectly sir thanks.
it worked perfect. but the thing is locked read forums are coloured only not black and white.