id, $author->id); if ($already_requested && $notify_author == 'n') sql_generic_delete('notify_author', array('user_id' => $user->id, 'author_id' => $author->id)); elseif (!$already_requested && $notify_author == 'y') sql_insert_notify_author($user->id, $author->id); } print_header($author->name, $user); print_author_info($user, $author); print_footer(); exit; ###################################################################### # Print all the author info. function print_author_info($user, $author) { global $ENV; # Format display values for everything. # Edit author link. $edit_author_link = edit_link('admin_author.php', $author->id, $user->edit_mode); # Author's real name/id, if author is pseudonymous. if ($author->actual_id) { $actual_author = sql_select_actual_author($author->actual_id); $display_actual = 'Pseudonym for ' . id_link('author', $actual_author->id, $actual_author->name, 'none') . '.
'; $alt_sql_ids .= ',' . $actual_author->id; $alt_search_ids .= ',' . $actual_author->id; } # Author's pseudonyms, if any. $pseudonyms = sql_select_pseudonyms($author->id); if ($pseudonyms) { foreach ($pseudonyms as $pseudonym) { $display_pseudonyms .= 'Pseudonym: ' . id_link('author.php', $pseudonym->id, $pseudonym->name) . '.
'; $alt_sql_ids .= ',' . $pseudonym->id; $alt_search_ids .= ',' . $pseudonym->id; } } if ($display_actual || $display_pseudonyms) $display_name_info = '

' . $display_actual . $display_pseudonyms . '

'; # Bio. if ($author->bio) $display_bio = '

' . add_p_tags($author->bio) . '

'; # Author picture. $author_pic = get_image_filename($author->id, 'authors'); if ($author_pic) { $display_picture = "
"; $display_picture_name = $author->name; } # URL. if ($author->url) $display_url = '
' . $author->url . ''; # Author books. $author_books = sql_select_books("ba.author_id = $author->id order by b.publication_date desc"); if ($author_books) { $display_author_books = '

Books:
'; 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 .= '

'; } # Author appearances. $appearances = sql_select_appearances("and a.author_id in ($author->id $alt_sql_ids) and a.date >= curdate() order by a.date asc"); if ($appearances) { $display_appearances = '

'; } # 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_notify =<< (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_notify =<< (Notify me via e-mail when $author->name releases a new book.)

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

END; } print<<
$display_picture $display_notify $display_snippets

$display_picture_name $display_url $display_appearances


$author->name $edit_author_link

$display_name_info $display_bio $display_author_books END; return; } ?>