MyBB Community Forums

Full Version: Custom Banner on different forums [solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've looked around some old threads and can't seem to find a solution.  On the forum display for some forums but NOT all I want to designate a specific banner / image to replace the logo I have in my header. Any ideas? 

In my Header template I have some code that is similar to: 

<div class="logo"></div>

And the CSS file has something similar to this: 

.logo {
background: url("URLOFIMAGEHERE.JPG") no-repeat;
height: 400PX;
width: 1200px;
}


On some of the forums I want to change the banner but not all.
Forums not using the custom logo need to use the default based on the skin the user has selected (we have multiple skins). 
I do NOT want to make a skin for each forum because we will be utilizing multiple skins.

Any help?
Legacy solution would be something around the lines of :

<div class="logo_{$forum['fid']}"></div>

.logo_1 {
background: url("URLOFIMAGEHERE.JPG") no-repeat;
height: 400PX;
width: 1200px;
}

But that would require {$forum['fid']} to be set otherwise the newer the PHP version you use, the likelihood that you will get a warning. Plus the variable would vary based on the page being browsed (forum thread list, actual thread page, etc).

I would rather suggest you to go with the safe approach and use a plugin, like mine :
https://community.mybb.com/mods.php?action=view&pid=50

If you find any issues with it feel free to report them, as I'm in the process of updating my plugins. Next version will probably allow uploading files from the control panel.
Work around to the above would be to add a class to the body tag in forumdisplay (and if you want newthread, editpost, and newpost) for the plain $fid variable.
<body class="forum_{$fid}">

You could then set CSS to
body.forum_#FID# .logo_1 {
background: url("URLOFIMAGEHERE.JPG") no-repeat;
height: 400PX;
width: 1200px;
}
Replacing #FID# with each forum id you wish to use a custom logo on.

I use something pretty similar for banner images per forum.
Thank you both. I was able to solve the issue with the plugin @Omar G linked.
If you happen to find any issues or have suggestions please feel free to share them in the support thread for them to be reviewed as suitable:
https://community.mybb.com/thread-130877.html

I will be updating this plugin in the following weeks anyways.