Archive for the 'software' Category

Bookshelf

Wednesday, March 29th, 2006

I’ve created a plugin for Wordpress that will display a graphical library of books that you read. This plugin allows you to track when you started and finished a book.

Download

Installation

  1. Extract the bookshelf plugin into your wp-content/plugins directory.
  2. Enable the plugin in the WordPress administration interface.

Entering books

The interface for entering books for Bookshelf is located under the Manage tab under the submenu Bookshelf

Currently the plugins stores the following information per book:

  • ISBN
  • Title
  • Author
  • Date Started
  • Date Finished

The image for a book is keyed off of the ISBN.

Templates

The Bookshelf plugin exports two functions to be used in templates:

  • bookshelf_display_library() This functions displays all books in the library
  • bookshelf_display_recent_reading() This functions displays the current most reading.

To have the current readind displayed on the sidebar place the following code in sidebar.php

<li style="height: 125px;"><h2>Current Reading</h2>
<?php bookshelf_display_recent_reading() ?>
</li>

Note: I’m not very good at CSS and the only way for me to get the sidebar to layout correctly was adding the <li style="height: 125px;">. Otherwise everything but the current reading was shifted to the bottom of the sidebar.

The following template can be used to create a page that will display all books in a library.

<?php
/*
Template Name: Bookshelf
*/
?>
<?php get_header(); ?>
<div id="content">
<div style="margin-left: 40px;">
<?php bookshelf_display_library() ?>
</div>
</div>
<?php get_footer(); ?>

CSS

Each image is of the class reflect. If you download reflection.js and add it to you site css all book images will be reflected.