Link in Breadcrumb trail

GroovyFish
GroovyFish's picture

Joined: 2003-11-12
Posts: 2
Posted: Wed, 2003-11-12 17:41

Hi All,

I have spent about an hour trying to find my answer here in the forums, but no luck.

I would like to add a simple link to my homepage to the breadcrumb trail so that visitors don't have to back all the way out to get back home.

I am just starting out with PHP, so the more explicit the instructions, the better.

Thanks a bunch!!

Login or register to post comments
rsramirez

Joined: 2003-11-03
Posts: 16
Posted: Wed, 2003-11-12 18:48

Apply this code

/* home breadcrumb start */
if (strcmp($pAlbum->fields["returnto"], "no")) {
   $breadtext[$breadCount] ="<a href=\"/\">[Home]</a>";
   $breadCount++;
}
/* home breadcrumb end */

as illustrated below

} while ($pAlbumName);
/* INSERT IT HERE */
//-- we built the array backwards, so reverse it now ---

in view_album.php and any other php's w/ crumbs
it might work better in the do-while statement, or include more code to detect if the session is offline

Login or register to post comments
GroovyFish
GroovyFish's picture

Joined: 2003-11-12
Posts: 2
Posted: Thu, 2003-11-13 15:27

Thank you very much!

It works great! I really appreciate your help!

Login or register to post comments
rsramirez

Joined: 2003-11-03
Posts: 16
Posted: Thu, 2003-11-13 18:42

=)

Login or register to post comments
freshjerky

Joined: 2005-02-16
Posts: 2
Posted: Wed, 2005-02-16 06:12

This code works great on my view_album.php and view_photo.php pages.

I can't seem to find where to put this to get it to show up on the main albums.php page.

Any advice?

Thanks

Login or register to post comments
freshjerky

Joined: 2005-02-16
Posts: 2
Posted: Fri, 2005-02-18 01:37

There doesn't appear to be any code in albums.php relating to breadcrumbs (you don't even get the 'Logged in as: Username' message). So, an assumption would be that I just need to copy over any code relating to breadcrumbs from the view_album.php into albums.php.

Has anyone done this before and know what all needs to be moved over?

Thanks

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 18451
Posted: Fri, 2005-02-18 06:20

Why not use the wrapper files this is what they are for and you don't have to edit the files after each upgrade?

But if you want a link next to the lagin and welcome message:
In albums.php look for

if ($gallery->user->isLoggedIn() && !$gallery->session->offline) {

	$displayName = $gallery->user->displayName();
	$adminCommands .= sprintf(_("Welcome, %s"), $displayName) . " <br>";
}

and add $adminCommands .= " <a href=\"your_url_to_home/index.php\">Home</a> ";

Login or register to post comments