1. Doug Stewart
  2. elbee-elgee

Commits

Doug Stewart  committed 292a930

Moving Now Reading support out of trunk.

  • Participants
  • Parent commits d418d45
  • Branches child-themes

Comments (0)

Files changed (6)

File literalbarrage/now-reading/author.php

View file
+<?php get_header() ?>
+
+<div id="allwrapper">
+<div id="wrapper">
+	
+	<div id="content" class="now-reading primary narrowcolumn">
+	
+	<div class="post">
+		
+		<?php if( can_now_reading_admin() ) : ?>
+			
+			<p>Admin: &raquo; <a href="<?php manage_library_url() ?>">Manage Books</a></p>
+			
+		<?php endif; ?>
+		
+		<?php library_search_form() ?>
+		
+		<p><a href="<?php library_url() ?>">&larr; Back to library</a></p>
+		
+		<h2>Books by <?php the_book_author() ?></h2>
+		
+		<?php if( have_books("author={$GLOBALS['nr_author']}&num=-1") ) : ?>
+			
+			<ul>
+			
+			<?php while( have_books("author={$GLOBALS['nr_author']}&num=-1") ) : the_book(); ?>
+				
+				<li>
+					<p><a href="<?php book_permalink() ?>"><img src="<?php book_image() ?>" alt="<?php book_title() ?>" /></a></p>
+					<p><?php book_title() ?></p>
+				</li>
+				
+			<?php endwhile; ?>
+			
+			</ul>
+			
+		<?php else : ?>
+			
+			<p>There are no books by this author!</p>
+			
+		<?php endif; ?>
+		
+		<?php do_action('nr_footer'); ?>
+		
+	</div>
+	
+	</div>
+	
+</div>
+
+<?php get_sidebar() ?>
+
+</div>
+
+<?php get_footer() ?>

File literalbarrage/now-reading/library.php

View file
+<?php get_header() ?>
+
+<div id="allwrapper">
+<div id="wrapper">	
+	<div id="content" class="now-reading primary narrowcolumn">
+	
+	<div class="post">
+		
+		<?php if( can_now_reading_admin() ) : ?>
+			
+			<p>Admin: &raquo; <a href="<?php manage_library_url() ?>"><?php __('Manage Books', NRTD);?></a></p>
+			
+		<?php endif; ?>
+		
+		<p><?php total_books() ?> overall; <?php books_read_since('1 year') ?> read in the last year; <?php books_read_since('1 month') ?> <?php __('read in the last month. That\'s', NRTD);?> <?php average_books('month'); ?>.</p>
+		
+		<?php library_search_form() ?>
+		
+		<h2>Planned books (<?php echo total_books('unread', 0) ?>):</h2>
+		
+		<?php if( have_books('status=unread&num=-1') ) : ?>
+			
+			<ul>
+			
+			<?php while( have_books('status=unread&num=-1') ) : the_book(); ?>
+				
+				<li><a href="<?php book_permalink() ?>"><?php book_title() ?></a> by <a href="<?php book_author_permalink() ?>"><?php book_author() ?></a></li>
+				
+			<?php endwhile; ?>
+			
+			</ul>
+			
+		<?php else : ?>
+			
+			<p>None</p>
+			
+		<?php endif; ?>
+		
+		<h2>Current books (<?php echo total_books('reading', 0) ?>):</h2>
+		
+		<?php if( have_books('status=reading&num=-1') ) : ?>
+			
+			<ul>
+			
+			<?php while( have_books('status=reading&num=-1') ) : the_book(); ?>
+				
+				<li>
+					<p><a href="<?php book_permalink() ?>"><img src="<?php book_image() ?>" alt="<?php book_title() ?>" /></a></p>
+					<p><a href="<?php book_permalink() ?>"><?php book_title() ?></a> by <a href="<?php book_author_permalink() ?>"><?php book_author() ?></a></p>
+				</li>
+				
+			<?php endwhile; ?>
+			
+			</ul>
+			
+		<?php else : ?>
+			
+			<p>None</p>
+			
+		<?php endif; ?>
+		
+		<h2>Recent books (<?php echo total_books('read', 0) ?>):</h2>
+		
+		<?php if( have_books('status=read&orderby=finished&order=desc&num=-1') ) : ?>
+			
+			<ul>
+			
+			<?php while( have_books('status=read&orderby=finished&order=desc&num=-1') ) : the_book(); ?>
+				
+				<li><a href="<?php book_permalink() ?>"><?php book_title() ?></a> by <a href="<?php book_author_permalink() ?>"><?php book_author() ?></a></li>
+				
+			<?php endwhile; ?>
+			
+			</ul>
+			
+		<?php else : ?>
+			
+			<p>None</p>
+			
+		<?php endif; ?>
+		
+		<?php do_action('nr_footer'); ?>
+		
+	</div>
+	
+	</div>
+</div>	
+<?php get_sidebar() ?>
+
+</div>
+
+<?php get_footer() ?>

File literalbarrage/now-reading/search.php

View file
+<?php get_header(); ?>
+
+<div id="allwrapper">
+<div id="wrapper">
+<div class="content">
+	
+	<div id="content" class="narrowcolumn primary now-reading">
+	
+	<div class="post">
+		
+		<?php if( can_now_reading_admin() ) : ?>
+			
+			<p>Admin: &raquo; <a href="<?php manage_library_url() ?>">Manage Books</a></p>
+			
+		<?php endif; ?>
+		
+		<p><a href="<?php library_url() ?>">&larr; Back to library</a></p>
+		
+		<?php library_search_form() ?>
+		
+		<p>Search results for <?php search_query(); ?>:</p>
+		
+		<?php if( have_books("status=all&num=-1&search={$GLOBALS['query']}") ) : ?>
+			
+			<ul>
+			
+			<?php while( have_books("status=all&num=-1&search={$GLOBALS['query']}") ) : the_book(); ?>
+				
+				<li><a href="<?php book_permalink() ?>"><?php book_title() ?></a> by <a href="<?php book_author_permalink() ?>"><?php book_author() ?></a></li>
+				
+			<?php endwhile; ?>
+			
+			</ul>
+			
+		<?php else : ?>
+			
+			<p>Sorry, but there were no search results for your query.</p>
+			
+		<?php endif; ?>
+		
+		<?php do_action('nr_footer'); ?>
+		
+	</div>
+	
+	</div>
+	
+</div>
+</div>
+
+<?php get_sidebar() ?>
+
+</div>
+
+<?php get_footer() ?>

File literalbarrage/now-reading/sidebar.php

View file
+<div class="now-reading">
+	
+	<h3>Planned books:</h3>
+	
+	<?php if( have_books('status=unread') ) : ?>
+		
+		<ul>
+		
+		<?php while( have_books('status=unread&num=2') ) : the_book(); ?>
+			
+			<li><a href="<?php book_permalink() ?>"><?php book_title() ?></a> by <?php book_author() ?></li>
+			
+		<?php endwhile; ?>
+		
+		</ul>
+		
+	<?php else : ?>
+		
+		<p>None</p>
+		
+	<?php endif; ?>
+	
+	<h3>Current books:</h3>
+	
+	<?php if( have_books('status=reading') ) : ?>
+		
+		<ul>
+		
+		<?php while( have_books('status=reading') ) : the_book(); ?>
+			
+			<li>
+				<p><a href="<?php book_permalink() ?>"><img src="<?php book_image() ?>" alt="<?php book_title() ?>" /></a></p>
+				<p><strong><?php book_title() ?></strong> by <?php book_author() ?></p>
+			</li>
+			
+		<?php endwhile; ?>
+		
+		</ul>
+		
+	<?php else : ?>
+		
+		<p>None</p>
+		
+	<?php endif; ?>
+	
+	<h3>Recent books:</h3>
+	
+	<?php if( have_books('status=read&orderby=finished&order=desc') ) : ?>
+		
+		<ul>
+		
+		<?php while( have_books('status=read&orderby=finished&order=desc&num=2') ) : the_book(); ?>
+			
+			<li><a href="<?php book_permalink() ?>"><?php book_title() ?></a> by <?php book_author() ?></li>
+			
+		<?php endwhile; ?>
+		
+		</ul>
+		
+	<?php else : ?>
+		
+		<p>None</p>
+		
+	<?php endif; ?>
+	
+	<p><a href="<?php library_url() ?>">View full Library</a></p>
+	
+</div>

File literalbarrage/now-reading/single.php

View file
+<?php get_header(); global $nr_id; ?>
+
+<div id="allwrapper">
+<div id="wrapper">
+	
+	<div id="content" class="narrowcolumn primary now-reading">
+	
+	<div class="post">
+		
+		<?php if( have_books(intval($nr_id)) ) : ?>
+			
+			<?php while ( have_books(intval(nr_id)) ) : the_book(); ?>
+			
+			<?php if( can_now_reading_admin() ) : ?>
+			<p>Admin: &raquo; <a href="<?php manage_library_url() ?>">Manage Books</a> &raquo; <a href="<?php book_edit_url() ?>">Edit this book</a></p>
+			<?php endif; ?>
+			
+			<?php library_search_form() ?>
+			
+			<p><a href="<?php library_url() ?>">&larr; Back to library</a></p>
+			
+			<h2><?php book_title() ?></h2>
+			<p>By <a href="<?php book_author_permalink() ?>"><?php book_author() ?></a></p>
+			
+			<p>
+				<a href="<?php book_url() ?>"><img src="<?php book_image() ?>" alt="<?php book_title() ?>" /></a>
+			</p>
+			
+			<?php if( !is_custom_book() ): ?>
+				<p>You can view this book's Amazon detail page <a href="<?php book_url() ?>">here</a>.</p>
+			<?php endif; ?>
+			
+			<?php if( book_has_post() ): ?>
+				<p>This book is linked with the post <a href="<?php book_post_url() ?>">&ldquo;<?php book_post_title() ?>&rdquo;</a>.</p>
+			<?php endif; ?>
+			
+			<p>Tags: <?php print_book_tags(1) ?></p>
+			
+			<dl>
+				<dt>Started reading:</dt>
+				<dd><?php book_started() ?></dd>
+				
+				<dt>Finished reading:</dt>
+				<dd><?php book_finished() ?></dd>
+				
+				<?php print_book_meta(0); ?>
+			</dl>
+			
+			<div class="review">
+				
+				<h3>Review</h3>
+				
+				<p><strong>Rating:</strong> <?php book_rating() ?></p>
+				
+				<?php book_review() ?>
+				
+			</div>
+			
+			<?php endwhile; ?>
+			
+		<?php else : ?>
+			
+			<p>That book doesn't exist!</p>
+			
+		<?php endif; ?>
+		
+		<?php do_action('nr_footer'); ?>
+		
+	</div>
+	
+	</div>
+</div>
+<?php get_sidebar(); ?>
+
+</div>
+
+<?php get_footer(); ?>

File literalbarrage/now-reading/tag.php

View file
+<?php get_header(); ?>
+
+<div id="allwrapper">
+<div id="wrapper">
+	
+	<div id="content" class="narrowcolumn primary now-reading">
+	
+	<div class="post">
+	
+	<?php if( can_now_reading_admin() ) : ?>
+		
+		<p>Admin: &raquo; <a href="<?php manage_library_url() ?>">Manage Books</a></p>
+		
+	<?php endif; ?>
+	
+	<p><a href="<?php library_url() ?>">&larr; Back to library</a></p>
+	
+	<?php library_search_form() ?>
+	
+	<p>Viewing books tagged with &ldquo;<?php the_tag(); ?>&rdquo;:</p>
+	
+	<?php if( have_books("tag={$GLOBALS['nr_tag']}&num=-1") ) : ?>
+		
+		<ul>
+		
+		<?php while( have_books("tag={$GLOBALS['nr_tag']}&num=-1") ) : the_book(); ?>
+			
+			<li><a href="<?php book_permalink() ?>"><?php book_title() ?></a> by <a href="<?php book_author_permalink() ?>"><?php book_author() ?></a></li>
+			
+		<?php endwhile; ?>
+		
+		</ul>
+		
+	<?php else : ?>
+		
+		<p>Sorry, but there were no search results for your query.</p>
+		
+	<?php endif; ?>
+	
+	<?php do_action('nr_footer'); ?>
+	
+	</div>
+		
+	</div>
+	
+</div>
+
+<?php get_sidebar() ?>
+
+</div>
+
+<?php get_footer() ?>