forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: questions on July 10, 2009, 12:10:04 pm

Title: Hide breadcrump from guest but show it to logged in users
Post by: questions on July 10, 2009, 12:10:04 pm
Hi,

is there a way to hide the breadcrump from guests but still show it to logged in users? I deleted the "breadcrump" part under Config/Album list view for the breadcrump to disappear but if there's a way I'd like my users to still see it. I just do not want the guests to go back to "Home" to find out I have many categories but do not allow them to view anything in them (all albums except for one are only visible to registered users). I am planning to give a direct link to the album's page for the guests so they do not have to navigate through my gallery. It works fine the way I organized it now but I'd still like to have the comfort of a breadcrump for me as an admin and my registered users.

Best wishes,
Jenni
Title: Re: Hide breadcrump from guest but show it to logged in users
Post by: Nibbler on July 10, 2009, 12:21:38 pm
Add this code to your custom theme.php

Code: [Select]
function theme_display_breadcrumb($breadcrumb, &$cat_data)
{
    /**
     * ** added breadcrumb as a seperate element
     */
    global $template_breadcrumb, $lang_breadcrumb;

    if (!USER_ID) {
        return false;
    }

    starttable('100%');
    if ($breadcrumb) {
        $template = template_extract_block($template_breadcrumb, 'breadcrumb');
        $params = array('{BREADCRUMB}' => $breadcrumb
            );
        echo template_eval($template, $params);
    }
        endtable();
}
Title: Re: Hide breadcrump from guest but show it to logged in users
Post by: questions on July 10, 2009, 12:28:56 pm
Thank your very much. The support is terrific.