id); foreach ($book_texts as $book_text) { if ($book_text->type == 'Excerpt') $excerpt = $book_text->text; } # No valid excerpt? Then redirect to book page. if (!$excerpt) { header("Location: {$ENV['home']}book$book->id"); exit; } print_header($book->title, $user); print_excerpt($user, $book, $excerpt); print_footer(); exit; ###################################################################### # Print all the book info. function print_excerpt($user, $book, $excerpt) { # Format display values for everything. # Book title. $display_title = id_link('book', $book->id, $book->title, 'none'); # Edit book link. $edit_book_link = edit_link('admin_book.php', $book->id, $user->edit_mode); # Author(s). $display_author = sql_select_book_authors($book->id); # Excerpt. $display_excerpt = '

' . add_p_tags($excerpt) . '

'; # Cover picture (thumbnail-sized). $cover_pic = get_image_filename($book->isbn, 'books'); if ($cover_pic) $display_picture = ""; print<<
$display_picture $display_snippets

$display_title $edit_book_link
$display_author

Excerpt

$display_excerpt END; return; } ?>