MyBB Community Forums

Full Version: Change Subforum Tab Background
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello guys!
How to change subforum tab background one by one?

[Image: subforum.png]
(2018-08-11, 11:39 PM)_BcY Wrote: [ -> ]Hello guys!
How to change subforum tab background one by one?

https://i.hizliresim.com/4zVLMp.png

Access to the image has been denied.

So... we can't see what you are wanting.
Updated the link.
(2018-08-12, 08:27 PM)_BcY Wrote: [ -> ]Updated the link.

Honestly, I am not certain what you are asking for. Not following this part "one by one". 

Can you clarify this a bit?
Admin CP --> Templates & Styles --> Themes --> Default --> global.css

Find .thead and then edit the background color.
I think he wants to change the color of that thead for each specific forum, not just globally.
(2018-08-13, 03:08 AM)Thanos Wrote: [ -> ]I think he wants to change the color of that thead for each specific forum, not just globally.

Yea, I think you might be right.
Not tested but something like this should work:

Open 'forumdisplay_threadlist' template and locate this line:

<td class="thead" colspan="{$colspan}">

Change it to:

<td class="thead" colspan="{$colspan}" style="background: url('{$mybb->asset_url}/bg_{$fid}.png') repeat">

Now upload the background image files, named after your forum id ('bg_2.png', 'bg_7.png' etc) in your image folder.

You need to upload single image for each forum separately with the outlined naming pattern.
(2018-08-13, 12:19 PM)effone Wrote: [ -> ]Not tested but something like this should work:

Open 'forumdisplay_threadlist' template and locate this line:

<td class="thead" colspan="{$colspan}">

Change it to:

<td class="thead" colspan="{$colspan}" style="background: url('{$mybb->asset_url}/bg_{$thread['tid']}.png') repeat">

Now upload the background image files, named after your forum id ('bg_2.png', 'bg_7.png' etc) in your image folder.

You need to upload single image for each forum separately with the outlined naming pattern.


Correct if I'm wrong, but isn't $thread['tid'] the thread_id? I think they would want $thread['fid'] for forum_id; I can't imagine creating a background image per thread. Personally, I would have added a new CSS class based on the forum_id instead of directly referencing an image, which could result in a lot of 404 Not Found messages in your server log.
Yes you are correct. Just typed it on the fly using mobile.
Good spot.

May be its $foruminfo['fid'] or just $fid to be more correct (both works).

CSS class usage is the right choice if you know the number of forums you have and remember to add more classes whenever you add a forum. To avoid this remember thing I have suggested inline.
Pages: 1 2