Mod: Changing function breadcrumbs so it doesn't print "Home" (linked or not)
on the "Home" page.
Reason: It's been bugging me that there are all these (somewhat unnecessary) links to Home ... on the Home page. Some should be there. Some you can remove. Like the one in breadcrumbs. (This is a personal pet peeve, I'm not sure everyone will find the mod useful, but what the hey.)
Demo? Not live yet. As we say, it's "coming soon"...
**********^***********
0. Backup. You know you want to.
1. In index.php, make sure the breadcrumbs function call isn't wrapped in any HTML container, but instead is only
<?php breadcrumbs(); ?>
2. In snews.php, find the function breadcrumbs() and change it to the following:
//BREADCRUMBS
function breadcrumbs() {
global $categorySEF, $subcatSEF, $_POS, $_TITLE, $_NAME, $_XNAME;
$link = '<a href="'._SITE.'';
if (_ADMIN) {
echo $link.'administration/" title="'.l('administration').'">'.l('administration').'</a> '.l('divider').' ';
}
if(empty($categorySEF)) {echo '';} //NEW LINE
elseif (!empty($categorySEF)) {
echo '<div id="crumbs">'.$link.'" title="Link to home page">'.l('home').'</a>'; //CHANGED
if (!empty($categorySEF) && check_category($categorySEF) == false) {
echo (!empty($subcatSEF) ? ' '.l('divider').' '.$link.$categorySEF.'/" title="'.(!empty($_XNAME) ? $_XNAME : $_NAME).'">
'.(!empty($_XNAME) ? $_XNAME : $_NAME).'</a>' :
(!empty($_NAME) ? ' '.l('divider').' '.$_NAME:''));
if (!empty($subcatSEF) && $_XNAME) {
echo ($_POS==1 ? ' '.l('divider').' '.$link.$categorySEF.'/'.$subcatSEF.'/">'.$_NAME.'</a>' : ' '.l('divider').' '.$_NAME);
}
echo (!empty($_TITLE)? ' '.l('divider').' '.$_TITLE : '');
}
if (check_category($categorySEF) == true && $categorySEF != 'administration' && $categorySEF) {
echo ' '.l('divider').' '.l($categorySEF);}
echo '</div>';} //NEW LINE
}
3.
There is no step 3...
Note: On every page but "Home", the "Home link is of course preserved, the mod only changes the output on "Home".
Note 2: If anyone has suggestions for bettering, simplifying or economizing the code, I'm all eyes. (Me and PHP, not the best of friends.)
/* Edit: code cleaned up (there were some redundant bits left from my own build which shouldn't have been included). */