This page has been moved to a more permanent spot. Please go there.

§3432 · December 15, 2008 · Tags: , ·

61 Comments to “Now Reading for WordPress 2.7”

  1. Oh – thanks for this! I use this plugin but haven’t upgraded yet. I will have to take a look at this file. Are the templates okay? I’ve got those fully customized. Thank you!

  2. Ben says:

    Natasha:

    If you’ve got custom templates, don’t include the ones in the download. They should be perfectly fine as-is.

  3. Conor says:

    I think that over the holiday season, I’ll do some work on my blog. It badly needs a total makeover, but I lack the skill for that. There is a lot of CSS adjustment I want to do, some of which you’ve helped me greatly on, and I might even pull in something like this plugin, if my sidebar isn’t too cramped with the standard 2.0 tripe.

    Thanks very much for sharing this! Long live OSS.

  4. Amanda says:

    I can’t figure out how to add books using WordPress version 2.7. Under Posts, I see Reading Now which I click. However all that shows up is the title "Reading Now" but no options to add books.

    What am I suppose to be seeing?

    Thanks!

  5. Ben says:

    Amanda,

    I’m not sure what’s wrong on your site: I see no such behavior on mine, even when I switch the Admin Menu Layout to “Multiple” like you apparently have.

    Are you attempting to use the version supplied here? Does your host use PHP 4 or 5?

  6. Rick says:

    I’ve tried both your version and Rob’s SVN release and seem to have the same issues. The library section isn’t working, editing books isn’t working and the book images do not show in the sidebar on my site although they do show in the admin. Any help would be great.

  7. Rick says:

    Ok the library seems to be working though the thumbnails and edit function still are not. I’m going to dig through my error logs and see if anything comes up but any ideas would be great.

  8. Ben says:

    Rick,

    I need more detailed information: what platform are you running (and what versions of PHP, etc), and how exactly are things not working?

  9. Brian says:

    I just discovered "Now Reading" (Rob’s original) but disabled it after not being able to even search for books on Amazon. I then found your version, installed and activated, and now it searches ok… But when I go to "edit" a book (because it automatically puts them under Planned Books) I see the options View, Edit, Delete pop up when I mouse over them, but when I click Edit the page just reloads; nothing else happens.

    How do I find out what version of PHP is installed? My blog is hosted at HostMonster. I just upgraded to WordPress 2.7 a couple days ago.

    Also, when I go to view the library, my sidebar is messed up. If you compare the screenshot at http://thelifeofbrian.info/temp/Clip.jpg with my actual blog at http://blog.thelifeofbrian.info you can see that the tabbed section with new posts, popular posts, etc. should be to the right of the page, but for some reason is on the left.

  10. Rick says:

    Debian
    PHP 5.2.x
    MySQL 5.1
    Apache 2.2.11.

    When I click to edit a book the page just reloads and does not show an area to edit the book. Adding books works but editing does not. Also the book thumbnails are not showing in the sidebar as they were before the upgrade to WP 2.7, they show in the admin as usual and on the single book page just not in the sidebar. However no related errors exist in my error logs.

  11. Ben says:

    With respect to sidebar or library templates: did either of you overwrite existing sidebar templates you had set up?

    The default templates assume a particular page setup—you need to make sure that they conform to your theme.

    With respect to the broken editing:

    When you attempt to edit a book, what’s the link that’s generated? Does it look like

    /wp-admin/admin.php?page=manage_books&action=editsingle&id=294

  12. Ben says:

    Aha! You’re both in “multi” mode for the Now Reading layout.

    Please upgrade to the latest version 4.4.4-helio3, which I believe fixes this problem.

  13. Brian says:

    Cool, that did the trick for editing. I guess the "multi" is default; I hadn’t even touched that setting.

    I’ll add it to my sidebar now that I know I can actually use the plugin… Thanks for your help!

  14. Brian says:

    well…. I see "Now Reading" at the bottom of my right sidebar where I put it – but that’s it. No books listed…

    And when I view the library it still messes up the top of the sidebar. I have not made any changes to templates today; but if you’re asking about "ever" – hehe, I’m not sure. I haven’t messed with the theme stuff in ages….

  15. Ben says:

    Brian,

    I’ve updated my modification of the plugin to work with Multi mode (@4.4.4-helio3).

    Your library problem is indeed caused by the default template adding code you don’t want.

    Edit the library.php file in your templates directory.

    On line 5, change <div id="content" class="now-reading primary narrowcolumn"> to <div id="left" class="now-reading primary narrowcolumn">.

    On line 7, change <div class="post"> to <div class="entry">

  16. Rick says:

    Yup that fixed the editing, I totally missed the option all together when I looked and it seems as Brian said, it is the default. The sidebar issue was just me being stupid, I was forgetting that it only showed images of the books with currently reading status. Is it just me or is the option to add multiple Meta Data sections per book missing?

  17. Ben says:

    Rick,

    Multiple metadata fields should be working again as of 4.4.4-helio5.

  18. Rick says:

    All is good now thanks for the help.

  19. Rob says:

    Thanks for this :) I assume you don’t mind me merging this into trunk?

  20. Ben says:

    Not at all, assuming you like the design decisions I made.

  21. Brian says:

    makin’ progress… :) Thanks for your help!

    I just did a search for a book by title (too lazy to go find the book to get the ISBN lol) and got this error:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /home2/lookfou1/public_html/blog.thelifeofbrian.info/wp-content/plugins/now-reading/xml/IsterXmlNode.php(286) : eval()’d code on line 1

    I was searching for "Brisingr" if that matters…

  22. Brian says:

    also – I had to make the changes you mentioned in the post above (re: library.php) in single.php as well. :)

  23. Rick says:

    Brian the memory issue sounds like a php.ini setting, you would need to increase PHP memory_limit. With that being said this script shouldn’t use that amount of mem, Ben will need to check for an infinite loop or similar issue in the code.

  24. Melodie says:

    Nice work, it really cleans up the display! I’m also running Rob’s pages addon (automatically pulls page count from Amazon). When I enable it with helio5 it returns this error when searching for a new book:
    "Fatal error: Call to undefined function: getelementbypath() in /path/to/home/directory/wp-content/plugins/now-reading-pages.php on line 12"
    The line in question is this:
    $pages = $item->getElementByPath(‘ItemAttributes/NumberOfPages’);

    Any ideas? Everything else works fine when I deactive the pages addon.

  25. [...] fear! Heliologue from the A Modest Construct blog has updated the plugin to work for WP2.7, and work it does! Tags: 2.7, now reading, [...]

  26. kate says:

    Hi, I just found the original Now Reading plugin and have spent days getting it to work on my site. I’m still not completely there and done with all the editing and was having trouble with the tags–trying to rename them so they all start with a capital letter–but they won’t rename. When save changes, the page reloads with either no tags, or the tags that were there before. I thought it had something to do with the fact that there were other books with the same tag, only slightly varied by different capitalization, so I was trying to just delete all the tags and start over, but it wouldn’t let me delete them…. anyway!

    So a google for others with this problem brought me here. I have no idea what NR looked like in previous versions of WP so I don’t know how it will be cleaned up. I’m worried about downloading and messing with all my customizations, though if you say I just need to not upload the templates folder again, I might give it a go. Do you think your version might take care of my tag issue? Any idea what could be causing it?

    I did upgrade to PHP 5 for this (which fixed the problem of not being able to search Amazon). And I was having the same issue as above with not being able to edit, until I switched to Single view. Now this tag issue is the only thing getting me down.

    I think I might go ahead and try your version. I’d like to see how it’s cleaner, anyway. I’ll let you know what I come up with. Thanks for taking on this project!

  27. Ben says:

    Kate,

    The guts of Now Reading haven’t really changed, so it’s unlikely that my modified version will fix any functionality issues you may have. It’s almost entirely a front-end change.

  28. [...] a 2.7 compatible version of Rob Miller’s Now Reading WordPress plugin. Had to do some minor adjustments to the [...]

  29. ellie says:

    This is excellent, just what I was looking for. I did try the one in SVN but it had some probs.

    I’m just about to download this and install but can anyone please tell me how to get Now Reading to count pages? I would really like to get that working but what I had used to be posted on Rob’s forum which is no more and now I don’t really know what to do to get it to count pages.

    And actually if anyone could also tell me how to get it to display what Rob has on his blog where it shows this:

    15 books and 4,151 pages read so far.

    That’s 29% of the way there with 100% of the year gone, 37 books behind schedule.

    in the sidebar?

    And if I could just ask one more question, does anyone know if there will be changes to how the NR for multiple users will work in the future as for now books can be entered multiple times without a check saying it is already entered. So my problem is that I wanted to create a list displaying how many members have read the same book but it’s impossible in the current setup.

    Sorry for all the questions but with Rob’s forum gone there’s nowhere to ask.

    Thanks

  30. Ben says:

    Elle,

    The display Rob has in his sidebar is a different plugin that only Rob has, and isn’t part of the canonical NR plugin.

    The other features you request aren’t currently part of the plugin’s functionality, and I can’t quote you development timelines.

  31. ellie says:

    thanks for your reply Ben.

    Do you know how to get the page count from amazon to work as I would especially like that. I can post the code that I have if you can maybe make some sense of it. I’m not a coder but I’m really good a copy/pasting :)

  32. kate says:

    Okay, so here’s another problem I’m having…maybe just since uploading this version, but it could just be searching for different books. Some books still work, but some, when I search amazon, it will pull up a few of the raw xml data, and not any of the actual results with pictures and everything, and then give this error:

    Fatal error: Call to a member function CDATA() on a non-object in /home/thethi6/public_html/simplymother.com/wp-content/plugins/now-reading/amazon.php on line 147

    And sometimes it won’t do anything at all: after typing in an author name and clicking enter, the page just reloads.

    But I can still search for some books, so . . . weird? The books that don’t work do exist on Amazon. It even appears to be pulling some of the information over, in the raw XML form.

  33. kate says:

    Well… I messed around with that line 147 … tried to change it back to what the original version said (just copying and pasting, I have no idea what any of it means). Well, it didn’t work, so I just undid everything and went back to what your version says. And now? It’s working fine. I can’t duplicate the problem I was having. All the books that weren’t working before? I’ve added, no problem. Computers are sooo weird.

  34. Ben says:

    Kate,

    I’ve had that intermittent problem with book searches long before WordPress 2.7. I long ago just went straight to Amazon and copied the ISBN.

    So, long story short, your problem is with the core of NR and beyond my current purview.

  35. dave says:

    Kate, try these modification (make a backup first) and let us know if it works. I was able to get the author/title query to work correctly using this fix. PS I add my thanks to the original author for porting!

    On line 31 of amazon.php

    } else {
    	$query=''; // this is the line that is different
    	if ( !empty($title) )
    		$query = 'title:' . urlencode($title);
    	if ( !empty($author) )
    		$query .= 'author:' . urlencode($author);
    }

    On line 147 of amazon.php

    $size = "{$options['imageSize']}Image";
    	if (empty($item->$size)) // this is the line that is different
    		continue; 
    $image = $item->$size->URL->CDATA();

    On line 67 of admin-add.php

    if (  !empty($_POST['u_isbn']) || !empty($_POST['u_author']) || !empty($_POST['u_title']) ) {
  36. I recently installed (thanks for working on this!) and ran into one problem: the plugin has a bunch of require statements that have filenames in mixed case, but the archive that I downloaded (Version 4.4.4-helio5) had the files in lowercase. I renamed the files and things seem OK, but thought you’d like the feedback.

    Cheers.

  37. Ben says:

    Dave,

    Much obliged! I’ve incorporated your changes into my port and released the code as 4.4.4-helio6.

  38. Ben says:

    Johnathan,

    I’m not exactly sure to what you’re referring. Can you give me file+line for the mixed-case requires you see?

  39. I didn’t keep track of all of them, but the first one to cause trouble was line 102 in amazon.php.

  40. Ben says:

    At least in the case of the xml directory to which you’re referring, both my source code and the downloadable archive have mixed-case filenames.

  41. Odd. When I decompressed them, they were definitely lower case. Well, hope I’m the only one who ran into this. Thanks again.

  42. Ben says:

    What’s your platform/decompression tool?

  43. I just figured it out trying to update to the latest. I’m using Unix unzip 5.52 and had to use the -U option to prevent it from converting filename case when the archive comes from a case insensitive file system. This is the first time I’ve had to use that option, but that solved it. Now I know.

  44. Is there anyway i can make this backwards compatible with php4? Im currently stuck on a server running that older version, so obviously i cannot search amazon. How easy would it be to change the rss method so that I can get it working with php4?

  45. Bob Weber says:

    Just upgraded to WP 2.7 and installed your version of the now reading plugin. Looks great.

    One problem I’m having is that since the update the dates for the started reading and finished reading don’t come across right. They look like this
    %Mon %b %2007

    Anyone else seen this? Any idea what causes it?

  46. Kaitlin says:

    Thanks! I’ve been searching for a way to manage my library and this seems like it may just do the trick! I had found the original plugin and was searching to make sure it would work with the newest version of WP and found your site. I’m excited to try it out.

  47. Ignore my previous post, I changed my hosting yesterday and I now have php5 functionality. I’ve installed the now reading version from this page and all is working great!

    Im after a bit of advice which maybe slightly out of the scope of this page.

    I have a tabbed navigation system on my site that uses wordpress conditional tags to determine which is the active page etc. If the page is active it changes the tab colour to match the page, you can see by looking at my site http://www.dinsdale-uk.com.

    Anyway, the problem im having is matching the now reading library page to a condition in worpress. Because the library isnt a ‘page’ in wordpress, i dot know how I can match it.

    I wondered if anyone here ahd an ideas?

  48. I just noticed that my sidebar was placed below the content when viewing a single books page. I believe that templates/single.php should have the outside the last closing div (as it is in templates/library.php). Changing this fixed the problem.

  49. Sorry, "have the <?php get_sidebar() ?> outside the last closing div [tag]". Let’s see if that works…

  50. Dayna says:

    I love this plugin, it’s easy to modify as well with the templates. But a slight problem with the permalinks.

    If I change the default permalinks from library/ to maybe book/library/ instead. The single book page will have the correct permalinks, but the library link and the author page link will be wrong. they stay at the default library/. Is there any way to fix this? Thanks :)

  51. I’ve only been able to add one book from Amazon so far.

    When I search for books, the page seems to hang slightly (~1 second) and then comes back with the heading "Search Results" but nothing else, not even the stuff about adding the page manually. Looking at the returned source HTML, it ends immediately after that header. I wonder if the process is being killed as it’s writing the page because it takes too much memory or something. Debug mode didn’t give me any information (not surprising if the process is being killed).

    The only way I’m able to add books is to put a single space in the title search field and search for that. The script successfully tells me almost immediately that it found no books and allows me to add manually.

    I can’t find any documentation on search related problems, so any help is most appreciated.

  52. Ben says:

    What version are you running when you experience this problem?

  53. Dayna says:

    I fix it by editing the URL inside the template-functions plugin file. I’m running version 2.7 by the way. Just wondering, is there a way to display a specific number of books randomly?

    Thanks.

  54. Christy says:

    I wonder if you can help. Whenever I try to add a book I get an error. "Error adding book!" I don’t get any code errors can I can see, and the amazon lookup works fine. I’m on WP2.7, using PHP5 and MySQL 5.0. If I prime the database with a single bogus record, then I don’t get the error when I try to add, rather it seems to try and update the same record, though the details of the bogus record never change, even when I try to edit it.

    Any thoughts?

  55. Ben says:

    Christy,

    Can you enable debug mode (in the NR options page) and post any additional details about the error?

  56. Theresa says:

    I’m wondering if you can help me. For some reason the font for Planned, Current and Recent is huge on my site. http://theresafrasch.com Is there a way to make it smaller?

    BTW I’ve been keeping track of my books read for years, this last year on Goodreads: 91!

    Thanks.

  57. Ben says:

    Those items are outputted as level-3 headers, which are sized a 24px, according to your theme. You might want to change it to more like 16px, or change the tags.

  58. Viitoria says:

    Haha. You must be some kind of god — I’ve been waiting for an update like this since forever. Thank you so much.

  59. Joanna says:

    Hi Ben :)
    First of all, thanks a lot for doing this upgrade. I’ve been having some issues with this plugin, though.
    First – my layout gets broken (see: http://www.pozaschematy.pl/czytelnia/), the sidebar ends up at the bottom. Where do I change stuff, in NR templates? What would be the quickest fix?
    Second – when I do a search to add a new book, I get a blank screen. When I turn on the debug mode, I get a bunch of tables with XML and the amazon search result. Strange. But I’m able to add a book then.
    Third – I rarely use Amazon (since they don’t have books in Polish, which is my language) and I redirect to Polish bookstores. It’d be great if the "add manually" option would be available straight away, without having to do a fake amazon search. In one of the first versions of NR I was able to hack it easily, now the code got more sophisticated and I don’t want to screw anything up. Any ideas?
    thanks a lot
    Joanna

  60. I want to second Joanna’s idea of having the manual add available immediately.