title, $user); print_book_info($user, $book); print_footer(); exit; ###################################################################### # Print all the book info. function print_book_info($user, $book) { global $ENV; # Format display values for everything. # 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); # Tagline. if ($book->tagline) $display_tagline = '

' . $book->tagline . '

'; # Summary, excerpt. $book_texts = sql_select_book_texts($book->id); if ($book_texts) { foreach ($book_texts as $book_text) { if ($book_text->type == 'Summary') $display_summary = '

' . add_p_tags($book_text->text) . '

'; if ($book_text->type == 'Excerpt') $excerpt_link = '

' . id_link('excerpt', $book->id, '', 'none') . '

'; } } # Book URL. if ($book->url) { $url_text = ($book->url_text) ? $book->url_text : $book->url; $display_url = '

' . $url_text . '

'; } # Book specs. $display_specs = '

' . build_basic_book_info($book, array('title', 'author')) . '

'; # Cover picture. $cover_pic = get_image_filename($book->isbn, 'books'); if ($cover_pic) $display_picture = "
"; # Social network links. $book_page_title = urlencode($ENV['site_name'] . ': ' . $book->title); $network_links =<<

END; # Amazon link. (Actually builds Penguin, BN, and Amazon links.) $asin = get_asin_from_isbn($book->isbn); $amazon_link =<<
Barnes & Noble.com

END; if (strlen($book->isbn) < 13) { $amazon_link .=<<
END; } $amazon_link .= '

'; # Review snippets. $review_snippets = sql_select_review_snippets($book->id); if ($review_snippets) { foreach ($review_snippets as $review_snippet) { $display_snippet_reviewer = ($review_snippet->review_url) ? '' . $review_snippet->reviewer . '' : $review_snippet->reviewer; $display_snippets .= '

"' . $review_snippet->snippet . '" ' . $display_snippet_reviewer . '

'; } } # Author books. $authors = sql_select_book_authors($book->id, 1); if ($authors) { foreach ($authors as $author) { $author_books = sql_select_books("ba.author_id = $author->id and b.id <> $book->id order by b.publication_date desc"); if ($author_books) { $display_author_name = id_link('author', $author->id, $author->name, 'none'); $display_author_books .= "

Also by $display_author_name:
"; foreach ($author_books as $author_book) { # Basic book info. $display_author_books .= build_basic_book_info($author_book, array('series', 'author', 'publisher', 'specs', 'characters')); } $display_author_books .= '

'; } # Offer to notify the user when the author releases a new # book (if the user is logged in and has not already # requested a notification). if ($user) { $already_requested = sql_select_notify_author_duplicates($user->id, $author->id); if ($already_requested) { $display_author_books .=<< (At your request, an e-mail will be sent to you when $author->name releases a new book. You may click here to cancel these notifications.)

END; } else { $display_author_books .=<< (Notify me via e-mail when $author->name releases a new book.)

END; } } else { $display_author_books .=<< (Notify me via e-mail when $author->name releases a new book.)

END; } } } print<<
$display_picture $network_links $amazon_link $display_snippets

$book->title $edit_book_link
$display_author

$display_tagline $display_summary $excerpt_link $display_url $display_specs $display_author_books END; return; } ?>