MyBB Community Forums

Full Version: Change one icon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have a question, how to change a icon of a forum without plugins.
Now standard you have a icons for forums if they have no new messages or unreaded messages and if the forum is locked.

If you set a forum as a link the icon is the same as the no new messages icon, I want to change only this icon for the forum link.
With template do I need to edit and wich code.

Important is to do this without plugins and only this one icon!
Sorry but I have nothing on this link, I ask to change the icon of this section not the hole lay-out of it... Nothing about images changes, only color from the background etc.

I ask for the image....
The method is basically the same though except you perform the edit where the icon is defined.

Find:

// Get the lightbulb status indicator for this forum based on the lastpost
			$lightbulb = get_forum_lightbulb($forum, $lastpost_data, $showlockicon);

After, add:

            if($forum['linkto']!='')
            {
                $lightbulb = array(
					'folder'	=> 'link',
					'altonoff'	=> 'This forum is a link'
				);
            }

Then, open the general.js file and modify the line that reads

if(element.src.match("off.gif") || element.src.match("offlock.gif") || (element.title && element.title == lang.no_new_posts)) return;

so that it becomes

if(element.src.match("off.gif") || element.src.match("offlock.gif") || (element.title && element.title == lang.no_new_posts) || (element.title && element.title == "This forum is a link")) return;

That should work anyway.
Cool this works great!!!

Thanks this help me very good, I hit the reputation button for you.

MANY THANKS HELPING ME!!!
As a quick follow up for anybody else who may want to do this, you also have to edit the general.js file as otherwise the title is edited. Quite why the title is set within the JS file is beyond me right now, but oh well.

To fix it, open general.js and replace line 32 with the following:

if(element.src.match("off.gif") || element.src.match("offlock.gif") || (element.title && element.title == lang.no_new_posts) || (element.title && element.title == "This forum is a link")) return;
Cool, also this works great!!!!

I hit the reputation again Big GrinBig GrinBig Grin

Thanks, thanks, thanks :-)