MyBB Community Forums

Full Version: Custom Forum Icons (Including On/Off)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Please can someone explain how I can use custom icons with on/off icons on mybb 1.8?
All I've been able to find is instructions for old versions of mybb which don't work on newer versions, I've read that this is due to mybb using classes in later versions.

Here are the instructions I found for old versions of mybb:

Quote:ACP -> Templates & Style -> Templates -> YOUR_THEME Templates -> Forum Bit Templates ->forumbit_depth2_forum

Search for:

<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']}/ficon/icon_{$forum['fid']}_{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" /> 

Create a new folder insede your theme image folder and name it ficon and upload each independ forum icon this way:

icon_X_on.png
icon_X_off.png
icon_X_offlock.png

X = Forum ID

The instructions I found for using custom icons on mybb 1.8 don't mention on/off icons:

http://community.mybb.com/thread-160518-...pid1107253

http://community.mybb.com/thread-92128.html
Someone else had luck with the following:


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

Then throw the gifs inside the theme image directory. It's just like other mybb versions.
It didn't work Sad, the forum is attempting to load "on.gif"/"off.gif" images within the same directory, rather than custom on/off images based on the fid.I'm surprised no one else has asked this question for newer versions of mybb, I searched for a couple of hours yesterday and I could only find answers for old versions.

Thanks for your suggestion Smile
Have you tried the code from the quoted tutorial?
<img src="{$theme['imgdir']}/ficon/icon_{$forum['fid']}_{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
I see no reason why it wouldn't work. Except that the JS will not change the icon after click, but tutorials never considered it.
Hi, I understand that you want to make your language many do not know me.

Find the altaki code from the template forumbit_depth2_forum

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


Add your code


<img src="{$theme['imgdir']}/cat/{$forum['fid']}.png" width="35" height="35"/>


then FTP to upload images in the form of open folder named 1.png 2.png cat home directory.
(02-28-2015, 05:48 PM)msm1 Wrote: [ -> ]It didn't work Sad, the forum is attempting to load "on.gif"/"off.gif" images within the same directory, rather than custom on/off images based on the fid.I'm surprised no one else has asked this question for newer versions of mybb, I searched for a couple of hours yesterday and I could only find answers for old versions.

Thanks for your suggestion Smile

Sorry, I didn't realize you were talking about custom icons per forum. My  bad.

As Destroy666 mentioned - there's no obvious reason that the specific tutorial you posted wouldn't work for 1.8
(02-28-2015, 05:57 PM)Destroy666 Wrote: [ -> ]Have you tried the code from the quoted tutorial?


<img src="{$theme['imgdir']}/ficon/icon_{$forum['fid']}_{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
I see no reason why it wouldn't work. Except that the JS will not change the icon after click, but tutorials never considered it.

I feel very silly Blush
I tried the tutorial but it was after I had followed this one:

http://community.mybb.com/thread-92128.html

which states to name the folder "ficons" where as the one I quoted in my post uses a "ficon" folder.
I also didn't pay attention to the file extension, one calls for png files and the other gif files.

Thank you all for helping, rep given Smile


For anyone else that is intrested in doing this, the quoted tutorial in my original post is outdated, the code it tells you to find isn't present.
You need to find:
<td class="{$bgcolor}" align="center" valign="top" width="1"><div class="forum_status forum_{$lightbulb['folder']} ajax_mark_read" title="{$lightbulb['altonoff']}" id="mark_read_{$forum['fid']}"></div></td>

and replace it with:


<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir']}/ficon/icon_{$forum['fid']}_{$lightbulb['folder']}.png" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}"/></td>

Being a newbie it took me a little while to realise that, at first I removed the td class and a few things became unaligned. Toungue
is it working without bugs on 1.8.5?
This definitely still works with mybb 1.8.5
Still working fine for me Smile.