By Connie on
Friday, 15 May 2009 at
Posted in Adventures in Coding |
No Comments »
I’ve been using the Now Reading Plugin by Rob Miller as a means of keeping track of the books I read. I encountered a problem a couple months ago in that it was no longer able to retrieve books from Amazon and so I had to enter them manually.
Yesterday I came across A Modest Construct which has a post on Now Reading for WordPress 2.7+ this version actually works! I like how Helio has made adding a book manually always available. Something of note however is that when you add a book manually, you don’t have the option to include or later edit an ASIN.
I started looking around the code and found where to make a few simple additions to allow the editing of the ASIN of a book.
In the file admin-manage.php, after line 126 add:
<th valign="top" scope="row">
<label for="asin-0">' . __("ASIN", NRTD) . '</label>
<input type="text" class="main" id="asin-0" name="asin" value="' . $existing->asin . '" />
Then in the edit.php file, after line 49 add:
$asin = $wpdb->escape($_POST['asin'][$i]);
and after line 104 add:
b_asin = '$asin',
And now the ASIN number is editable when you edit the book… having an ASIN number for a book allows the plugin to create the links to amazon. It annoyed me that half my books had links and the other half did not.
Now that I have managed to get the plugin actually working, I might look at actually styling the individual book pages…