Bookshelf

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.

4 Responses to “Bookshelf”

  1. oscarlovescrawfish Says:

    You should package it as a WP plugin.

  2. kloos Says:

    Thought I let you know I enhanced your bookshelf plug-in to hold a description as well as a rating with every book. I hope you don’t mind I altered your plug-in. You can see the result here: http://www.martinkloos.nl/ik-lees

  3. Jason Parks Says:

    Not at all.

  4. MartinKloos.nl » Boekenkast bijgewerkt Says:

    […] Mijn boekenkast is bijgewerkt. Dankzij een plugin van jparks.net (die ik wel enigzins uitgebouwd heb) staat er nu een net en makkelijk te onderhouden lijstje met te lezen en gelezen werk op de site. […]

Leave a Reply

You must be logged in to post a comment.