require('inc/riis.inc.php');
$query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
$show_about_page = $query=="about.html";
$show_archives_page = substr( $query, 0, 8 )=='archives';
$show_blog_entry_page = !$show_about_page && !$show_archives_page;
// setup
$navigation = '';
$permalink = '';
// about url
$about_url = 'about.html';
if ( !$riis_clean_urls ) {
$about_url = '?'.$about_url;
}
// archives url
$archives_url = 'archives.html';
if ( !$riis_clean_urls ) {
$archives_url = '?'.$archives_url;
}
// rss url
$rss_url = 'riis.rss';
if ( !$riis_clean_urls ) {
$rss_url = $rss_url.'.php';
}
if ($show_about_page) {
// show the about page
$image = "$riis_about_title
$riis_about_html
";
$page_title = "$riis_title :: $riis_about";
}
if ($show_archives_page) {
if (strlen($query)>strlen($archives_url)) {
// show archives specified by 'archives-.html', e.g. 'archives2006-09.html'
$req_year = substr( $query, 8, 4 );
$req_month = substr( $query, 13, 2 );
} else {
// show archives for the current year and current month
$req_year = date( 'Y', time() );
$req_month = date( 'm', time() );
}
$image = render_archives_html( $req_year, $req_month );
$page_title = "$riis_title :: $riis_archives";
}
if ($show_blog_entry_page) {
// show normal blog entry
// find filenames
$url_image = replace_extension( $query, '.jpg' );
$this_image = $url_image=='' ? latest_image() : $url_image;
find_image_triple( $this_image, $prev_image, $next_image );
$prev_image = replace_extension( $prev_image, '.html' );
$next_image = replace_extension( $next_image, '.html' );
if ( !$riis_clean_urls ) {
$prev_image = $prev_image ? '?'.$prev_image : '';
$next_image = $next_image ? '?'.$next_image : '';
}
// navigation
$navigation = '';
$navigation .= $prev_image ? "$riis_previous" : $riis_previous;
$navigation .= ' | ';
$navigation .= $next_image ? "$riis_next" : $riis_next;
// permalink
$permalink_url = replace_extension( $this_image, '.html' );
if ( !$riis_clean_urls ) {
$permalink_url = '?'.$permalink_url;
}
$permalink = "$riis_permalink";
// image
$filename = full_image_path( $this_image );
if ( parse_image_metadata( $filename, $caption, $recdate ) ) {
$image_footer = format_image_footer( $caption, $recdate, $riis_separator, $riis_showday );
} else {
$image_footer = 'No postings yet...';
}
$image = $filename!='' ? "" : '';
if ($prev_image) {
$image = "$image";
}
// page title
$page_title = $riis_title;
$page_title .= ($query!="" && $caption!="") ? " :: $caption" : "";
}
?>
" type="application/rss+xml" />
echo $page_title; ?>
if ($show_blog_entry_page) {
?>
echo $image; ?>
|
echo $image_footer; ?>
|
|
} else {
?>
}
?>