2012-02-27, 09:31 PM
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.
Replace all those lines with these ones.
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.
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.
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.