- Timestamp:
- 04/25/08 13:24:47 (7 months ago)
- Files:
-
- 1 modified
-
trunk/plog-functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plog-functions.php
r533 r534 1 1 <?php 2 2 3 function generate_breadcrumb(){ 4 global $config; 5 6 $id = $GLOBALS["plogger_id"]; 3 function generate_breadcrumb($collections = 'Collections', $sep = ' » ', $translate = true){ 4 global $config; 5 6 $id = $GLOBALS['plogger_id']; 7 8 if ($translate === true){ 9 $collections = plog_tr(SmartStripSlashes($collections)); 10 } 11 $collections_link = ' <a href="'.$config['baseurl'].'">' . $collections . '</a>'; 12 $collections_name = ' <strong>' . $collections . '</strong>'; 7 13 8 14 switch ($GLOBALS['plogger_level']) { 9 15 case 'collection': 10 16 $row = get_collection_by_id($id); 11 12 $breadcrumbs = ' <a accesskey="/" href="'.$config["baseurl"].'">' . plog_tr('Collections') . '</a> » <b>' . SmartStripSlashes($row["name"]) . '</b>'; 13 if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= ' » ' . plog_tr('Slideshow'); 17 $collection_name = '<strong>' . SmartStripSlashes($row['name']) . '</strong>'; 18 19 $breadcrumbs = $collections_link . $sep . $collection_name; 20 21 // Does this ever happen? Collection level + slideshow mode ends in SQL error 22 if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= $sep . '<strong>' . plog_tr('Slideshow'); 14 23 15 24 break; … … 17 26 case 'album': 18 27 $row = get_album_by_id($id); 19 20 $album_name = SmartStripSlashes($row["name"]); 21 $album_link = generate_url("album",$row["id"]); 22 23 $row = get_collection_by_id($row["parent_id"]); 24 25 $collection_link = '<a accesskey="/" href="' . generate_url("collection",$row["id"]) . '">' . $row["name"] . '</a>'; 28 $album_name = '<strong>' . SmartStripSlashes($row['name']) . '</strong>'; 29 $album_link = '<a accesskey="/" href="' . generate_url("album", $row['id']) . '">' . SmartStripSlashes($row['name']) . '</a>'; 30 31 $row = get_collection_by_id($row['parent_id']); 32 $collection_link = '<a accesskey="/" href="' . generate_url("collection", $row['id']) . '">' . SmartStripSlashes($row['name']) . '</a>'; 26 33 27 34 if ($GLOBALS['plogger_mode'] == "slideshow") { 28 29 $breadcrumbs = ' <a href="'.$config["baseurl"].'">' . plog_tr('Collections') . '</a> » ' . $collection_link . ' » ' . '<a href="'.$album_link.'">'.$album_name.'</a> » ' . ' <b>' . plog_tr('Slideshow') . '</b>'; 35 $breadcrumbs = $collections_link . $sep . $collection_link . $sep . $album_link . $sep . '<strong>' . plog_tr('Slideshow') . '</strong>'; 30 36 } else { 31 32 $breadcrumbs = ' <a href="'.$config["baseurl"].'">' . plog_tr('Collections') . '</a> » ' . $collection_link . ' » ' . '<b>'.$album_name.'</b>'; 37 $breadcrumbs = $collections_link . $sep . $collection_link . $sep . $album_name; 33 38 } 34 39 … … 36 41 case 'picture': 37 42 $row = get_picture_by_id($id); 38 $picture_name = get_caption_filename($row);43 $picture_name = '<span id="image_name"><strong>' . SmartStripSlashes(get_caption_filename($row)) . '</strong></span>'; 39 44 40 45 $row = get_album_by_id($row["parent_album"]); 41 42 $album_link = '<a accesskey="/" href="' . generate_url("album",$row["id"]) . '">' . SmartStripSlashes($row["name"]) . '</a>'; 46 $album_link = '<a accesskey="/" href="' . generate_url("album", $row['id']) . '">' . SmartStripSlashes($row['name']) . '</a>'; 43 47 44 48 $row = get_collection_by_id($row["parent_id"]); 45 46 $collection_link = ' <a href="'.$config["baseurl"].'">' . plog_tr('Collections') . '</a> ' . ' » ' . '<a href="' . generate_url("collection",$row["id"]) . '">' . SmartStripSlashes($row["name"]) . '</a>';47 48 $breadcrumbs = $collection_link . ' » ' . $album_link . ' » ' . '<span id="image_name"><b>' . $picture_name.'</b></span>';49 50 if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= ' »' . plog_tr('Slideshow');49 $collection_link = '<a accesskey="/" href="' . generate_url("collection", $row['id']) . '">' . SmartStripSlashes($row['name']) . '</a>'; 50 51 $breadcrumbs = $collections_link . $sep . $collection_link . $sep . $album_link . $sep . $picture_name; 52 53 // Does this ever happen? Picture level + slideshow adds 'Slideshow' to breadcrumbs only 54 if ($GLOBALS['plogger_mode'] == "slideshow") $breadcrumbs .= $sep . '<strong>' . plog_tr('Slideshow'); 51 55 52 56 break; 53 57 case 'search': 54 $breadcrumbs = plog_tr('You searched for') . ' <b>'.htmlspecialchars($_GET["searchterms"]).'</b>.';58 $breadcrumbs = $collections_link . $sep . '<strong>'.plog_tr('Search').'</strong>' . $sep . plog_tr('You searched for') . ' <strong>'.htmlspecialchars(SmartStripSlashes($_GET['searchterms'])).'</strong>.'; 55 59 break; 56 60 default: 57 $breadcrumbs = ' <b>' . plog_tr('Collections') . '</b>';61 $breadcrumbs = $collections_name; 58 62 break; 59 63 }
