UBB.Dev
Posted By: Myke [7.1] Removing Breadcrumb Redundancy - 03/01/2007 1:57 PM
When viewing a forum or sub-forum, it really bothered me to see the name of the forum I was in repeated twice in the breadcrumb - first as a link, second as plain text.

Instinctively, whenever I wanted to go up one level (the mouse-click equivalent of 'cd ..') I would always click on the second last segment in the breadcrumb, but when you had a breadcrumb that looked like:

site >> Forums >> Foo >> Foo

you'd wind up in the same forum again. This reeeeaallly annoyed me, so here's a little mod that removes the redundant forum name from the breadcrumb.

In libs/ubbthreads.inc.php, find:
Code
if ($inputTitle) {
$breadcrumb .= " » $inputTitle";
}
and change to:
Code
if ($inputTitle != $forum_title) {
$breadcrumb .= " » $inputTitle";
}

So now, when viewing a forum, you get:

site >> Forums >> Foo

and when viewing a thread, you get:

site >> Forums >> Foo >> Thread Title

as it should be!
Posted By: Gizmo Re: [7.1] Removing Breadcrumb Redundancy - 03/01/2007 2:44 PM
I like it, great job; and I agree completely on seeing where this could be annoying lol
Posted By: Ian_W Re: [7.1] Removing Breadcrumb Redundancy - 03/01/2007 4:22 PM
nice simple change - thanks smile
Posted By: Mark_S Re: [7.1] Removing Breadcrumb Redundancy - 03/01/2007 6:05 PM
Nice one,
I say youve just fixed a bug wink
Posted By: AllenAyres Re: [7.1] Removing Breadcrumb Redundancy - 03/01/2007 6:19 PM
Thank you smile
Posted By: Steve C Re: [7.1] Removing Breadcrumb Redundancy - 03/03/2007 12:46 AM
The above mod leaves the last unit on the Forum Summary as a redundant link to the current page.  So I changed the line before the above change by enclosing it within an if ... }

Original:
Code
$breadcrumb .= " » <a href=....
if ($inputTitle) {

Revised:
Code
if ($inputTitle != $forum_title) {
$breadcrumb .= " » <a href=....
}
if ($inputTitle) {

So now, when viewing a forum summary, I get:
site >> Forums >> Cat >> ForumName

I don't think the change affects the breadcrumb text on the thread-view page.
Posted By: Ian_W Re: [7.1] Removing Breadcrumb Redundancy - 03/04/2007 11:04 AM
To be honest I prefer the link to the current forum - I can click on it to refresh the forum and see if there are any new posts smile
Posted By: Gizmo Re: [7.1] Removing Breadcrumb Redundancy - 03/04/2007 11:30 PM
Originally Posted by Ian_W
To be honest I prefer the link to the current forum - I can click on it to refresh the forum and see if there are any new posts smile
agreed
Posted By: Steve C Re: [7.1] Removing Breadcrumb Redundancy - 03/06/2007 9:13 AM
Hmmmm, curious and interesting... I've always used the browser's refresh button. Since most sites don't have any type of refresh-specific link, I have gotten quite used to using the browser's button.
Posted By: Rick Re: [7.1] Removing Breadcrumb Redundancy - 03/28/2007 10:33 PM
Thanks Myke. I'll be making this change for 7.1.1.
© UBB.Developers