UBB.Dev
Posted By: Gizmo [7.x] Subforum Highlights - 09/12/2014 7:10 AM
Author: Gizmo/Gremelin (James of VNC Web Design)

Requirements:
Valid UBB.Threads install and license.

About:
This quick modification will "highlight" your subforums, just like we have here at UBB.Dev.


New Image (place in your "general" image folders):
https://www.ubbdev.com/forums/images/general/default/subforum.png - Provided by our good friend id242.

The Modification
Add the following to your style (CP -> Display Options -> Styles -> Edit Style, Extra Properties):
Code
.subforum {
background: #E9ECF2;
border: 1px solid #708097;
-moz-border-radius: 4px;
border-radius: 4px;
display: inline;
padding-left: 2px;
padding-right: 2px;
white-space: nowrap;
}
.subforum a {
text-decoration: none;
}

In libs/functions_forums.inc.php:
Find:
Code
				$returndata[$i]['subforum_links']["$sub_id"][0] = sprintf('<a href="%s">%s</a>', make_ubb_url("ubb=postlist&Board=$sub_id&page=1", $title, false), $title);

Replace With::
Code
				$returndata[$i]['subforum_links']["$sub_id"][0] = sprintf('<div class="subforum"><a href="%s">%s</a></div>', make_ubb_url("ubb=postlist&Board=$sub_id&page=1", $title, false), $title);

Find:
Code
				$returndata[$i]['subforums'] .= ($subforum_moo[0] . (($subforum_moo[1] > 0) ? sprintf(' <span class="newtotal">(%s)</span>', $subforum_moo[1]) : '') . ', ');

Replace With::
Code
				$returndata[$i]['subforums'] .= ($subforum_moo[0] . (($subforum_moo[1] > 0) ? sprintf(' <span class="newtotal">(%s)</span>', $subforum_moo[1]) : '') . ' ');


In templates/default/forum.tpl:
Find:
Code
					{if $forum[cats][fora].subforums}{$lang.SUBFORUMS} {$forum[cats][fora].subforums}{/if}

Replace With::
Code
					{if $forum[cats][fora].subforums}<img src="{$config.BASE_URL}/images/{$style_array.general}/subforum.png" alt=""> {$forum[cats][fora].subforums}{/if}


Please leave your thanks below so we can know that we've helped you!



UBBT 7.5.8 using UBBCentral.com default "blue-orange" style:


Description: BEFORE:
Attached picture subforums1.png

Description: AFTER (with this mod):
Attached picture subforums2.png
Posted By: Bill B Re: [7.x] Subforum Highlights - 09/12/2014 12:07 PM
Did I miss seeing the "new image"?
Posted By: isaac Re: [7.x] Subforum Highlights - 09/12/2014 12:14 PM
Bill, under "New Image" in the OP, download the png from here...
https://www.ubbdev.com/forums/images/general/default/subforum.png
...and place it in your /forums/images/general/default/ folder.
Posted By: Gizmo Re: [7.x] Subforum Highlights - 09/12/2014 12:27 PM
Bill, look under "New Image" and to the left of "Provided by our good friend id242"; it blends in; or the direct URL as Isaac pointed out is https://www.ubbdev.com/forums/images/general/default/subforum.png
Posted By: Bill B Re: [7.x] Subforum Highlights - 09/12/2014 12:40 PM
Okay, found it... I saw my mouse change shape, but I didn't right click on it.

Is the "arrow" suppose to be a new-style link to images? I haven't seen this before.


------
Oh, wait!! The arrow IS THE IMAGE.... okay, I get it.
Posted By: Gizmo Re: [7.x] Subforum Highlights - 09/12/2014 1:24 PM
Haha, yes, the new image is the arrow... Let me make it stand out more, lol
Posted By: Bill B Re: [7.x] Subforum Highlights - 09/12/2014 2:14 PM
Okay... one more clarification if you don't mind.

I haven't installed, or tested, this yet, but I"m a tad confused as to what you mean by "will "highlight" your subforums".

A while ago, I added code which "color-codes" my forums depending upon which "group" my members belong in. Is this change similar?
Posted By: isaac Re: [7.x] Subforum Highlights - 09/12/2014 2:55 PM
I just added some screenshots to the OP

Very nice mod, Gizmo. Following your directions, it was quick and easy to implement.
Posted By: Gizmo Re: [7.x] Subforum Highlights - 09/13/2014 4:25 AM
Isaac's screen captures on the initial post cover it nicely.
© UBB.Developers