Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
/*
* kokuda: Added $sep and $seplocation to mimick wordpress' ability to generate a title in any order with any separators.
*
* @param string $sep Optional, default is ' » '. How to separate the various items within the page title.
* @param string $seplocation Optional. Direction to display title, 'right'.
*/
function generate_title($sep = ' » ', $seplocation = '') {
switch ($GLOBALS['plogger_level']) {
case 'collection':
$row = get_collection_by_id($GLOBALS['plogger_id']);
$breadcrumb_array[] = SmartStripSlashes($row['name']);
if ($GLOBALS['plogger_mode'] == 'slideshow') {
$breadcrumb_array[] = plog_tr('Slideshow');
}
break;
case 'slideshow':
case 'album':
$row = get_album_by_id($GLOBALS['plogger_id']);
$album_name = SmartStripSlashes($row['name']);
$row = get_collection_by_id($row['parent_id']);
if ($GLOBALS['plogger_mode'] == 'slideshow') {
$breadcrumb_array[] = SmartStripSlashes($row['name']);
$breadcrumb_array[] = $album_name;
$breadcrumb_array[] = ' '.plog_tr('Slideshow');
} else {
$breadcrumb_array[] = SmartStripSlashes($row['name']);
$breadcrumb_array[] = $album_name;
}
break;
case 'picture':
$row = get_picture_by_id($GLOBALS['plogger_id']);
$picture_name = get_caption_filename($row);
$row = get_album_by_id($row['parent_album']);
$album_name = SmartStripSlashes($row['name']);
$row = get_collection_by_id($row['parent_id']);
$collection_name = SmartStripSlashes($row['name']);
$breadcrumb_array[] = $collection_name;
$breadcrumb_array[] = $album_name;
$breadcrumb_array[] = $picture_name;
// Hmm, slideshow on picture level, how does that make sense?
if ($GLOBALS['plogger_mode'] == 'slideshow') {
$breadcrumb_array[] = plog_tr('Slideshow');
}
break;
case '404':
$breadcrumb_array[] = ' '.plog_tr('404 Error - Not Found');
break;
default:
$breadcrumb_array[] = ' '.plog_tr('Collections');
}
if ($GLOBALS['plogger_level'] != '404' || $GLOBALS['plogger_level'] != 'search' || $GLOBALS['plogger_level'] != 'slideshow') {
if (isset($_GET['plog_page'])) {
$breadcrumb_array[] = plog_tr('Page').' '.$_GET['plog_page'];
}
}
if ( 'right' == $seplocation ) { // sep on right, so reverse the order
$breadcrumb_array = array_reverse( $breadcrumb_array );
$breadcrumbs = implode( $sep, $breadcrumb_array );
} else {
$breadcrumbs = implode( $sep, $breadcrumb_array );
}
return $breadcrumbs;
}
1 to 2 of 2