MyBB Community Forums

Full Version: Custom Icon for Linked Forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
One of the things I don't like about the current version of MyBB is that there is no indication that a forum is linked to an external URL. So I delve into the depths of the MyBB folders and found a way to change this.

WARNING: This requires core file edits. If you don't feel comfortable doing that, you shouldn't continue reading.

Open the file inc/functions_forumlist.php. Find these lines.
	// This forum is closed, so override the folder icon with the "offlock" icon.
	if($forum['open'] == 0 || $locked)
	{
		$folder = "offlock";
		$altonoff = $lang->forum_locked;
	}

Replace all those lines with these ones.
	if($forum['open'] == 0 || $locked)
	{
		$folder = "offlock";
		$altonoff = $lang->forum_locked;
		if($forum['linkto']!='')
		{
			$folder = "offlink";
			$altonoff = $lang->forum_linked;
		}
	}

Great, now you can create an image called offlink.gif in your theme's image directory and you can see that icon when a forum links somewhere offsite.

The one thing we have to do now is change the text that shows up when you hover the icon. By default when a forum is linked, the text is still "Forum Contains No New Posts". Let's change that to something that fits the situation.

Open inc/languages/YOURLANG/global.lang.php (Where YOURLANG is the folder that contains the language files of your forum's language.)

At the very end, but before the ?>, add this line.
$l['forum_linked'] = "Forum is Linked to an External Site";

All done! Now you have an image that indicates the forum links offsite, as well as custom text to show that.

I have attached an image that matches the default MyBB indicator icons, but you can create your own if you are using a different theme.

Enjoy!

EDIT: Updated the code so it works when the linked forum is also locked.
Very cool. Smile
Cheers Smile

EDIT: Updated the code so it works when the linked forum is also locked.
please help someone? I followed your instructions in this short tut.. but it don't work on my forums.. instead I'm getting an error.. anyone got answers.. I would really like to use this aswell :/

forums: http://forums.leviathan-scape.co.cc

The error is that no image- offlink.gif is being displayed and neither is the text that says about the link to different site.